diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-08 16:15:40 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-08 16:15:40 -0400 |
| commit | 1b84e20fa8715ba8e0881bbd9660de84f8f70feb (patch) | |
| tree | f0ed6c4ce8e478341f055c381e1ab7a4bba93124 /src | |
| parent | 6d52245a574e65275f818d90839737f0074b045f (diff) | |
simplfy
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Types/OS/Typelevel.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Propellor/Types/OS/Typelevel.hs b/src/Propellor/Types/OS/Typelevel.hs index 70d82e43..2b17d87b 100644 --- a/src/Propellor/Types/OS/Typelevel.hs +++ b/src/Propellor/Types/OS/Typelevel.hs @@ -63,19 +63,19 @@ type instance ConcatOSList (a ': rest) list2 = a ': ConcatOSList rest list2 -- | The intersection between two lists of supported OS's. intersectSupportedOS - :: (r ~ IntersectOSList '[] l1 l2) + :: (r ~ IntersectOSList l1 l2) => OSList l1 -> OSList l2 -> OSList r intersectSupportedOS (OSList l1) (OSList l2) = OSList (filter (`elem` l2) l1) -- | Type level intersection for OSList -type family IntersectOSList (coll :: [a]) (list1 :: [a]) (list2 :: [a]) :: [a] -type instance IntersectOSList coll '[] list2 = coll -type instance IntersectOSList coll (a ': rest) list2 = +type family IntersectOSList (list1 :: [a]) (list2 :: [a]) :: [a] +type instance IntersectOSList '[] list2 = list2 +type instance IntersectOSList (a ': rest) list2 = If (ElemOSList a list2) - (IntersectOSList (a ': coll) rest list2) - (IntersectOSList coll rest list2) + (a ': IntersectOSList rest list2) + (IntersectOSList rest list2) -- | Type level elem for OSList type family ElemOSList a (list :: [b]) :: Bool |
