1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-01-18 05:59:14 +01:00

Merge pull request #103 from ilyagr/patch-1

Update haskell.html.markdown
This commit is contained in:
Adam Bard 2013-07-03 23:17:15 -07:00
commit 7aa3f02a37

View File

@ -292,9 +292,9 @@ say Green = "You are Green!"
data Maybe a = Nothing | Just a data Maybe a = Nothing | Just a
-- These are all of type Maybe -- These are all of type Maybe
Nothing Just "hello" -- of type `Maybe String`
Just "hello" Just 1 -- of type `Maybe Int`
Just 1 Nothing -- of type `Maybe a` for any `a`
---------------------------------------------------- ----------------------------------------------------
-- 8. Haskell IO -- 8. Haskell IO
@ -344,8 +344,8 @@ sayHello = do
-- Let's understand better how the function `getLine` we just -- Let's understand better how the function `getLine` we just
-- used works. Its type is: -- used works. Its type is:
-- getLine :: IO String -- getLine :: IO String
-- You can think of a value of type `IO String` as representing a -- You can think of a value of type `IO a` as representing a
-- computer program that will generate a value of type `String` -- computer program that will generate a value of type `a`
-- when executed (in addition to anything else it does). We can -- when executed (in addition to anything else it does). We can
-- store and reuse this value using `<-`. We can also -- store and reuse this value using `<-`. We can also
-- make our own action of type `IO String`: -- make our own action of type `IO String`: