[Haskell-cafe] Capitalization and associated type families
brianh at metamilk.com
Tue Aug 5 15:06:30 EDT 2008
Jonathan Cast wrote:
> It's weird. ML-derived languages are functional languages at the value
> level (and have regular lambda-bound variables in consequence), but are
> logical languages at the type level (and have logical variables in
> consequence). So ordinary lambda-bound variables, like in ML-style
> functors (parametrized modules) act more like type constants than like
> type variables.
Thanks - the above seems to be a promising avenue of thought to arrive
at clarity regarding case distinctions at the type level, and I can see
here the basis for a good argument of why there would actually be no
inconsistency regarding the use of capitals for module type members and
lowercase for the class parameters. Perhaps this is also the root of the
difference between associated type synonyms and class params.
Ie at the type level, uppercase == functional variable (aka "constant")
and lowercase == logic variable...
The type level now seems to me to be quite significantly more
complicated than the value level due to the mixing of functional and
logic programming, not to mention that at the type level "variables" in
an outer scope become "constants" in an inner scope as far as pattern
matching is concerned whereas for value patterns variables are always
fresh and never scoped (over other patterns).
Therefore I've decided to deal with the issue of case at each level
separately since it seems immediately clear that the case distinction at
the value level, as in Haskell/OCaml/Moby, is obviously good due to the
"foolproof" nature of value patterns you pointed out, whereas at the
type level it may also be good but I'll need a few more months to think
about it... ;-)
More information about the Haskell-Cafe