@@ -88,7 +88,7 @@ module LAoP.Utils.Internal
88 coerceNat3,
88 coerceNat3,
90 -- * Powerset data type
90 -- * Powerset data type
91− Powerset (..)
91+ List (..)
@@ -207,7 +207,7 @@ instance
208-- This data type is a newtype wrapper around '[]'. This exists in order to
208-- This data type is a newtype wrapper around '[]'. This exists in order to
209-- implement an 'Enum' and 'Bounded' instance that cannot be harmful for the outside.
209-- implement an 'Enum' and 'Bounded' instance that cannot be harmful for the outside.
210−newtype Powerset a = PS [a]
210+newtype List a = L [a]
211 deriving (Eq, Show, Read)
211 deriving (Eq, Show, Read)
213powerset :: [a] -> [[a]]
213powerset :: [a] -> [[a]]
@@ -217,22 +217,22 @@ powerset (x:xs) = powerset xs ++ [x:ps | ps <- powerset xs]
218 ( Enum a,
218 ( Enum a,
219 Bounded a
219 Bounded a
220− ) => Bounded (Powerset a)
220+ ) => Bounded (List a)
222− minBound = PS []
222+ minBound = L []
223− maxBound = PS [minBound .. maxBound]
223+ maxBound = L [minBound .. maxBound]
226 ( Bounded a,
226 ( Bounded a,
229− ) => Enum (Powerset a)
229+ ) => Enum (List a)
231 toEnum i =
231 toEnum i =
232 let as = [minBound .. maxBound]
232 let as = [minBound .. maxBound]
233− in PS (powerset as !! i)
233+ in L (powerset as !! i)
235− fromEnum (PS []) = 0
235+ fromEnum (L []) = 0
236− fromEnum (PS x) =
236+ fromEnum (L x) =
237 let as = [minBound .. maxBound]
237 let as = [minBound .. maxBound]
238 in fromMaybe (error "Does not exist") $ elemIndex x (powerset as)
238 in fromMaybe (error "Does not exist") $ elemIndex x (powerset as)