[Haskell-beginners] Type signatures returned with :t

Galaxy Being borgauf at gmail.com
Sat Sep 18 22:30:17 UTC 2021


> :t Just True
Just True :: Maybe Bool
> :t Left True
Left True :: Either Bool b
> :t Right False
Right False :: Either a Bool

What am I being told here? It seems

data Maybe a = Just a
             | Nothing
data Either a b = Left a
                | Right b

are both straightforward parameterized types, but Maybe doesn't give me a
type parameter back, while Either does, and in different order, different
names (a becomes b; b becomes a) depending on which variable I invoke. What
deeper lore am I not seeing here?


-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borgauf at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20210918/fe39d083/attachment.html>


More information about the Beginners mailing list