Created
August 24, 2017 11:34
-
-
Save mssawant/e5b7e589ec13df6244a9b45fcfa55a40 to your computer and use it in GitHub Desktop.
Halon exercise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Environment | |
import Data.Bool | |
import Data.List | |
checkchar :: IO Bool | |
checkchar = do c <- getChar | |
return (c == 'y') | |
addList :: Int -> [Int] -> [Int] | |
addList y (x:xs) = y:xs | |
main::IO () | |
main = do putStrLn "Enter char" | |
x <- checkchar | |
if x | |
then putStrLn "TRUE" | |
else putStrLn "FALSE" | |
let l = [1,2] | |
print $ l | |
let m = addList 3 l | |
print $ m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment