fork download
  1. infixl 6 :?
  2. infixl 7 :+
  3. infixl 7 :-
  4.  
  5. {-
  6. Laws:
  7. 1. zero :? _ = False
  8. 2. flag f :? f = True
  9. 3. fs :+ f :? f = True
  10. 4. fs :- f :? f = False
  11. 5. fs :+ f :- f = fs
  12. -}
  13. class Enum a => Flags c where
  14. zero :: c a
  15. flag :: a -> c a
  16. (:?) :: c a -> a -> Bool
  17. (:+) :: c a -> a -> c a
  18. (:-) :: c a -> a -> c a
  19.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty