on master help sign in
Add ghc-8.4 support
5955c51Dmitry Bushev
schematic.cabal+4−4
@@ -57,7 +57,7 @@ library
57 , TypeOperators
57 , TypeOperators
58 , TypeSynonymInstances
58 , TypeSynonymInstances
59 , UndecidableInstances
59 , UndecidableInstances
60− build-depends: base >=4.9 && <4.11
60+ build-depends: base >=4.9 && <4.12
61 , bytestring
61 , bytestring
62 , aeson >= 1
62 , aeson >= 1
63 , containers
63 , containers
@@ -67,7 +67,7 @@ library
67 , regex-tdfa
67 , regex-tdfa
68 , regex-tdfa-text
68 , regex-tdfa-text
69 , scientific
69 , scientific
70− , singletons >= 2.2
70+ , singletons >= 2.4
71 , smallcheck
71 , smallcheck
72 , tagged
72 , tagged
73 , template-haskell
73 , template-haskell
@@ -87,7 +87,7 @@ test-suite spec
87 default-language: Haskell2010
87 default-language: Haskell2010
88 build-depends: HUnit
88 build-depends: HUnit
89 , aeson >= 1
89 , aeson >= 1
90− , base >=4.9 && <4.11
90+ , base >=4.9 && <4.12
91 , bytestring
91 , bytestring
92 , containers
92 , containers
93 , hjsonschema
93 , hjsonschema
@@ -109,4 +109,4 @@ test-suite spec
109 other-modules: SchemaSpec
109 other-modules: SchemaSpec
110 , HelpersSpec
110 , HelpersSpec
111 , LensSpec
111 , 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
42 SchemaByKey ( '(a, s) ': tl) fn = SchemaByKey tl fn
42 SchemaByKey ( '(a, s) ': tl) fn = SchemaByKey tl fn
43
43
44type family DeleteKey (acc :: [(Symbol, Schema)]) (fn :: Symbol) (fs :: [(Symbol, Schema)]) :: [(Symbol, Schema)] where
44type family DeleteKey (acc :: [(Symbol, Schema)]) (fn :: Symbol) (fs :: [(Symbol, Schema)]) :: [(Symbol, Schema)] where
45− DeleteKey acc fn ('(fn, a) ': tl) = acc :++ tl
45+ DeleteKey acc fn ('(fn, a) ': tl) = acc ++ tl
46− DeleteKey acc fn (fna ': tl) = acc :++ (fna ': tl)
46+ DeleteKey acc fn (fna ': tl) = acc ++ (fna ': tl)
47
47
48type family UpdateKey
48type family UpdateKey
49 (fn :: Symbol)
49 (fn :: Symbol)
@@ -146,7 +146,7 @@ data instance Sing (v :: Versioned) where
146
146
147type DataMigration s m h = Tagged s (JsonRepr h -> m (JsonRepr s))
147type DataMigration s m h = Tagged s (JsonRepr h -> m (JsonRepr s))
148
148
149−data MList :: (* -> *) -> [Schema] -> Type where
149+data MList :: (Type -> Type) -> [Schema] -> Type where
150 MNil :: (Monad m, SingI s, TopLevel s) => MList m '[s]
150 MNil :: (Monad m, SingI s, TopLevel s) => MList m '[s]
151 (:&&)
151 (:&&)
152 :: (TopLevel s, SingI s)
152 :: (TopLevel s, SingI s)
src/Data/Schematic/Path.hs+1−1
@@ -29,7 +29,7 @@ demotePath = go []
29 go acc (SCons p ps) = go (acc ++ [demote p]) ps
29 go acc (SCons p ps) = go (acc ++ [demote p]) ps
30 demote :: Sing (ps :: PathSegment) -> DemotedPathSegment
30 demote :: Sing (ps :: PathSegment) -> DemotedPathSegment
31 demote (SKey s) = DKey $ T.pack $ withKnownSymbol s $ symbolVal s
31 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
33
33
34demotedPathToText :: [DemotedPathSegment] -> JSONPath
34demotedPathToText :: [DemotedPathSegment] -> JSONPath
35demotedPathToText = JSONPath . F.foldl' renderPathSegment ""
35demotedPathToText = JSONPath . F.foldl' renderPathSegment ""
src/Data/Schematic/Schema.hs+11−11
@@ -48,11 +48,11 @@ data TextConstraint
48instance SingKind TextConstraint where
48instance SingKind TextConstraint where
49 type Demote TextConstraint = DemotedTextConstraint
49 type Demote TextConstraint = DemotedTextConstraint
50 fromSing = \case
50 fromSing = \case
51− STEq n -> withKnownNat n (DTEq $ natVal n)
51+ STEq n -> withKnownNat n (DTEq . fromIntegral $ natVal n)
52− STLt n -> withKnownNat n (DTLt $ natVal n)
52+ STLt n -> withKnownNat n (DTLt . fromIntegral $ natVal n)
53− STLe n -> withKnownNat n (DTLe $ natVal n)
53+ STLe n -> withKnownNat n (DTLe . fromIntegral $ natVal n)
54− STGt n -> withKnownNat n (DTGt $ natVal n)
54+ STGt n -> withKnownNat n (DTGt . fromIntegral $ natVal n)
55− STGe n -> withKnownNat n (DTGe $ natVal n)
55+ STGe n -> withKnownNat n (DTGe . fromIntegral $ natVal n)
56 STRegex s -> withKnownSymbol s (DTRegex $ T.pack $ symbolVal s)
56 STRegex s -> withKnownSymbol s (DTRegex $ T.pack $ symbolVal s)
57 STEnum s -> let
57 STEnum s -> let
58 d :: Sing (s :: [Symbol]) -> [Text]
58 d :: Sing (s :: [Symbol]) -> [Text]
@@ -153,11 +153,11 @@ instance Eq (Sing ('NGe n)) where _ == _ = True
153instance SingKind NumberConstraint where
153instance SingKind NumberConstraint where
154 type Demote NumberConstraint = DemotedNumberConstraint
154 type Demote NumberConstraint = DemotedNumberConstraint
155 fromSing = \case
155 fromSing = \case
156− SNEq n -> withKnownNat n (DNEq $ natVal n)
156+ SNEq n -> withKnownNat n (DNEq . fromIntegral $ natVal n)
157− SNGt n -> withKnownNat n (DNGt $ natVal n)
157+ SNGt n -> withKnownNat n (DNGt . fromIntegral $ natVal n)
158− SNGe n -> withKnownNat n (DNGe $ natVal n)
158+ SNGe n -> withKnownNat n (DNGe . fromIntegral $ natVal n)
159− SNLt n -> withKnownNat n (DNLt $ natVal n)
159+ SNLt n -> withKnownNat n (DNLt . fromIntegral $ natVal n)
160− SNLe n -> withKnownNat n (DNLe $ natVal n)
160+ SNLe n -> withKnownNat n (DNLe . fromIntegral $ natVal n)
161 toSing = \case
161 toSing = \case
162 DNEq n -> case someNatVal n of
162 DNEq n -> case someNatVal n of
163 Just (SomeNat (_ :: Proxy n)) -> SomeSing (SNEq (SNat :: Sing n))
163 Just (SomeNat (_ :: Proxy n)) -> SomeSing (SNEq (SNat :: Sing n))
@@ -193,7 +193,7 @@ instance Eq (Sing ('AEq n)) where _ == _ = True
193instance SingKind ArrayConstraint where
193instance SingKind ArrayConstraint where
194 type Demote ArrayConstraint = DemotedArrayConstraint
194 type Demote ArrayConstraint = DemotedArrayConstraint
195 fromSing = \case
195 fromSing = \case
196− SAEq n -> withKnownNat n (DAEq $ natVal n)
196+ SAEq n -> withKnownNat n (DAEq . fromIntegral $ natVal n)
197 toSing = \case
197 toSing = \case
198 DAEq n -> case someNatVal n of
198 DAEq n -> case someNatVal n of
199 Just (SomeNat (_ :: Proxy n)) -> SomeSing (SAEq (SNat :: Sing n))
199 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