|
@@ -205,6 +205,8 @@ class (Eq a, KnownNat (Cardinality a)) => Finitary (a :: Type) where
|
|
|
|
|
|
type Cardinality a = GCardinality (Rep a)
|
|
|
|
|
|
+ {-# MINIMAL fromFinite, toFinite #-}
|
|
|
+
|
|
|
-- | Converts an index into its corresponding inhabitant.
|
|
|
fromFinite :: Finite (Cardinality a) -> a
|
|
|
default fromFinite :: (Generic a, GFinitary (Rep a), Cardinality a ~ GCardinality (Rep a)) => Finite (Cardinality a) -> a
|