Send Beginners mailing list submissions to beginners@haskell.org 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 beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org 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 <brutalles...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: [Haskell-beginners] LYAH example Message-ID: <34cd86b8-a4db-4776-8d88-05ff9f1c3...@gmail.com> 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 Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 105, Issue 8 *****************************************