[Haskell-cafe] lists as instances of a class?
Sebastian Sylvan
sylvan at student.chalmers.se
Mon Jul 10 11:15:54 EDT 2006
On 7/10/06, Bayley, Alistair <Alistair_Bayley at invescoperpetual.co.uk> wrote:
> > From: haskell-cafe-bounces at haskell.org
> > [mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Spencer Janssen
> >
> > The problem isn't with lists specifically, but with any instance that
> > applies types (rather than type variables) to a type constructor
> >
> > >From section 4.3.2 of The Haskell 98 Report: "The type (T u1 ... uk)
> > must take the form of a type constructor T applied to simple type
> > variables u1, ... uk". I've run into this restriction several times
> > myself, and I'm also curious whether this will change in Haskell'.
> >
> >
> > Spencer Janssen
>
>
> Sorry, I'm struggling with this. Why is [] not of the form (T a b c ...)
> ?
>
> I assume that [] is syntactic sugar for something like:
>
> data List a = Cons a | Nil ===>? data [a] = (:) a | []
>
> so [Double] is just sugar for List Double, which appears to me to be of
> the form (T a b c ...).
>
> What subtlety am I missing?
>
Double is not a type variable.
/S
--
Sebastian Sylvan
+46(0)736-818655
UIN: 44640862
More information about the Haskell-Cafe
mailing list