Tom Murphy | 14 Aug 04:31 2012
Picon

maybeRead in base

It would be great to have maybeRead in base in time for the next Haskell Platform release. There's been talk about including it several times, but it's remained as a utility function in other libraries (Network.CGI, for example, if I'm remembering right).

Tom

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Simon Hengel | 14 Aug 08:54 2012
Picon

Re: maybeRead in base

On Mon, Aug 13, 2012 at 10:31:19PM -0400, Tom Murphy wrote:
> It would be great to have maybeRead in base in time for the next Haskell
> Platform release. There's been talk about including it several times, but
> it's remained as a utility function in other libraries (Network.CGI, for
> example, if I'm remembering right).

It's in base-4.6.0.0, but it's called readMaybe (personally, I don't
like that name, but I guess it's for consistency with readEither).

Cheers,
Simon
David McGillicuddy | 14 Aug 11:32 2012
Picon

Re: maybeRead in base

What about (.:)*? Just looking at Hayoo quickly, at least half a dozen libraries seem to have defined it and it's a permanent feature on lambdabot.


*(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
 (.:) = (.) (.) (.)

David

On Tue, Aug 14, 2012 at 7:54 AM, Simon Hengel <sol <at> typeful.net> wrote:
On Mon, Aug 13, 2012 at 10:31:19PM -0400, Tom Murphy wrote:
> It would be great to have maybeRead in base in time for the next Haskell
> Platform release. There's been talk about including it several times, but
> it's remained as a utility function in other libraries (Network.CGI, for
> example, if I'm remembering right).

It's in base-4.6.0.0, but it's called readMaybe (personally, I don't
like that name, but I guess it's for consistency with readEither).

Cheers,
Simon

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Edward Kmett | 15 Aug 19:02 2012
Picon

Re: maybeRead in base

I'm not a huge fan of (.:), but you insist on adding it, please generalize it to fmap.fmap.


(.:) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b)

This subsumes the other use case.

-Edward


On Tue, Aug 14, 2012 at 5:32 AM, David McGillicuddy <dmcgill9071 <at> gmail.com> wrote:
What about (.:)*? Just looking at Hayoo quickly, at least half a dozen libraries seem to have defined it and it's a permanent feature on lambdabot.

*(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
 (.:) = (.) (.) (.)

David

On Tue, Aug 14, 2012 at 7:54 AM, Simon Hengel <sol <at> typeful.net> wrote:
On Mon, Aug 13, 2012 at 10:31:19PM -0400, Tom Murphy wrote:
> It would be great to have maybeRead in base in time for the next Haskell
> Platform release. There's been talk about including it several times, but
> it's remained as a utility function in other libraries (Network.CGI, for
> example, if I'm remembering right).

It's in base-4.6.0.0, but it's called readMaybe (personally, I don't
like that name, but I guess it's for consistency with readEither).

Cheers,
Simon

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries


_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries


_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Twan van Laarhoven | 16 Aug 13:16 2012
Picon

Re: maybeRead in base

On 15/08/12 19:02, Edward Kmett wrote:
> I'm not a huge fan of (.:), but you insist on adding it, please generalize it to
> fmap.fmap.
>
> (.:) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b)
>
> This subsumes the other use case.

For the love of Categories, please don't go down this road. fmap is not the 
proper generalization of (.).

Twan
Edward Kmett | 16 Aug 17:14 2012
Picon

Re: maybeRead in base

This is part of why I'm not a fan of (.:) in the first place, but trying to generalize through Category doesn't
offer anything here.

Sent from my iPad

On Aug 16, 2012, at 7:16 AM, Twan van Laarhoven <twanvl <at> gmail.com> wrote:

> On 15/08/12 19:02, Edward Kmett wrote:
>> I'm not a huge fan of (.:), but you insist on adding it, please generalize it to
>> fmap.fmap.
>> 
>> (.:) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b)
>> 
>> This subsumes the other use case.
> 
> For the love of Categories, please don't go down this road. fmap is not the proper generalization of (.).
> 
> 
> Twan
> 
> 
> _______________________________________________
> Libraries mailing list
> Libraries <at> haskell.org
> http://www.haskell.org/mailman/listinfo/libraries

Gmane