Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/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. LYAH example (sasa bogicevic)
----------------------------------------------------------------------
Message: 1
Date: Wed, 22 Mar 2017 12:44:23 +0100
From: sasa bogicevic <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] LYAH example
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Hi All,
Can someone clarify the example I got from LYAH book. This let statement is
kinda confusing to me :
applyLog :: (a, String) -> (a -> (b, String)) -> (b, String)
applyLog (x, log) f = let (y, newLog) = f x in (y, log ++ newLog)
I know that f applied to x should produce y and we append log with newLog but
when reading ... f x in (y, ... I just don't see how f x becomes y in the let
statement.
Seems more readable if we could write ... = (f x, log ++ newLog)
Thanks, Sasa
{
name: Bogicevic Sasa
phone: +381606006200
}
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 105, Issue 8
*****************************************