@Jake
In my opinion, this is not as nice as the do-notation version, but at
least it's compositional:
It would be rather awful to expand each of your Kleisli arrows with
"const" as you said.
On Mon, Oct 15, 2012 at 11:33 AM, Jake McArthur <jake.mcarthur@gmail.com> wrote:My previous answer didn't do the Kleisli style much justice. It could
> On Mon, Oct 15, 2012 at 7:59 AM, Ertugrul Söylemez <es@ertes.de> wrote:
>> Try to express
>>
>> do x <- getLine
>> y <- getLine
>> print (x, y)
>>
>> using only Kleisli composition (without cheating).
look a bit nicer with more Arrow-style combinators:
f &=& g = runKleisli $ Kleisli f &&& Kleisli g
print <=< const getLine &=& const getLine $ ()
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe