4 ms·
The map example with toplevel pattern matching is really just sugar for the expanded case statements which isn't that far from the Ur equivalent. map :: fora
by freyrs3 12y ago
The map example with toplevel pattern matching is really just sugar for the expanded case statements which isn't that far from the Ur equivalent.
map :: forall a b. (a -> b) -> [a] -> [b]
map =
\ (@ a) (@ b) (ds :: a -> b) (ds1 :: [a]) ->
case ds1 of _ {
[] -> [];
: x xs ->
(ds,x,xs) : ((ds,x) ds x) ((ds,xs) map ds xs)
}
- cabalamat 12y ago> The map example with toplevel pattern matching is really just sugar for the expanded case statements which isn't that far from the Ur equivalent And both the Ur and the Haskell are really just sugar for a load of machine code. The reason I prefer the more compact Haskell version is that it allows me to express what I mean more precisely; other things being equal, a more compact notation will be higher-level and thus closer to how humans think.