Update seventh seminar

main
Aleksey Zubakov 2 years ago
parent eb10ba2ea8
commit 3e886a6c0c
  1. 10
      07/Main.hs

@ -1,8 +1,6 @@
data A = True' | False' data A = True' | False'
deriving Show deriving Show
data B = True'
foo :: A -> Integer foo :: A -> Integer
foo True' = 1 foo True' = 1
foo False' = 0 foo False' = 0
@ -16,4 +14,12 @@ bar :: BigP -> Integer
bar (P1 _ _) = 1 bar (P1 _ _) = 1
bar (P2 _) = 2 bar (P2 _) = 2
int_plus_3 :: Integer -> Integer
int_plus_3 n = n + 3
-- examples
comp :: BigP -> Integer
comp = int_plus_3 . bar
main :: IO ()
main = putStrLn "Hello world" main = putStrLn "Hello world"

Loading…
Cancel
Save