Talk:Haskell/Solutions/Simple input and output

I don't get it - what does $ mean? Does it mean print everything after $ ? I.e. the same effect as putting brackets around it all..?

--90.198.153.194 13:24, 21 October 2007 (UTC)


 * Ooops! You're actually not supposed to be introduced to   here.  It's just a special function which helps us avoid writing parentheses all the time.  Anything to the right of a   can be treated as being within a set of parentheses.  So instead of writing , you might instead write  .  Implementing this is just a matter of function application .  The trick that makes it work is another bit of code,   which makes it right associative and gives it a very low precedence.  -- Kowey 00:10, 22 October 2007 (UTC)

I found the example confusing--clearly I'm missing something about the new do block as I'm confused why I cannot do variable assignment like  or why   is valid but   is not. --Virgilsamms (discuss • contribs) 07:08, 25 December 2016 (UTC)


 * On the first question: you can bind the result to a name such as . To do that within the do block, you need a , as mentioned later in the chapter:




 * On the second question:  doesn't work because   isn't a   but rather an, that is, an action which produces a  . A line such as  executes the   action and binds the   produced by it to  ; you can then pass  , which is a  , to.


 * Cheers, Duplode (discuss • contribs) 16:56, 25 December 2016 (UTC)


 * Thanks for your clear explanation! And yes, the rest of the chapter explained this clearly--I'm going to add a sentence about  to the note box in case anyone else gets stuck here. --Virgilsamms (discuss • contribs) 17:44, 25 December 2016 (UTC)