Created
May 8, 2012 16:31
-
-
Save t0yv0/2637012 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.List | |
data Rolj = Oficiant | |
| Povar | |
| Somelje | |
deriving (Eq, Show) | |
data Reshenije = | |
Reshenije { aristid :: Rolj | |
, evasio :: Rolj | |
, rodolpho :: Rolj | |
} deriving Show | |
roli = [Oficiant, Povar, Somelje] | |
prostranstvo = | |
[Reshenije a b c | [a, b, c] <- permutations roli] | |
infixl 5 ==> | |
infixl 6 =? | |
infixl 6 /=? | |
infixl 4 &&& | |
g ==> h = \x -> if g x then h x else True | |
a =? b = \x -> a x == b | |
a /=? b = \x -> a x /= b | |
a &&& b = \x -> a x && b x | |
ok = | |
aristid =? Povar ==> evasio =? Oficiant | |
&&& aristid =? Oficiant ==> evasio =? Somelje | |
&&& evasio /=? Povar ==> rodolpho =? Oficiant | |
&&& rodolpho =? Somelje ==> aristid =? Oficiant | |
reshenija = filter ok prostranstvo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment