Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Lifting infix functions in applicative style (Bastian Erdn??)
2. IO loops with tail call (Yasuyuki Ogawa)
----------------------------------------------------------------------
Message: 1
Date: Sat, 6 Nov 2010 13:55:14 +0100
From: Bastian Erdn?? <[email protected]>
Subject: Re: [Haskell-beginners] Lifting infix functions in
applicative style
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1
On Nov 6, 2010, at 11:22, Brent Yorgey wrote:
> On Sat, Nov 06, 2010 at 01:33:39AM +0100, Bastian Erdnüß wrote:
>> When I want to lift an infix function into an applicative functor I use
>> 'liftA2' -- I just call it 'up' for the sake of brevity. But I always have
>> to add some parenthesis since I don't know how to tell Haskel that `up op`
>> shall have the same fixity as `op` has. Is there a way to do that?
>
> No, there isn't. Also, `up op` is not valid syntax -- only names may
> go in between `backticks`, not expressions in general.
Really not? Ouh, probably I should try to test compile my source a little bit
more often.
> You may be interested in the InfixApplicative package:
>
> http://hackage.haskell.org/package/InfixApplicative
>
> although it still doesn't solve the problem of fixity.
I am, thanks. At least it solves my problem the way I thought I would have
solved it already ;-)
> -Brent
Thanks for your respond.
Bastian
------------------------------
Message: 2
Date: Sun, 07 Nov 2010 01:54:26 +0900
From: Yasuyuki Ogawa <[email protected]>
Subject: [Haskell-beginners] IO loops with tail call
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-2022-JP
Hello!
I wrote a simple echo program which end up with input "q":
echo = do
str <- getLine
if (str == "q")
then return ()
else putStrLn str >> echo
then I thought it is not tail call because if expressions
return a value. (is it right?) So I changed a code:
echo "q" = return ()
echo xs = do
putStrLn xs
xs' <- getLine
echo xs'
but Monad connections are too complicated so that
I'm not sure it is tail call. Am I wrong?
Thank you!
--------------------------------------
Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/ie8/
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 29, Issue 8
****************************************