-
Notifications
You must be signed in to change notification settings - Fork 4
/
schemas.cabal
109 lines (105 loc) · 3.76 KB
/
schemas.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
cabal-version: 2.0
name: schemas
version: 0.4.0.2
synopsis: schema guided serialization
description:
Schemas is a Haskell library for serializing and deserializing data in JSON.
With schemas one does not define parsing and encoding functions, instead one
defines a schema that explains the "shape" of the data, and the library provides
the encode and decode functions. Shape descriptions are statically typed.
.
Schemas are related by a subtyping relation, which can be used to implement
a simple form of schema versioning. As long as one knows the source and target
schemas, and the source is a subtype of the target, source values can be encoded
in the target schema.
.
The library also supports @oneOf@ schemas, which extend the
range of versioning changes that can be supported automatically without
resorting to explicit versions and conversion functions.
.
A type class @HasSchema@ is provided for convenience, but none of the
core functions in the library rely on type classes.
.
Schemas can be derived generically using @generics-sop@, although most of the
time it makes more sense to define the schemas explicitly to ensure well-behaved
versioning.
-- bug-reports:
license: BSD3
license-file: LICENSE
author: Pepe Iborra
maintainer: [email protected]
-- copyright:
category: Data
build-type: Simple
extra-source-files: CHANGELOG.md, README.md
homepage: https://github.com/pepeiborra/schemas
bug-reports: https://github.com/pepeiborra/schemas/issues
source-repository head
type: git
location: https://github.com/pepeiborra/schemas.git
library
exposed-modules:
Schemas
Schemas.Class
Schemas.Internal
Schemas.OpenApi2
Schemas.Attempt
Schemas.SOP
Schemas.Untyped
-- other-modules:
-- other-extensions:
-- upper bounds on base are mandatory
build-depends: base >= 4.12 && < 100
, aeson
, bifunctors
, bytestring
, free
, generics-sop >= 0.5.0.0
, hashable
, lens
, lens-aeson
, mtl
, profunctors
, scientific
, text
, transformers
, unordered-containers
, vector
hs-source-dirs: src
default-language: Haskell2010
default-extensions: TypeApplications, OverloadedStrings, LambdaCase
test-suite spec
default-language: Haskell2010
default-extensions: TypeApplications
type: exitcode-stdio-1.0
hs-source-dirs: example, test
main-is: Main.hs
ghc-options: -threaded -with-rtsopts=-M1G
other-modules: Person
, Person2
, Person3
, Person4
, Walkthrough
, Looper
, Unions
, SchemasSpec
, Schemas.OpenApi2Spec
, Schemas.SOPSpec
, Generators
build-depends: aeson
, aeson-pretty
, base
, bytestring
, generic-lens
, generics-sop
, hspec
, lens
, mtl
, pretty-simple
, QuickCheck
, schemas
, syb
, text
, transformers
, unordered-containers
build-tool-depends: hspec-discover:hspec-discover