Untitled

Run Settings
LanguageHaskell
Language Version
Run Command
module Main where main :: IO () main = print $ elements s where s :: Set (Maybe Bool, Bool) s = universal × universal type Set a = a -> Bool (∪) :: Set a -> Set a -> Set a (∪) s t a = s a || t a (∩) :: Set a -> Set a -> Set a (∩) s t a = s a && t a (∖) :: Set a -> Set a -> Set a (∖) s t a = s a && not (t a) (×) :: Set a -> Set b -> Set (a, b) (×) s t (x, y) = s x && t y universal :: Set a universal = const True elements :: Finite a => Set a -> [a] elements s = filter s enumerate class Finite a where enumerate :: [a] instance Finite Bool where enumerate = [False, True] instance Finite a => Finite (Maybe a) where enumerate = Nothing : map Just enumerate instance (Finite a, Finite b) => Finite (a, b) where enumerate = [(x, y) | x <- enumerate, y <- enumerate]
Editor Settings
Theme
Key bindings
Full width
Lines