[Haskell-cafe] a way to convert partial functions to functions with Maybe's

Ozgur Akgun ozgurakgun at gmail.com
Wed Apr 14 04:50:49 EDT 2010


Oh well, thanks for all the response.

I have a module with lots of one line function definitons, and they just
*look* ugly when I wrap the return type with Maybe. This is a
straightforward, and trivial job (the conversion) and I really don't care
about other problems (such as non-termination plus some other conditions)
for the time being.

I am not attampting to remove Maybe completely, don't worry :)
I quite like it, and use it in most places. But now always apparently.

Best,

On 14 April 2010 08:50, Roel van Dijk <vandijk.roel at gmail.com> wrote:

> On Wed, Apr 14, 2010 at 2:32 AM, Ivan Miljenovic
> <ivan.miljenovic at gmail.com> wrote:
> > Why not use Maybe for func1 in the first place?  Or are you wanting to
> > automagically make all uses of head, tail, etc. safe?
>
> In which case there is already the 'safe' package:
> http://hackage.haskell.org/package/safe
>



-- 
Ozgur Akgun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100414/2c20674f/attachment.html


More information about the Haskell-Cafe mailing list