git.iko.soy/typeable/schematic
on master help sign in
Add ghc-8.4 support
commit5955c51515af27668a63db0b8f8477d40aa43fde authorDmitry Bushev <bushevdv@gmail.com> dateMon 9 Apr 2018, 23:06 (9 years ago) parent30d932b
5 files changed+31−20
schematic.cabal+4−4 src/Data/Schematic/Migration.hs+3−3 src/Data/Schematic/Path.hs+1−1 src/Data/Schematic/Schema.hs+11−11 stack.yaml+12−1
schematic.cabal+4−4
@@ -57,7 +57,7 @@ library
5757 , TypeOperators
5858 , TypeSynonymInstances
5959 , UndecidableInstances
60− build-depends: base >=4.9 && <4.11
60+ build-depends: base >=4.9 && <4.12
6161 , bytestring
6262 , aeson >= 1
6363 , containers
@@ -67,7 +67,7 @@ library
6767 , regex-tdfa
6868 , regex-tdfa-text
6969 , scientific
70− , singletons >= 2.2
70+ , singletons >= 2.4
7171 , smallcheck
7272 , tagged
7373 , template-haskell
@@ -87,7 +87,7 @@ test-suite spec
8787 default-language: Haskell2010
8888 build-depends: HUnit
8989 , aeson >= 1
90− , base >=4.9 && <4.11
90+ , base >=4.9 && <4.12
9191 , bytestring
9292 , containers
9393 , hjsonschema
@@ -109,4 +109,4 @@ test-suite spec
109109 other-modules: SchemaSpec
110110 , HelpersSpec
111111 , LensSpec
112− , JsonSchemaSpec
112+ , JsonSchemaSpec
src/Data/Schematic/Migration.hs+3−3
@@ -42,8 +42,8 @@ type family SchemaByKey (fs :: [(Symbol, Schema)]) (s :: Symbol) :: Schema where
4242 SchemaByKey ( '(a, s) ': tl) fn = SchemaByKey tl fn
4343
4444type family DeleteKey (acc :: [(Symbol, Schema)]) (fn :: Symbol) (fs :: [(Symbol, Schema)]) :: [(Symbol, Schema)] where
45− DeleteKey acc fn ('(fn, a) ': tl) = acc :++ tl
46− DeleteKey acc fn (fna ': tl) = acc :++ (fna ': tl)
45+ DeleteKey acc fn ('(fn, a) ': tl) = acc ++ tl
46+ DeleteKey acc fn (fna ': tl) = acc ++ (fna ': tl)
4747
4848type family UpdateKey
4949 (fn :: Symbol)
@@ -146,7 +146,7 @@ data instance Sing (v :: Versioned) where
146146
147147type DataMigration s m h = Tagged s (JsonRepr h -> m (JsonRepr s))
148148
149−data MList :: (* -> *) -> [Schema] -> Type where
149+data MList :: (Type -> Type) -> [Schema] -> Type where
150150 MNil :: (Monad m, SingI s, TopLevel s) => MList m '[s]
151151 (:&&)
152152 :: (TopLevel s, SingI s)
src/Data/Schematic/Path.hs+1−1
@@ -29,7 +29,7 @@ demotePath = go []
2929 go acc (SCons p ps) = go (acc ++ [demote p]) ps
3030 demote :: Sing (ps :: PathSegment) -> DemotedPathSegment
3131 demote (SKey s) = DKey $ T.pack $ withKnownSymbol s $ symbolVal s
32− demote (SIx n) = DIx $ withKnownNat n $ natVal n
32+ demote (SIx n) = DIx $ withKnownNat n $ fromIntegral $ natVal n
3333
3434demotedPathToText :: [DemotedPathSegment] -> JSONPath
3535demotedPathToText = JSONPath . F.foldl' renderPathSegment ""
src/Data/Schematic/Schema.hs+11−11
@@ -48,11 +48,11 @@ data TextConstraint
4848instance SingKind TextConstraint where
4949 type Demote TextConstraint = DemotedTextConstraint
5050 fromSing = \case
51− STEq n -> withKnownNat n (DTEq $ natVal n)
52− STLt n -> withKnownNat n (DTLt $ natVal n)
53− STLe n -> withKnownNat n (DTLe $ natVal n)
54− STGt n -> withKnownNat n (DTGt $ natVal n)
55− STGe n -> withKnownNat n (DTGe $ natVal n)
51+ STEq n -> withKnownNat n (DTEq . fromIntegral $ natVal n)
52+ STLt n -> withKnownNat n (DTLt . fromIntegral $ natVal n)
53+ STLe n -> withKnownNat n (DTLe . fromIntegral $ natVal n)
54+ STGt n -> withKnownNat n (DTGt . fromIntegral $ natVal n)
55+ STGe n -> withKnownNat n (DTGe . fromIntegral $ natVal n)
5656 STRegex s -> withKnownSymbol s (DTRegex $ T.pack $ symbolVal s)
5757 STEnum s -> let
5858 d :: Sing (s :: [Symbol]) -> [Text]
@@ -153,11 +153,11 @@ instance Eq (Sing ('NGe n)) where _ == _ = True
153153instance SingKind NumberConstraint where
154154 type Demote NumberConstraint = DemotedNumberConstraint
155155 fromSing = \case
156− SNEq n -> withKnownNat n (DNEq $ natVal n)
157− SNGt n -> withKnownNat n (DNGt $ natVal n)
158− SNGe n -> withKnownNat n (DNGe $ natVal n)
159− SNLt n -> withKnownNat n (DNLt $ natVal n)
160− SNLe n -> withKnownNat n (DNLe $ natVal n)
156+ SNEq n -> withKnownNat n (DNEq . fromIntegral $ natVal n)
157+ SNGt n -> withKnownNat n (DNGt . fromIntegral $ natVal n)
158+ SNGe n -> withKnownNat n (DNGe . fromIntegral $ natVal n)
159+ SNLt n -> withKnownNat n (DNLt . fromIntegral $ natVal n)
160+ SNLe n -> withKnownNat n (DNLe . fromIntegral $ natVal n)
161161 toSing = \case
162162 DNEq n -> case someNatVal n of
163163 Just (SomeNat (_ :: Proxy n)) -> SomeSing (SNEq (SNat :: Sing n))
@@ -193,7 +193,7 @@ instance Eq (Sing ('AEq n)) where _ == _ = True
193193instance SingKind ArrayConstraint where
194194 type Demote ArrayConstraint = DemotedArrayConstraint
195195 fromSing = \case
196− SAEq n -> withKnownNat n (DAEq $ natVal n)
196+ SAEq n -> withKnownNat n (DAEq . fromIntegral $ natVal n)
197197 toSing = \case
198198 DAEq n -> case someNatVal n of
199199 Just (SomeNat (_ :: Proxy n)) -> SomeSing (SAEq (SNat :: Sing n))
stack.yaml+12−1
@@ -1 +1,12 @@
1−resolver: lts-10.0
1+resolver: nightly-2018-04-05
2+extra-deps:
3+ - transformers-lift-0.2.0.1
4+ - union-0.1.1.2
5+ - QuickCheck-2.10.1
6+ - http-types-0.9.1
7+ - git: https://github.com/4e6/validationt.git
8+ commit: b1ec01576114595c109d3e86f4cb2fad3de43b43
9+ - git: https://github.com/4e6/hjsonpointer.git
10+ commit: 53833ce632b84eb209dea6748ad642502a02249a
11+ - git: https://github.com/4e6/hjsonschema.git
12+ commit: 370cee6aab20157bee0c00d5f2cb01c6221610f1