[Haskell-cafe] A different Maybe maybe

Neil Mitchell ndmitchell at gmail.com
Wed Mar 7 18:00:27 EST 2007


Hi

> For a while I have been thinking: Isn't there a way to get rid of the
> intermediate Maybe construct in a common expression like "fromMaybe
> default . lookup". It seems that a way to do that would be to pass more
> information to the Maybe-generating function: What to do with a
> Just-Value, and what to return in case of Nothing. This leads to a new
> definion of the Maybe data type as a function. Later I discovered that
> this seems to work for any algebraic data type.

http://www.cs.nott.ac.uk/~nhn/TFP2006/Papers/03-JansenKoopmanPlasmeijer-EfficientInterpretation.pdf

Is that the kind of concept you mean?

I found this paper quite accessible, so it might be of interest to you.

Thanks

Neil


More information about the Haskell-Cafe mailing list