#4189: Add (<.>) operator (generalizing (.) to Functor)
Maciej Marcin Piechotka
uzytkownik2 at gmail.com
Mon Aug 2 04:10:56 EDT 2010
On 01/08/10 22:15, Stephen Tetley wrote:
> On 1 August 2010 20:57, Maciej Marcin Piechotka <uzytkownik2 at gmail.com> wrote:
>
>> Hmm. Do you have an idea for better name?
>
>
> blackbirdA ?
>
> For the function instance of Applicative its the blackbird combinator,
> unless I made a miscalculation when rewriting the signature.
Hmm. Looks like that but:
- blackbirdA does not save much space
- f `blackbirdA` g is *more* confusing then (f <$>) . g/ fmap f . g:
const 1 <.> print <=< (read :: String -> Int) <.> readFile
fmap (const 1) . print <=< fmap (read :: String -> Int) . readFile
(const 1 <$>) . print <=< ((read :: String -> Int) <$>) . readFile
const 1 `blackbirdA` print <=< (read :: String -> Int) `blackbirdA`
readFile
First shows the nearly-normal Haskell function pipeline. It's nearly:
const 1 . print . read . readFile
from non-pure languages (with added pureness)
The last one is IMHO unreadable. It is much longer and does not
'graphically' represent flow of information.
- blackbird is rather not widely known reference.
Regards
PS. I know, I know...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/libraries/attachments/20100802/95a2552b/signature.bin
More information about the Libraries
mailing list