[Haskell-cafe] type checking that I can't figure out ....

Daniel Peebles pumpkingod at gmail.com
Wed Jun 3 21:52:03 EDT 2009


It seems like if we could get fail out of Monad and into something
like MonadFail/Zero, then it might make sense to make a lookup that
returned an instance of that instead?

Dan

On Wed, Jun 3, 2009 at 8:13 PM, Bertram Felgenhauer
<bertram.felgenhauer at googlemail.com> wrote:
> Michael Snoyman wrote:
>> On Wed, Jun 3, 2009 at 8:42 AM, Daniel Fischer <daniel.is.fischer at web.de>wrote:
>> > Am Mittwoch 03 Juni 2009 06:12:46 schrieb Michael Snoyman:
>> > > 2. lookup does not return any generalized Monad, just Maybe (I think that
>> > > should be changed).
>> >
>> > Data.Map.lookup used to return a value in any monad you wanted, I believe
>> > until 6.8
>> > inclusive.
>> > I don't think it's going to change again soon.
>>
>> Is there a reason why it only returns in the Maybe monad? I often times have
>> to write a liftMaybe function to deal with that.
>
> Here's the proposal that changed it:
>  http://hackage.haskell.org/trac/ghc/ticket/2309
>
> The discussion about the proposal can be found here:
>  http://www.haskell.org/pipermail/libraries/2008-May/009698.html
>
> (There's even the suggestion of adding a function like liftMaybe to
> Data.Maybe, but apparently nobody turned that into a formal proposal.)
>
> Regards,
>
> Bertram
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list