Haskell is lazy evaluation!
Prelude> :show bindings Prelude> let x = 2010 Prelude> :show bindings x :: Integer = _ Prelude> x 2010 Prelude> :show bindings it :: Integer = 2010 x :: Integer = 2010 Prelude>
Exercises Answers:
3: The words function counts the number of words in a string. Modify the WC.hs example to count the number of words in a file.
main = interact wordCount where wordCount input = show (length (words input)) ++ "\n"
4: Modify the WC.hs example again, to print the number of characters in a file.
main = interact wordCount where wordCount input = show (length input) ++ "\n"
Useful command
:set +t
:unset +t
:m Data.Radio
it