[Haskell-cafe] Reader monad

Michael Lazarev lazarev.michael at gmail.com
Wed Dec 29 22:07:57 CET 2010

2010/12/29 Albert Y. C. Lai <trebla at vex.net>

> On 10-12-29 12:50 PM, michael rice wrote:
>> I think of (r -> m a) as a type signature and Int or Bool by themselves
>> as types. So, all type signatures are themselves types?
> http://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-620004
> In particular
> gendecl → vars :: [context =>] type    (type signature)
> Therefore I think of
> n :: Int
> f :: r -> m a
> as type signatures, and their right-hand sides alone,
> Int
> r -> m a
> as types.

I used to think about types as mathematical sets, and type signatures in
this case are just sequences of characters denoting these types. They of
course must have some formal grammar as it was quoted above.

I'd like to note that one type can be denoted by many type signatures. For
example, String and [Char]. And as another case, a -> b and c -> d. One may
come up with more advanced examples involving type families.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20101230/cef73ff5/attachment.htm>

More information about the Haskell-Cafe mailing list