29 ms·
The only thing that elevates lists above other data structures in Haskell syntax-wise is the "" and [] sugar for constructing them. Haskell's type system allows
by FreeFull 14y ago
The only thing that elevates lists above other data structures in Haskell syntax-wise is the "" and [] sugar for constructing them.
Haskell's type system allows you very easily to construct your own data types. For example, an unbalanced binary tree would be defined as
data Tree a = Leaf a | Branch a (Tree a) (Tree a) deriving (Eq, Show)
I admit that the easiest way to construct a hashmap, using fromList [(key,value),(otherkey,othervalue)], isn't as pretty as Clojure's syntax.