
24 Apr
2009
24 Apr
'09
9:10 a.m.
Neil Mitchell wrote:
Hi,
I totally disagree. unsafe/unchecked means nothing other than "beware of the bogey monster", or for most Haskell users, "just another function that might launch missiles". fromAscList has the specific precondition for this function in the name. Should we call unsafeHead? uncheckedHead? mightCrashIfNotConsHead?
Do I really need to point out the difference between head and fromAscList? fromAscList is total but may badly destroy the internal (invariant of the) representation. head at least crashes (hopefully fairly soon) when called wrongly. C.