about summary refs log tree commit diff
path: root/third_party/bazel/rules_haskell/tutorial/lib/Bool.hs
blob: 7390fcc0b838979ec54bb1801c80c71958926ee8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- base is not available when no dependencies, so we have to define everything
-- from scratch.
{-# LANGUAGE NoImplicitPrelude #-}

module Bool where

data Bool = False | True

not :: Bool -> Bool
not False = True
not True = False

and :: Bool -> Bool -> Bool
and True True = True
and _ _ = False

or :: Bool -> Bool -> Bool
or False False = False
or _ _ = True