forked from Qqwy/haskell-vary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.yaml
153 lines (137 loc) · 4.47 KB
/
package.yaml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: vary
version: 0.1.1.1
github: "qqwy/haskell-vary"
license: MIT
author: "Marten Wijnja (Qqwy)"
maintainer: "[email protected]"
copyright: "2024 Marten Wijnja (Qqwy)"
extra-source-files:
- README.md
- CHANGELOG.md
# Metadata used when publishing your package
# synopsis: Short description of your package
# category: Web
# To avoid duplicated efforts in documentation and dealing with the
# complications of embedding Haddock markup inside cabal files, it is
# common to point users to the README.md file.
synopsis: "Vary: Friendly and fast polymorphic variants (open unions/coproducts/extensible sums)"
category: Data, Data Structures, Error Handling
description: |
Vary: Friendly and fast Variant types for Haskell
Just like tuples are a version of a user-defined product type (only without the field names), a Variant is a version of a user-defined sum type (but without the field names).
Variant types are the generalization of `Either`. Especially in the situation where you want to handle multiple errors, Variant types are a great abstraction to use.
Variant types are sometimes called '_polymorphic_ variants' for disambiguation. They are also commonly known as (open) unions, coproducts or extensible sums.
Vary is lightweight on dependencies. With all library flags turned off, it only depends on `base` and `deepseq`.
Please see the full README below or on GitHub at <https://github.com/qqwy/haskell-vary#readme>
flags:
aeson:
description: "When enabled implements the @FromJSON@/@ToJSON@ typeclasses from the aeson library. When disabled, does not depend on the aeson library."
default: true
manual: true
binary:
description: "When enabled implements the @Binary@ typeclass from the binary library. When disabled, does not depend on the binary library."
default: true
manual: true
cereal:
description: "When enabled implements the @Serialize@ typeclass from the cereal library. When disabled, does not depend on the cereal library."
default: true
manual: true
hashable:
description: "When enabled implements the @Hashable@ typeclass from the hashable library. When disabled, does not depend on the @hashable@ library."
default: true
manual: true
quickcheck:
description: "When enabled implements the @Arbitrary@ typeclasses from the QuickCheck library. When disabled, does not depend on the QuickCheck library."
default: true
manual: true
dependencies:
- base >= 4.7 && < 5
- deepseq >= 1.4.0 && < 1.6
when:
- condition: flag(hashable)
dependencies:
- hashable >= 1.3.0 && < 1.6
cpp-options: -DFLAG_HASHABLE
- condition: flag(aeson)
dependencies:
- aeson >= 2.0.0 && < 2.3
cpp-options: -DFLAG_AESON
- condition: flag(binary)
dependencies:
- binary >= 0.8.0.0 && < 0.9.0.0
cpp-options: -DFLAG_BINARY
- condition: flag(cereal)
dependencies:
- cereal >= 0.5.0.0 && < 0.6.0.0
cpp-options: -DFLAG_CEREAL
- condition: flag(quickcheck)
dependencies:
- QuickCheck >= 2.12 && < 2.16
cpp-options: -DFLAG_QUICKCHECK
ghc-options:
- -Wall
- -Wcompat
- -Widentities
- -Wincomplete-record-updates
- -Wincomplete-uni-patterns
- -Wmissing-export-lists
- -Wmissing-home-modules
- -Wpartial-fields
- -Wredundant-constraints
library:
source-dirs: src
other-modules:
- Vary.Core
# executables:
# vary-exe:
# main: Main.hs
# source-dirs: app
# ghc-options:
# - -threaded
# - -rtsopts
# - -with-rtsopts=-N
# dependencies:
# - vary
tests:
vary-test:
main: spec.hs
source-dirs: test/spec
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- vary
- hspec
- QuickCheck >= 2.12 && < 2.16
- aeson >= 2.0.0 && < 2.3
- binary
- bytestring
- cereal
doctests:
main: doctests.hs
source-dirs: test/doctest
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- vary
- doctest-parallel
readme:
main: test/README.lhs
ghc-options:
- -pgmL markdown-unlit
- -Wno-deferred-type-errors
- -Wno-missing-signatures
- -Wno-unused-matches
- -Wno-redundant-constraints
- -Wno-unused-imports
- -Wno-missing-export-lists
build-tools:
- markdown-unlit:markdown-unlit
dependencies:
- vary
- markdown-unlit
- hspec
- should-not-typecheck