[Haskell-beginners] Difference between types and values

Martin Vlk martin at vlkk.cz
Tue Jun 16 07:26:16 UTC 2015


One useful way to understand this is to note you will see T in type
annotations and A, B in your actual code.

I.e. T is a type constructor and A, B are data constructors.

M.

Matt Williams:
> Dear All,
> 
> I am sure this is a common mistake, and I am happy to be pointed elsewhere
> for reading.
> 
> I have spent the last couple of days on the Haskell irc channel, which was
> very helpful.
> 
> However, one of the points of discussion left me confused.
> 
> When we have a type, T, with constructors A and B
> 
> (e.g. data T = A x y z | B x y)
> 
> How do I understand the relationship between A, B and T? I had thought I
> could use the sub-class relationship, but that doesn't seem to be true.
> 
> Any other pointers very welcome.
> 
> Matt
> 
> 
> 
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> 


More information about the Beginners mailing list