From 3e886a6c0caddbf008f3d4bd1aafcab62fb6331f Mon Sep 17 00:00:00 2001 From: Aleksey Zubakov Date: Tue, 22 Nov 2022 16:26:49 +0300 Subject: [PATCH] Update seventh seminar --- 07/Main.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/07/Main.hs b/07/Main.hs index a968eef..870bf13 100644 --- a/07/Main.hs +++ b/07/Main.hs @@ -1,8 +1,6 @@ data A = True' | False' deriving Show -data B = True' - foo :: A -> Integer foo True' = 1 foo False' = 0 @@ -16,4 +14,12 @@ bar :: BigP -> Integer bar (P1 _ _) = 1 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"