[Haskell-cafe] Reader monad
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?
> 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,
> 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...
More information about the Haskell-Cafe