Re: [Haskell-beginners] can I use "pure" all the time instead of "return" now?

why not use (%%) as alias for both pure and return? % - as in "investment return" % - as in "pure distilled .. " :-P

(%%) is a binary function.
return and pure are both unary.
I'm don't see how the infix (%%) is solving anything here.
On May 15, 2016 6:32 PM, "Imants Cekusins"
why not use (%%) as alias for both pure and return?
% - as in "investment return" % - as in "pure distilled .. "
:-P
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

Correct, you're stuck always writing it with the parenthese because without
them; you get an infix function which is binary, not unary.
I still don't see what your solution brings new to the table in relevance
to the question. It's just trading a poorly named function for arguably an
even worse.
On May 16, 2016 10:20 AM, "Imants Cekusins"
Alex
here is what I tried:
(%%):: Applicative f => a -> f a (%%) = pure
test::Int -> IO Int test i0 = (%%) $ i0 + (2::Int)
seems to work..
I can't get %% to work without ()
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

Of course, it doesn't solve anything, but.. {-# LANGUAGE PostfixOperators #-} import Control.Applicative (%%) :: Applicative f => a -> f a (%%) = pure go :: IO Int go = (12 %%) main = do num <- (12 %%) print num
participants (3)
-
Alex Belanger
-
Anton Felix Lorenzen
-
Imants Cekusins