-- data Bool = True | False deriving Show und True True = True und True False = False und False True = False und False False = False data Day = Sun | Mon | Tue | Wed | Thu | Fri | Sat deriving Show data PColor = Red | Blue | Yellow deriving Show mkColor Red = Mix 255 0 0 mkColor Blue = Mix 0 255 0 mkColor Yellow = Mix 0 0 255 data Color = Mix Int Int Int deriving Show blend (Mix a b c) (Mix x y z) = Mix (a+x `div` 2) (b+y `div` 2) (c+z `div` 2) black = Mix 0 0 0 white = Mix 255 255 255 f :: Maybe Int -> Int f Nothing = 0 f (Just x) = x+3 g (Left str) = length str g (Right i) = i `div` 2 data Nat = Zero | Succ Nat deriving Show plus Zero m = m plus (Succ n) m = Succ (plus n m) cti Zero = 0 cti (Succ n) = 1 + cti n cfi 0 = Zero cfi n = Succ (cfi (n-1)) data List a = Nil | Cons a (List a) deriving Show -- data [a] = [] | (:) a [a] len Nil = Zero len (Cons x xs) = Succ (len xs)