Browse files

Use type family

  • Loading branch information...
1 parent ae3ebc7 commit 3aa4ad3e2c9a45ee0aff6f0375bed2d95e5559cc @Shimuuar committed Jul 26, 2010
Showing with 7 additions and 8 deletions.
  1. +7 −8 Types/Number/Nat.hs
15 Types/Number/Nat.hs
@@ -149,14 +149,13 @@ type instance Prev (I (I n)) = O (I n)
-- Join compare results. a is result of comparison of low digits b is
-- result of comparion of higher digits.
-class JoinCompare a b where
- type Join a b :: *
-instance JoinCompare IsLesser IsEqual where type Join IsLesser IsEqual = IsLesser
-instance JoinCompare IsEqual IsEqual where type Join IsEqual IsEqual = IsEqual
-instance JoinCompare IsGreater IsEqual where type Join IsGreater IsEqual = IsGreater
-instance JoinCompare a IsLesser where type Join a IsLesser = IsLesser
-instance JoinCompare a IsGreater where type Join a IsGreater = IsGreater
+type family Join a b :: *
+type instance Join IsLesser IsEqual = IsLesser
+type instance Join IsEqual IsEqual = IsEqual
+type instance Join IsGreater IsEqual = IsGreater
+type instance Join a IsLesser = IsLesser
+type instance Join a IsGreater = IsGreater
-- Instances for comparison
instance CompareN Z Z where type Compare Z Z = IsEqual

0 comments on commit 3aa4ad3

Please sign in to comment.