Add code snippets
This commit is contained in:
parent
86969074e3
commit
aa66512620
12
Code.hs
12
Code.hs
@ -39,3 +39,15 @@ calcSomething :: Int -> MaybeInt
|
|||||||
calcSomething x
|
calcSomething x
|
||||||
| x < 100 = NoError (x * 5)
|
| x < 100 = NoError (x * 5)
|
||||||
| otherwise = Error "Int out of range!"
|
| otherwise = Error "Int out of range!"
|
||||||
|
|
||||||
|
|
||||||
|
f' :: Int -> Int
|
||||||
|
f' x = let y p = x + p
|
||||||
|
in x + (y 2)
|
||||||
|
|
||||||
|
addTwo :: [Int] -> [Int]
|
||||||
|
addTwo [] = []
|
||||||
|
addTwo (x:xs) = (x + 2) : addTwo xs
|
||||||
|
|
||||||
|
f'' :: String -> Bool
|
||||||
|
f'' xs = even . length . (\x -> x ++ "Hello world") $ xs
|
||||||
|
Loading…
Reference in New Issue
Block a user