Skip to content
Browse files

Renamed and to (&&)

Moved Eq to Generic.Data.Eq module
  • Loading branch information...
1 parent dce5def commit 659f2652ea77a4091114d03b1dc4607ee385d53b @tomlokhorst committed Jan 21, 2010
Showing with 25 additions and 12 deletions.
  1. +1 −0 AwesomePrelude.cabal
  2. +10 −11 src/Generic/Data/Bool.hs
  3. +11 −0 src/Generic/Data/Eq.hs
  4. +2 −1 src/Generic/Data/List.hs
  5. +1 −0 src/Lang/JavaScript.hs
View
1 AwesomePrelude.cabal
@@ -31,6 +31,7 @@ library
Generic.Control.Pointed
Generic.Data.Bool
Generic.Data.Either
+ Generic.Data.Eq
Generic.Data.List
Generic.Data.Maybe
Generic.Data.Number
View
21 src/Generic/Data/Bool.hs
@@ -1,25 +1,24 @@
-{-# LANGUAGE EmptyDataDecls, MultiParamTypeClasses #-}
+{-# LANGUAGE EmptyDataDecls #-}
module Generic.Data.Bool where
import Prelude ()
data Bool
class BoolC j where
- true :: j Bool
false :: j Bool
+ true :: j Bool
bool :: j a -> j a -> j Bool -> j a
-not :: BoolC j => j Bool -> j Bool
-not = bool false true
+if' :: BoolC j => j Bool -> j a -> j a -> j a
+if' b x y = bool y x b
-and :: BoolC j => j Bool -> j Bool -> j Bool
-and a b = bool b false a
+(&&) :: BoolC j => j Bool -> j Bool -> j Bool
+x && y = bool false y x
-or :: BoolC j => j Bool -> j Bool -> j Bool
-or a b = bool true b a
+(||) :: BoolC j => j Bool -> j Bool -> j Bool
+x || y = bool y true x
-class Eq j a where
- (==) :: j a -> j a -> j Bool
- (/=) :: j a -> j a -> j Bool
+not :: BoolC j => j Bool -> j Bool
+not = bool true false
View
11 src/Generic/Data/Eq.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+module Generic.Data.Eq where
+
+import Prelude ()
+import Generic.Data.Bool
+
+class Eq j a where
+ (==) :: j a -> j a -> j Bool
+ (/=) :: j a -> j a -> j Bool
+
View
3 src/Generic/Data/List.hs
@@ -3,8 +3,9 @@
module Generic.Data.List where
import Prelude ()
-import Generic.Data.Number
import Generic.Data.Bool
+import Generic.Data.Eq
+import Generic.Data.Number
import Generic.Control.Function
import Generic.Control.Functor
View
1 src/Lang/JavaScript.hs
@@ -5,6 +5,7 @@ module Lang.JavaScript where
import Generic.Control.Function
import Generic.Data.Bool
import Generic.Data.Either
+import Generic.Data.Eq
import Generic.Data.List hiding ((++))
import Generic.Data.Maybe
import Generic.Data.Number

0 comments on commit 659f265

Please sign in to comment.
Something went wrong with that request. Please try again.