Comment by kccqzy
1 day ago
Yeah it's definitely unusual to allow ' to be part of the name of a variable, especially considering that it is, like C, the quote for character types.
1 day ago
Yeah it's definitely unusual to allow ' to be part of the name of a variable, especially considering that it is, like C, the quote for character types.
In Haskell's case that is indirectly Lisp's fault. Lisp heard of Algol (C's design-by-committee "grandparent" on the family tree) identifier restrictions and thought they were silly. (I think Lisp is also often classified as Haskell's great-grandparent on the family tree? Lisp -> Scheme -> ML -> Haskell, I think?) As with most of that FP family the boundary between "operator" and "identifier" is real thin to nonexistent.
Aside: I've got half a feeling you could implement an APL-like directly in Haskell as a DSL using Unicode-named functions. I've seen Unicode Haskell files that look like APL (and GHC supports a surprising amount of that almost out of the box, as I recall).