From eb10ba2ea8dd31403bf1ec4f32fe294e7a300258 Mon Sep 17 00:00:00 2001 From: Aleksey Zubakov Date: Tue, 22 Nov 2022 16:14:04 +0300 Subject: [PATCH] Seventh seminar for god of haskell --- 07/Main.hs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 07/Main.hs diff --git a/07/Main.hs b/07/Main.hs new file mode 100644 index 0000000..a968eef --- /dev/null +++ b/07/Main.hs @@ -0,0 +1,19 @@ +data A = True' | False' + deriving Show + +data B = True' + +foo :: A -> Integer +foo True' = 1 +foo False' = 0 + +data P3 = P Bool A -- P (Bool x A) + +data BigP = P1 Bool A | P2 Integer + deriving Show + +bar :: BigP -> Integer +bar (P1 _ _) = 1 +bar (P2 _) = 2 + +main = putStrLn "Hello world"