Jason Dagit wrote:
removeMaybeHash x =
case x of
Just ref -> ref
Nothing -> HashTable.new (==) (\key -> key)
When you see yourself writing a function like this, you could write it
like this instead:
removeMaybeHash (Just ref) = ref
removeMaybeHash Nothing = HashTable.new (==) (\key -> key)
Hopefully you agree this 2 line version is more clear.
Actually, I prefer the other one... (though not necessarily spread out
over 4 lines)
I think this is more a matter of taste rather than clarity.
Martijn.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe