
26 May
2007
26 May
'07
2:07 a.m.
droundy:
Both reasons.
I know the existing code is safe, but in my opinion pattern match warnings usually (often?) show that there's a better way to do things. In this case, having a type for non-empty stacks seems like a good thing, so you can then write functions that expicitely rely on this property, the type checker (rather than Catch) will ensure that they are never used unsafely. Plus, I like the Maybe monad and the pretty things you can do with it. Stack+modify looks basically like a poor reimplementation of parts of the Maybe module.
I agree with these points. Just working out whether to tackle this before or after 0.2. I'm inclined to do it after the tag,rather than risk introducing errors. -- Don