3 ms·
You'll flip your id ($) = id Except that id works on values and functions, but $ only works on functions. (&) = flip id $ is just an less-expressive alias fo
by Evbn 14y ago
You'll flip your id
($) = id
Except that id works on values and functions, but $ only works on functions.
(&) = flip id
$ is just an less-expressive alias for id that looks prettier (and has different precedence/associativity when used infix)
- tel 14y agoNo, not strictly true! ($) has a compiler hack to let it handle impredicativity. import Control.Monad.ST infix 0 % (%) = id runST $ return () -- :: () runST % return () -- Type error! Couldn't match expected type `forall s. ST s a0' with actual type `m0 a1' In the return type of a call of `return' In the second argument of `id', namely `(return ())' In the expression: runST `id` (return ())