
22 Mar
2017
22 Mar
'17
7:44 a.m.
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 }