Proposal: Add (&) to Data.Function

Dan Burton at
Tue Nov 20 20:45:04 CET 2012

Is it safe to say that most of us are agreeing that *something* like this
should be included in the Prelude? Does anyone feel strongly that this
should *not* be in the Prelude?

If such is the case, then it seems we have three popular options for the
color of this shed:

& as seen currently in lens
|> as seen in ML
# as seen in diagrams

I find these to all be acceptable options, and would be happy to see any of
them defined in the Prelude as x `op` f = f x. My 2c: I lean towards |>
because it is already used in ML, and because I believe it is the most
foreign to newcomers, and therefore the most likely to *not* be
misinterpreted. On a huge tangent, suppose we used Lisk, which supports
"chaining" the same operator as if it were a var-arg function. (|> 5 isZero
not) is very close to the equivalent Clojure (-> 5 zero? not). Presumably
-> as a Haskell operator name is out of the question.

-- Dan Burton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list