
I found that as I can do xs.map(+1).sort by redefine . to be a . f = f a infixl 9 . I can also do readFile "readme.markdown" <.> lines <.> length by making a <.> b = a .liftM b infixl 9 <.> Kinda annoying, but the option is there. - jinjing

sorry about the confusion, too much drinks.
I used the redefined . in the difination of <.>. it should really just be
flip liftM
On Wed, Sep 10, 2008 at 9:14 PM, jinjing
I found that as I can do
xs.map(+1).sort
by redefine . to be
a . f = f a infixl 9 .
I can also do
readFile "readme.markdown" <.> lines <.> length
by making
a <.> b = a .liftM b infixl 9 <.>
Kinda annoying, but the option is there.
- jinjing

jinjing wrote:
I found that as I can do
xs.map(+1).sort
by redefine . to be
a . f = f a infixl 9 .
This looks rather like ($), but backwards. I believe the F# name for this operator is (|>), which is also a legal name for it in Haskell. Odd, since (|) alone isn't legal. Calling it (.) will confuse the heck out of anyone who maintains your code though, and make any transfer of code between your projects and other people's liable to introduce bugs.
I can also do
readFile "readme.markdown" <.> lines <.> length
by making
a <.> b = a .liftM b infixl 9 <.>
Kinda annoying, but the option is there.
Now that looks more interesting. Another name for it is (>>=^), since it is like (>>=) but lifts its right argument. I know the Fudgets library uses "^" in operators for a similar "lifting" meaning. -- src/
participants (3)
-
jinjing
-
Ketil Malde
-
Simon Richard Clarkstone