File tree 5 files changed +29
-4
lines changed
5 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,18 @@ class GEq a where
31
31
default geq :: (Generic a , GEq' (Rep a )) => a -> a -> Bool
32
32
geq x y = geq' (from x) (from y)
33
33
34
- instance GEq Char where geq = (==)
35
- instance GEq Int where geq = (==)
36
- instance GEq Float where geq = (==)
34
+ -- Base equalities
35
+ instance GEq Char where geq = (==)
36
+ instance GEq Int where geq = (==)
37
+ instance GEq Float where geq = (==)
38
+
39
+ -- Equalities derived from structure of (:+:) and (:*:)
40
+ instance GEq a => GEq (Maybe a )
41
+ instance (GEq a , GEq b ) => GEq (a ,b )
42
+
43
+ main :: IO ()
44
+ main = do
45
+ print $ geq 2 (3 :: Int )
46
+ print $ geq ' a' ' b'
47
+ print $ geq (Just ' a' ) (Just ' a' )
48
+ print $ geq (' a' ,' b' ) (' a' , ' b' )
Original file line number Diff line number Diff line change
1
+ Assign
2
+ ------
3
+
4
+ ``` bash
5
+ $ stack exec assign input.test
6
+ ```
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ cabal-version: >=1.10
6
6
7
7
executable assign
8
8
build-depends :
9
- base >= 4.6 && < 4.7
9
+ base >= 4.6 && < 4.9
10
10
, containers >= 0.5 && < 0.6
11
11
, mtl >= 2.2
12
12
default-language : Haskell2010
Original file line number Diff line number Diff line change
1
+ resolver : lts-3.16
2
+ packages :
3
+ - ' .'
4
+ extra-deps : []
5
+ flags : {}
6
+ extra-package-dbs : []
Original file line number Diff line number Diff line change
1
+ (\x -> x)
You can’t perform that action at this time.
0 commit comments