mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-27 07:33:57 +00:00
Update haskell.html.markdown
This commit is contained in:
parent
6696105169
commit
3f75e76691
@ -302,6 +302,19 @@ Just 1
|
||||
-- While IO can't be explained fully without explaining monads,
|
||||
-- it is not hard to explain enough to get going.
|
||||
|
||||
-- When a Haskell program is executed, the function `main` is
|
||||
-- called. It must return a value of type `IO ()`. For example:
|
||||
|
||||
main :: IO ()
|
||||
main = putStrLn "Hello, sky! " ++ (say Blue)
|
||||
|
||||
-- You can think of a value of type `IO ()` as representing a
|
||||
-- sequence of actions for the computer to do, much like a
|
||||
-- computer program written in an imperative language. The *only*
|
||||
-- way you *execute* such a program is to make it the value of `main`.
|
||||
|
||||
|
||||
|
||||
-- An `IO a` value is an IO action: you can chain them with do blocks
|
||||
action :: IO String
|
||||
action = do
|
||||
|
Loading…
Reference in New Issue
Block a user