initial checkin from subversion
This commit is contained in:
5
examineWhereTheIssueIs.hs
Normal file
5
examineWhereTheIssueIs.hs
Normal file
@@ -0,0 +1,5 @@
|
||||
ifa = do
|
||||
putStr "Name: "
|
||||
name <- getLine
|
||||
if (name == "Koen")
|
||||
then putStrLn "I think Debugging haskell is simple"
|
||||
7
exs.hs
Normal file
7
exs.hs
Normal file
@@ -0,0 +1,7 @@
|
||||
ifa = do
|
||||
putStr "Name: "
|
||||
name <- getLine
|
||||
if name == "Koen"
|
||||
then putStrLn "I know you"
|
||||
else return ()
|
||||
|
||||
4
io1.hs
Normal file
4
io1.hs
Normal file
@@ -0,0 +1,4 @@
|
||||
main = do
|
||||
putStrLn "Please enter your name: "
|
||||
name <- getLine
|
||||
putStrLn ("Hello, " ++ name ++ ", how are you?")
|
||||
12
numGuess1.hs
Normal file
12
numGuess1.hs
Normal file
@@ -0,0 +1,12 @@
|
||||
doGuessing num = do
|
||||
putStrLn "Enter your guess:"
|
||||
guess <- getLine
|
||||
if (read guess) < num
|
||||
then do putStrLn "Too low!"
|
||||
doGuessing num
|
||||
else if (read guess) > num
|
||||
then do putStrLn "Too high!"
|
||||
doGuessing num
|
||||
else do putStrLn "You Win!"
|
||||
|
||||
|
||||
2
recurs1.hs
Normal file
2
recurs1.hs
Normal file
@@ -0,0 +1,2 @@
|
||||
factorial 0 = 1
|
||||
factorial n = n * factorial (n-1)
|
||||
11
rettest1.hs
Normal file
11
rettest1.hs
Normal file
@@ -0,0 +1,11 @@
|
||||
main =
|
||||
do x <- getX
|
||||
putStrLn x
|
||||
|
||||
getX =
|
||||
do return "hello"
|
||||
return "aren't"
|
||||
return "these"
|
||||
return "returns"
|
||||
return "rather"
|
||||
return "pointless?"
|
||||
18
stringManip.hs
Normal file
18
stringManip.hs
Normal file
@@ -0,0 +1,18 @@
|
||||
module StringManip where
|
||||
|
||||
import Data.Char
|
||||
|
||||
uppercase, lowercase :: String -> String
|
||||
uppercase = map toUpper
|
||||
lowercase = map toLower
|
||||
|
||||
capitalise :: String -> String
|
||||
capitalise x =
|
||||
let capWord (x:xs) = toUpper x : xs
|
||||
in unwords (map capWord (words x))
|
||||
|
||||
yy :: String -> String
|
||||
yy a =
|
||||
let capWord (a:b) = toUpper a : b
|
||||
in a
|
||||
|
||||
Reference in New Issue
Block a user