summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/MetaTypes.hs
diff options
context:
space:
mode:
authorJoey Hess2016-03-27 18:32:01 -0400
committerJoey Hess2016-03-27 18:32:01 -0400
commit500635568514bc106597a857c60d268dcf668037 (patch)
tree8c8b036b6526e83f88a0b83944e30c128ccad8e1 /src/Propellor/Types/MetaTypes.hs
parent7e76731a0098a6cd47979c86c8a484cc47e0b0d7 (diff)
split out singletons lib
Diffstat (limited to 'src/Propellor/Types/MetaTypes.hs')
-rw-r--r--src/Propellor/Types/MetaTypes.hs14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/Propellor/Types/MetaTypes.hs b/src/Propellor/Types/MetaTypes.hs
index 3e89e28d..39d6e725 100644
--- a/src/Propellor/Types/MetaTypes.hs
+++ b/src/Propellor/Types/MetaTypes.hs
@@ -25,6 +25,7 @@ module Propellor.Types.MetaTypes (
EqT,
) where
+import Propellor.Types.Singletons
import Propellor.Types.OS
data MetaType
@@ -49,13 +50,6 @@ type instance IncludesInfo (MetaTypes l) = Elem 'WithInfo l
type MetaTypes = Sing
--- | The data family of singleton types.
-data family Sing (x :: k)
-
--- | A class used to pass singleton values implicitly.
-class SingI t where
- sing :: Sing t
-
-- This boilerplatw would not be needed if the singletons library were
-- used. However, we're targeting too old a version of ghc to use it yet.
data instance Sing (x :: MetaType) where
@@ -68,12 +62,6 @@ instance SingI ('Targeting 'OSBuntish) where sing = OSBuntishS
instance SingI ('Targeting 'OSFreeBSD) where sing = OSFreeBSDS
instance SingI 'WithInfo where sing = WithInfoS
-data instance Sing (x :: [k]) where
- Nil :: Sing '[]
- Cons :: Sing x -> Sing xs -> Sing (x ': xs)
-instance (SingI x, SingI xs) => SingI (x ': xs) where sing = Cons sing sing
-instance SingI '[] where sing = Nil
-
-- | Convenience type operator to combine two `MetaTypes` lists.
--
-- For example: