[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Continuing in the role as syntax czar:
From: fplangc-request@cs.ucl.ac.uk
Date: 11 Sep 91 17:25
Sender: "David S. Wise" <dswise@seafox.cs.indiana.edu>
To: boutel-brian@cs.yale.edu, hudak-paul@cs.yale.edu
Cc: fplangc@cs.ucl.ac.uk
Subject: Re: Continuing in the role as syntax czar:
Re: n+k, -x etc
I suggested this to Brian privately, but it seems appropriate to lay
it before the syntax czar. (Gee, czars may be coming back into style!)
This is SYNTAX!
Create a syntactic object that I'll call an "oct" which has
*only* eight alternatives (because eight is more reasonable than seven):
1 2 3 4 5 6 7 8.
Then allow the +k patterns to be syntactically +<oct>.
Have only one "zip" that must be syntactically followed by an oct.
Similarly with "map"; Thus, "map 4" is SYNTACTICALLY "zipWith4",
(but the latter word has always been *horrible*).
Standing alone, then, "map" has no semantic interpretation.
(Hence, think of +1 +2 +3 +4 +5 +6 +7 +8 in patterns
zip1 zip2 zip3 zip4 zip5 zip6 zip7 zip8
map1 map2 map3 map4 map5 map6 map7 map8
each as its own lexeme.)
This does have the effect of moving zip and map into the core
language---in order to obtain this syntax.
But one of the weaknesses of Haskell has always been that such functionals
were treated as "less" important. (Sigh. You heard this from me early on.)
....Then we also could apply them to functions on homogeneous tuples:
e.g. map 1 (1+) (0, 1, 2, 3) would be (1, 2, 3, 4)