Haskell Foldable Wats

Manuel Gómez targen at gmail.com
Thu Feb 18 14:37:06 UTC 2016

On Thu, Feb 18, 2016 at 9:58 AM, Andreas Abel <andreas.abel at ifi.lmu.de> wrote:
> I also do not see why (a,a) could not be a container of exactly two
> elements, as opposed to current GHC which insists it is a container of
> exactly one element.  (Case for the mental institution, I'd say.)

Because, given

    data T a = T a a
    data T' a b = T a b

these two types have essential structural differences at the type
level, despite being isomorphic:

    forall a. T a
    forall a. T' a a

Type classes exist at the type level.  These things are decidedly
different at the type level.  It’s to be expected that their behavior
under Functor differs.

More information about the Libraries mailing list