dry-types 1.2.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +306 -225
  3. data/LICENSE +1 -1
  4. data/README.md +14 -12
  5. data/dry-types.gemspec +27 -31
  6. data/lib/dry/types.rb +0 -9
  7. data/lib/dry/types/builder.rb +4 -0
  8. data/lib/dry/types/constructor/function.rb +17 -31
  9. data/lib/dry/types/core.rb +3 -1
  10. data/lib/dry/types/decorator.rb +0 -7
  11. data/lib/dry/types/extensions/maybe.rb +14 -14
  12. data/lib/dry/types/lax.rb +1 -4
  13. data/lib/dry/types/meta.rb +2 -2
  14. data/lib/dry/types/params.rb +1 -0
  15. data/lib/dry/types/result.rb +2 -2
  16. data/lib/dry/types/schema.rb +23 -2
  17. data/lib/dry/types/schema/key.rb +11 -2
  18. data/lib/dry/types/spec/types.rb +11 -0
  19. data/lib/dry/types/sum.rb +2 -2
  20. data/lib/dry/types/version.rb +1 -1
  21. metadata +21 -59
  22. data/.codeclimate.yml +0 -12
  23. data/.github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md +0 -10
  24. data/.github/ISSUE_TEMPLATE/---bug-report.md +0 -30
  25. data/.github/ISSUE_TEMPLATE/---feature-request.md +0 -18
  26. data/.github/workflows/custom_ci.yml +0 -76
  27. data/.github/workflows/docsite.yml +0 -34
  28. data/.github/workflows/sync_configs.yml +0 -34
  29. data/.gitignore +0 -11
  30. data/.rspec +0 -4
  31. data/.rubocop.yml +0 -92
  32. data/.yardopts +0 -9
  33. data/CODE_OF_CONDUCT.md +0 -13
  34. data/CONTRIBUTING.md +0 -29
  35. data/Gemfile +0 -34
  36. data/Rakefile +0 -22
  37. data/benchmarks/hash_schemas.rb +0 -55
  38. data/benchmarks/lax_schema.rb +0 -15
  39. data/benchmarks/profile_invalid_input.rb +0 -15
  40. data/benchmarks/profile_lax_schema_valid.rb +0 -16
  41. data/benchmarks/profile_valid_input.rb +0 -15
  42. data/benchmarks/schema_valid_vs_invalid.rb +0 -21
  43. data/benchmarks/setup.rb +0 -17
  44. data/docsite/source/array-with-member.html.md +0 -13
  45. data/docsite/source/built-in-types.html.md +0 -116
  46. data/docsite/source/constraints.html.md +0 -31
  47. data/docsite/source/custom-types.html.md +0 -93
  48. data/docsite/source/default-values.html.md +0 -91
  49. data/docsite/source/enum.html.md +0 -69
  50. data/docsite/source/extensions.html.md +0 -15
  51. data/docsite/source/extensions/maybe.html.md +0 -57
  52. data/docsite/source/extensions/monads.html.md +0 -61
  53. data/docsite/source/getting-started.html.md +0 -57
  54. data/docsite/source/hash-schemas.html.md +0 -169
  55. data/docsite/source/index.html.md +0 -156
  56. data/docsite/source/map.html.md +0 -17
  57. data/docsite/source/optional-values.html.md +0 -35
  58. data/docsite/source/sum.html.md +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b3fc7a2d5685f6e867418934765d0e3a4ecfbc5b62385ee371a38e15c09e9b1
4
- data.tar.gz: 07ef4d9b60132cf459fbf18709e44b275e23f94141a3dc975d2eb50e7ac500e8
3
+ metadata.gz: 9d7b15ca8ad5ac777c21b3911c2f28cc01b5ec3b44b8d9d8b9c3d099a349b688
4
+ data.tar.gz: c77acb5cfa7d0af802bd29b934336c361757b77cd6a4b2983a2501aac024d87d
5
5
  SHA512:
6
- metadata.gz: 1b82208815b88c0c3291b4bb6db0ddf781d2cd13fad10e98b265b79bf070a2099c5a010cb20a313f9f3833a6b6f6ce2839938a51c34d73a1eaa4eaf2952868af
7
- data.tar.gz: cccb4e835c977bfa978e4fd7d9d253810e9c83b9e5b181bb44b544caff966bd71957c7d730de17f2d5081f05a0be527495bf16b6222bbbe3657fa897fc33e085
6
+ metadata.gz: 47d4acd8c163f1515e74a1a8b7c7133df9bd484d4c8b972dece8cb9555f26f357d84d280fdac8cf917661d771eea08c8c86d84c60a5f3bfbccbaa3061af5be18
7
+ data.tar.gz: c55776bb5acb2879788967d0dfd1f86a8b5379c048e5e2c0dca265ab2fb4a73149889674be2333a8b3b90c3f06e5fed09bd5ed005f75f9270bb4a5d12f07213f
data/CHANGELOG.md CHANGED
@@ -1,10 +1,33 @@
1
- # 1.2.2 2019-12-14
1
+ ## 1.3.0 2020-02-10
2
2
 
3
- ## Fixed
4
3
 
5
- - `Types.Contructor` doesn't re-wrap class instances implementing type interface, this fixes some quirks in dry-struct (flash-gordon)
4
+ ### Added
5
+
6
+ - `Schema#merge` for merging two hash schemas (@waiting-for-dev)
7
+ - Aliases for `.constructor` to non-constructor types. Now you can call `.prepend`/`.append` without silly checks for the type being a constructor (flash-gordon)
8
+ ```ruby
9
+ (Dry::Types['integer'].prepend(-> { _1 + 1 })).(1) # => 2
10
+ (Dry::Types['coercible.integer'] >> -> { _1 * 2 }).('99') # => 198
11
+ ```
12
+ - `Hash::Schema#clear` returns a schema with the same options but without keys
13
+ - Optional namespace now includes strict types by default (@flash-gordon) strings already (@flash-gordon)"
14
+
15
+ ### Fixed
16
+
17
+ - `Schema::Key#optional` returns an instance of `Schema::Key` as it should have done
18
+ - Composition with function handling exceptions. This could occasionally lead to unexpected exceptions (@flash-gordon)
19
+
20
+
21
+ [Compare v1.2.2...v1.3.0](https://github.com/dry-rb/dry-types/compare/v1.2.2...v1.3.0)
22
+
23
+ ## 1.2.2 2019-12-14
6
24
 
7
- ## Changed
25
+
26
+ ### Fixed
27
+
28
+ - `Types.Contructor` doesn't re-wrap class instances implementing type interface, this fixes some quirks in dry-struct (@flash-gordon)
29
+
30
+ ### Changed
8
31
 
9
32
  - Types now use immutable equalizers. This should improve performance in certain cases e.g. in ROM (flash-gordon)
10
33
  - Attempting to use non-symbol keys in hash schemas raises an error. We always supported only symbols as keys but there was no check, now it'll throw an argument error. If you want to convert strings to symbols, use `Hash#with_key_transform` (flash-gordon)
@@ -12,28 +35,21 @@
12
35
 
13
36
  [Compare v1.2.1...v1.2.2](https://github.com/dry-rb/dry-types/compare/v1.2.1...v1.2.2)
14
37
 
15
- # 1.2.1 2019-11-07
38
+ ## 1.2.1 2019-11-07
39
+
16
40
 
17
- ## Fixed
41
+ ### Fixed
18
42
 
19
43
  - Fix keyword warnings reported by Ruby 2.7 (flash-gordon)
20
44
  - Error type in failing case in `Array::Member` (esparta)
21
45
 
22
- [Compare v1.2.0...v1.2.1](https://github.com/dry-rb/dry-types/compare/v1.2.0...v1.2.1)
23
-
24
- # 1.2.0 2019-10-06
25
46
 
26
- ## Changed
27
-
28
- - `Dry::Types.[]` used to work with classes, now it's deprecated (flash-gordon)
47
+ [Compare v1.2.0...v1.2.1](https://github.com/dry-rb/dry-types/compare/v1.2.0...v1.2.1)
29
48
 
30
- ## Fixed
49
+ ## 1.2.0 2019-10-06
31
50
 
32
- - Bug with using a `Bool`-named struct as a schema key (flash-gordon)
33
- - A bunch of issues related to using `meta` on complex types (flash-gordon)
34
- - `Types.Constructor(...)` returns a `Types::Array` as it should (flash-gordon)
35
51
 
36
- ## Added
52
+ ### Added
37
53
 
38
54
  - `Optional::Params` types that coerce empty strings to `nil` (flash-gordon)
39
55
  ```ruby
@@ -79,19 +95,32 @@
79
95
  end
80
96
  ```
81
97
 
98
+ ### Fixed
99
+
100
+ - Bug with using a `Bool`-named struct as a schema key (flash-gordon)
101
+ - A bunch of issues related to using `meta` on complex types (flash-gordon)
102
+ - `Types.Constructor(...)` returns a `Types::Array` as it should (flash-gordon)
103
+
104
+ ### Changed
105
+
106
+ - `Dry::Types.[]` used to work with classes, now it's deprecated (flash-gordon)
107
+
82
108
  [Compare v1.1.1...v1.2.0](https://github.com/dry-rb/dry-types/compare/v1.1.1...v1.2.0)
83
109
 
84
- # 1.1.1 2019-07-26
110
+ ## 1.1.1 2019-07-26
85
111
 
86
- ## Fixed
112
+
113
+ ### Fixed
87
114
 
88
115
  - A bug where meta was lost for lax array types (flash-gordon)
89
116
 
117
+
90
118
  [Compare v1.1.0...v1.1.1](https://github.com/dry-rb/dry-types/compare/v1.1.0...v1.1.1)
91
119
 
92
- # 1.1.0 2019-07-02
120
+ ## 1.1.0 2019-07-02
93
121
 
94
- ## Added
122
+
123
+ ### Added
95
124
 
96
125
  - New builder method `Interface` constructs a type which accepts objects that respond to the given methods (waiting-for-dev)
97
126
  ```ruby
@@ -102,18 +131,20 @@
102
131
  ```
103
132
  - New types: `coercible.symbol`, `params.symbol`, and `json.symbol`, all use `.to_sym` for coercion (waiting-for-dev)
104
133
 
105
- ## Fixed
134
+ ### Fixed
106
135
 
107
136
  - Converting schema keys to maybe types (flash-gordon)
108
137
  - Using `Schema#key` and `Array#member` on constuctors (flash-gordon)
109
138
  - Using `meta(omittable: true)` within `transform_types` works again but produces a warning, please migrate to `.omittable` or `.required(false)` (flash-gordon)
110
139
  - Bug with a constructror defined on top of enum (flash-gordon)
111
140
 
141
+
112
142
  [Compare v1.0.1...v1.1.0](https://github.com/dry-rb/dry-types/compare/v1.0.1...v1.1.0)
113
143
 
114
- # 1.0.1 2019-06-04
144
+ ## 1.0.1 2019-06-04
115
145
 
116
- ## Added
146
+
147
+ ### Added
117
148
 
118
149
  - In a case of failure the constructor block can now pass a different value (flash-gordon)
119
150
  ```ruby
@@ -126,42 +157,13 @@
126
157
  ```
127
158
  - `Schema#strict` now accepts an boolean argument. If `fales` is passed this will turn a strict schema into a non-strict one (flash-gordon)
128
159
 
129
- [Compare v1.0.0...v1.0.1](https://github.com/dry-rb/dry-types/compare/v1.0.0...v1.0.1)
130
-
131
- # 1.0.0 2019-04-23
132
-
133
- ## Changed
134
-
135
- - [BREAKING] Behavior of built-in constructor types was changed to be more strict. They will always raise an error on failed coercion (flash-gordon)
136
- Compare:
137
-
138
- ```ruby
139
- # 0.15.0
140
- Types::Params::Integer.('foo')
141
- # => "foo"
142
160
 
143
- # 1.0.0
144
- Types::Params::Integer.('foo')
145
- # => Dry::Types::CoercionError: invalid value for Integer(): "foo"
146
- ```
147
-
148
- To handle coercion errors `Type#call` now yields a block:
149
-
150
- ```ruby
151
- Types::Params::Integer.('foo') { :invalid } # => :invalid
152
- ```
153
-
154
- This makes work with coercions more straightforward and way faster.
155
-
156
- - [BREAKING] Safe types were renamed to Lax, this name better serves their purpose. The previous name is available but prints a warning (flash-gordon)
157
- - [BREAKING] Metadata is now pushed down to the decorated type. It is not likely you will notice a difference but this a breaking change that enables some use cases in rom related to the usage of default types in relations (flash-gordon)
158
- - Nominal types are now completely unconstrained. This fixes some inconsistencies when using them with constraints. `Nominal#try` will always return a successful result, for the previous behavior use `Nominal#try_coerce` or switch to strict types with passing a block to `#call` (flash-gordon)
161
+ [Compare v1.0.0...v1.0.1](https://github.com/dry-rb/dry-types/compare/v1.0.0...v1.0.1)
159
162
 
160
- ## Performance improvements
163
+ ## 1.0.0 2019-04-23
161
164
 
162
- - During the work on this release, a lot of performance improvements were made. dry-types 1.0 combined with dry-logic 1.0 are multiple times faster than dry-types 0.15 and dry-logic 0.5 for common cases including constraints checking and coercion (flash-gordon)
163
165
 
164
- ## Added
166
+ ### Added
165
167
 
166
168
  - API for custom constructor types was enhanced. If you pass your own callable to `.constructor` it can have a block in its signature. If a block is passed, you must call it on failed coercion, otherwise raise a type coercion error (flash-gordon)
167
169
  Example:
@@ -190,44 +192,40 @@
190
192
  # => [1, 2, 3]
191
193
  ```
192
194
 
193
- [Compare v0.15.0...v1.0.0](https://github.com/dry-rb/dry-types/compare/v0.15.0...v1.0.0)
194
-
195
- # 0.15.0 2019-03-22
195
+ ### Changed
196
196
 
197
- ## Changed
197
+ - [BREAKING] Behavior of built-in constructor types was changed to be more strict. They will always raise an error on failed coercion (flash-gordon)
198
+ Compare:
198
199
 
199
- - [BREAKING] Internal representation of hash schemas was changed to be a simple list of key types (flash-gordon)
200
- `Dry::Types::Hash#with_type_transform` now yields a key type instead of type + name:
201
- ```ruby
202
- Dry::Types['strict.hash'].with_type_transform { |key| key.name == :age ? key.required(false) : key }
203
- ```
204
- - [BREAKING] Definition types were renamed to nominal (flash-gordon)
205
- - [BREAKING] Top-level types returned by `Dry::Types.[]` are now strict (flash-gordon)
206
200
  ```ruby
207
- # before
208
- Dry::Types['integer']
209
- # => #<Dry::Types[Nominal<Integer>]>
210
- # now
211
- Dry::Types['integer']
212
- # => <Dry::Types[Constrained<Nominal<Integer> rule=[type?(Integer)]>]>
213
- # you can still access nominal types using namespace
214
- Dry::Types['nominal.integer']
215
- # => #<Dry::Types[Nominal<Integer>]>
201
+ # 0.15.0
202
+ Types::Params::Integer.('foo')
203
+ # => "foo"
204
+
205
+ # 1.0.0
206
+ Types::Params::Integer.('foo')
207
+ # => Dry::Types::CoercionError: invalid value for Integer(): "foo"
216
208
  ```
217
- - [BREAKING] Default values are not evaluated if the decorated type returns `nil`. They are triggered on `Undefined` instead (GustavoCaso + flash-gordon)
218
- - [BREAKING] Support for old hash schemas was fully removed. This makes dry-types not compatible with dry-validation < 1.0 (flash-gordon)
219
- - `Dry::Types.module` is deprecated in favor of `Dry.Types` (flash-gordon)
220
- Keep in mind `Dry.Types` uses strict types for top-level names, that is after
209
+
210
+ To handle coercion errors `Type#call` now yields a block:
211
+
221
212
  ```ruby
222
- module Types
223
- include Dry.Types
224
- end
213
+ Types::Params::Integer.('foo') { :invalid } # => :invalid
225
214
  ```
226
- `Types::Integer` is a strict type. If you want it to be nominal, use `include Dry.Types(default: :nominal)`. See other options below.
227
- - `params.integer` now always converts strings to decimal numbers, this means `09` will be coerced to `9` (threw an error before) (skryukov)
228
- - Ruby 2.3 is EOL and not officially supported. It may work but we don't test it.
229
215
 
230
- ## Added
216
+ This makes work with coercions more straightforward and way faster.
217
+ - [BREAKING] Safe types were renamed to Lax, this name better serves their purpose. The previous name is available but prints a warning (flash-gordon)
218
+ - [BREAKING] Metadata is now pushed down to the decorated type. It is not likely you will notice a difference but this a breaking change that enables some use cases in rom related to the usage of default types in relations (flash-gordon)
219
+ - Nominal types are now completely unconstrained. This fixes some inconsistencies when using them with constraints. `Nominal#try` will always return a successful result, for the previous behavior use `Nominal#try_coerce` or switch to strict types with passing a block to `#call` (flash-gordon)
220
+ - ## Performance improvements
221
+ - During the work on this release, a lot of performance improvements were made. dry-types 1.0 combined with dry-logic 1.0 are multiple times faster than dry-types 0.15 and dry-logic 0.5 for common cases including constraints checking and coercion (flash-gordon)
222
+
223
+ [Compare v0.15.0...v1.0.0](https://github.com/dry-rb/dry-types/compare/v0.15.0...v1.0.0)
224
+
225
+ ## 0.15.0 2019-03-22
226
+
227
+
228
+ ### Added
231
229
 
232
230
  - Improved string representation of types (flash-gordon)
233
231
  ```ruby
@@ -285,7 +283,6 @@
285
283
  # keys in user_schema are not required
286
284
  user_schema = lax_hash.schema(name: 'string', age: 'integer')
287
285
  ```
288
-
289
286
  - `Type#optional?` now recognizes more cases where `nil` is an allowed value (flash-gordon)
290
287
  - `Constructor#{prepend,append}` with `<<` and `>>` as aliases. `Constructor#append` works the same way `Constructor#constrcutor` does. `Constuctor#prepend` chains functions in the reverse order, see examples (flash-gordon)
291
288
 
@@ -297,7 +294,6 @@
297
294
  inc = to_int.prepend { |x| x + "2" }
298
295
  inc.("1") # => "1" -> "12" -> 12
299
296
  ```
300
-
301
297
  - Partial schema application for cases when you want to validate only a subset of keys (flash-gordon)
302
298
  This is useful when you want to update a key or two in an already-validated hash. A perfect example is `Dry::Struct#new` where this feature is now used.
303
299
  ```ruby
@@ -307,87 +303,120 @@
307
303
  value.merge(update)
308
304
  ```
309
305
 
310
- ## Fixed
306
+ ### Fixed
311
307
 
312
308
  - `Hash::Map` now behaves as a constrained type if its values are constrained (flash-gordon)
313
309
  - `coercible.integer` now doesn't blow up on invalid strings (exterm)
314
310
 
315
- [Compare v0.14.0...v0.15.0](https://github.com/dry-rb/dry-types/compare/v0.14.0...v0.15.0)
311
+ ### Changed
312
+
313
+ - [BREAKING] Internal representation of hash schemas was changed to be a simple list of key types (flash-gordon)
314
+ `Dry::Types::Hash#with_type_transform` now yields a key type instead of type + name:
315
+ ```ruby
316
+ Dry::Types['strict.hash'].with_type_transform { |key| key.name == :age ? key.required(false) : key }
317
+ ```
318
+ - [BREAKING] Definition types were renamed to nominal (flash-gordon)
319
+ - [BREAKING] Top-level types returned by `Dry::Types.[]` are now strict (flash-gordon)
320
+ ```ruby
321
+ # before
322
+ Dry::Types['integer']
323
+ # => #<Dry::Types[Nominal<Integer>]>
324
+ # now
325
+ Dry::Types['integer']
326
+ # => <Dry::Types[Constrained<Nominal<Integer> rule=[type?(Integer)]>]>
327
+ # you can still access nominal types using namespace
328
+ Dry::Types['nominal.integer']
329
+ # => #<Dry::Types[Nominal<Integer>]>
330
+ ```
331
+ - [BREAKING] Default values are not evaluated if the decorated type returns `nil`. They are triggered on `Undefined` instead (GustavoCaso + flash-gordon)
332
+ - [BREAKING] Support for old hash schemas was fully removed. This makes dry-types not compatible with dry-validation < 1.0 (flash-gordon)
333
+ - `Dry::Types.module` is deprecated in favor of `Dry.Types` (flash-gordon)
334
+ Keep in mind `Dry.Types` uses strict types for top-level names, that is after
335
+ ```ruby
336
+ module Types
337
+ include Dry.Types
338
+ end
339
+ ```
340
+ `Types::Integer` is a strict type. If you want it to be nominal, use `include Dry.Types(default: :nominal)`. See other options below.
341
+ - `params.integer` now always converts strings to decimal numbers, this means `09` will be coerced to `9` (threw an error before) (skryukov)
342
+ - Ruby 2.3 is EOL and not officially supported. It may work but we don't test it.
343
+
344
+ [Compare v0.14.1...v0.15.0](https://github.com/dry-rb/dry-types/compare/v0.14.1...v0.15.0)
345
+
346
+ ## 0.14.1 2019-03-25
316
347
 
317
- # v0.14.1 2019-03-25
318
348
 
319
- ## Fixed
349
+ ### Fixed
320
350
 
321
351
  - `coercible.integer` now doesn't blow up on invalid strings (exterm)
322
352
 
323
- [Compare v0.14.0...v0.14.1](https://github.com/dry-rb/dry-types/compare/v0.14.0...v0.14.1)
324
353
 
325
- # v0.14.0 2019-01-29
354
+ [Compare v0.14.0...v0.14.1](https://github.com/dry-rb/dry-types/compare/v0.14.0...v0.14.1)
326
355
 
327
- ## Changed
356
+ ## 0.14.0 2019-01-29
328
357
 
329
- - [BREAKING] Support for Ruby 2.2 was dropped. It reached EOL on March 31, 2018.
330
- - `dry-logic` was updated to `~> 0.5` (solnic)
331
358
 
332
- ## Fixed
359
+ ### Fixed
333
360
 
334
361
  - `valid?` works correctly with constructors now (cgeorgii)
335
362
 
363
+ ### Changed
364
+
365
+ - [BREAKING] Support for Ruby 2.2 was dropped. It reached EOL on March 31, 2018.
366
+ - `dry-logic` was updated to `~> 0.5` (solnic)
367
+
336
368
  [Compare v0.13.4...v0.14.0](https://github.com/dry-rb/dry-types/compare/v0.13.4...v0.14.0)
337
369
 
338
- # v0.13.4 2018-12-21
370
+ ## 0.13.4 2018-12-21
339
371
 
340
- ## Fixed
372
+
373
+ ### Fixed
341
374
 
342
375
  - Fixed warnings about keyword arguments from Ruby 2.6. See https://bugs.ruby-lang.org/issues/14183 for all the details (flash-gordon)
343
376
 
344
- # v0.13.3 2018-11-25
345
377
 
346
- ## Fixed
378
+ [Compare v0.13.3...v0.13.4](https://github.com/dry-rb/dry-types/compare/v0.13.3...v0.13.4)
379
+
380
+ ## 0.13.3 2018-11-25
381
+
382
+
383
+ ### Fixed
347
384
 
348
385
  - `Dry::Types::Hash#try` returns `Failure` instead of throwing an exception on missing keys (GustavoCaso)
349
386
 
387
+
350
388
  [Compare v0.13.2...v0.13.3](https://github.com/dry-rb/dry-types/compare/v0.13.2...v0.13.3)
351
389
 
352
- # v0.13.2 2018-05-30
390
+ ## 0.13.2 2018-05-30
391
+
353
392
 
354
- ## Fixed
393
+ ### Fixed
355
394
 
356
395
  - `Defaults#valid?` now works fine when passing `Dry::Core::Constans::Undefined` as value (GustavoCaso)
357
396
  - `valid?` for constructor types wrapping `Sum`s (GustavoCaso)
358
397
 
398
+
359
399
  [Compare v0.13.1...v0.13.2](https://github.com/dry-rb/dry-types/compare/v0.13.1...v0.13.2)
360
400
 
361
- # v0.13.1 2018-05-28
401
+ ## 0.13.1 2018-05-28
402
+
403
+
404
+ ### Added
405
+
406
+ - `params.int` was added to make the upgrade process in dry-validation smoother (available after you `require 'dry/types/compat/int'`) (flash-gordon)
362
407
 
363
- ## Fixed
408
+ ### Fixed
364
409
 
365
410
  - Defaults now works fine with meta (GustavoCaso)
366
411
  - Defaults are now re-decorated properly (flash-gordon)
367
412
 
368
- ## Added
369
-
370
- - `params.int` was added to make the upgrade process in dry-validation smoother (available after you `require 'dry/types/compat/int'`) (flash-gordon)
371
413
 
372
414
  [Compare v0.13.0...v0.13.1](https://github.com/dry-rb/dry-types/compare/v0.13.0...v0.13.1)
373
415
 
374
- # v0.13.0 2018-05-03
416
+ ## 0.13.0 2018-05-03
375
417
 
376
- ## Changed
377
418
 
378
- - [BREAKING] Renamed `Types::Form` to `Types::Params`. You can opt-in the former name with `require 'dry/types/compat/form_types'`. It will be dropped in the next release (ndrluis)
379
- - [BREAKING] The `Int` types was renamed to `Integer`, this was the only type named differently from the standard Ruby classes so it has been made consistent. The former name is available with `require 'dry/types/compat/int'` (GustavoCaso + flash-gordon)
380
- - [BREAKING] Default types are not evaluated on `nil`. Default values are evaluated _only_ if no value were given.
381
- ```ruby
382
- type = Types::Strict::String.default("hello")
383
- type[nil] # => constraint error
384
- type[] # => "hello"
385
- ```
386
- This change allowed to greatly simplify hash schemas, make them a lot more flexible yet predictable (see below).
387
- - [BREAKING] `Dry::Types.register_class` was removed, `Dry::Types.register` was made private API, do not register your types in the global `dry-types` container, use a module instead, e.g. `Types` (flash-gordon)
388
- - [BREAKING] Enum types don't accept value index anymore. Instead, explicit mapping is supported, see below (flash-gordon)
389
-
390
- ## Added
419
+ ### Added
391
420
 
392
421
  - Hash schemas were rewritten. The old API is still around but is going to be deprecated and removed before 1.0. The new API is simpler and more flexible. Instead of having a bunch of predefined schemas you can build your own by combining the following methods:
393
422
 
@@ -425,7 +454,6 @@
425
454
  ```
426
455
 
427
456
  (flash-gordon)
428
-
429
457
  - `Types.Strict` is an alias for `Types.Instance` (flash-gordon)
430
458
  ```ruby
431
459
  strict_range = Types.Strict(Range)
@@ -455,175 +483,208 @@
455
483
  dict[10] # => 'published'
456
484
  ```
457
485
 
458
- ## Fixed
486
+ ### Fixed
459
487
 
460
488
  - Fixed applying constraints to optional type, i.e. `.optional.constrained` works correctly (flash-gordon)
461
489
  - Fixed enum working with optionals (flash-gordon)
462
-
463
- ## Internal
464
-
490
+ - ## Internal
465
491
  - Dropped the `dry-configurable` dependency (GustavoCaso)
466
492
  - The gem now uses `dry-inflector` for inflections instead of `inflecto` (GustavoCaso)
467
493
 
494
+ ### Changed
495
+
496
+ - [BREAKING] Renamed `Types::Form` to `Types::Params`. You can opt-in the former name with `require 'dry/types/compat/form_types'`. It will be dropped in the next release (ndrluis)
497
+ - [BREAKING] The `Int` types was renamed to `Integer`, this was the only type named differently from the standard Ruby classes so it has been made consistent. The former name is available with `require 'dry/types/compat/int'` (GustavoCaso + flash-gordon)
498
+ - [BREAKING] Default types are not evaluated on `nil`. Default values are evaluated _only_ if no value were given.
499
+ ```ruby
500
+ type = Types::Strict::String.default("hello")
501
+ type[nil] # => constraint error
502
+ type[] # => "hello"
503
+ ```
504
+ This change allowed to greatly simplify hash schemas, make them a lot more flexible yet predictable (see below).
505
+ - [BREAKING] `Dry::Types.register_class` was removed, `Dry::Types.register` was made private API, do not register your types in the global `dry-types` container, use a module instead, e.g. `Types` (flash-gordon)
506
+ - [BREAKING] Enum types don't accept value index anymore. Instead, explicit mapping is supported, see below (flash-gordon)
507
+
468
508
  [Compare v0.12.2...v0.13.0](https://github.com/dry-rb/dry-types/compare/v0.12.2...v0.13.0)
469
509
 
470
- # v0.12.2 2017-11-04
510
+ ## 0.12.2 2017-11-04
471
511
 
472
- ## Fixed
512
+
513
+ ### Fixed
473
514
 
474
515
  - The type compiler was fixed for simple rules such as used for strict type checks (flash-gordon)
475
516
  - Fixed an error on `Dry::Types['json.decimal'].try(nil)` (nesaulov)
476
517
  - Fixed an error on calling `try` on an array type built of constrained types (flash-gordon)
477
518
  - Implemented `===` for enum types (GustavoCaso)
478
519
 
520
+
479
521
  [Compare v0.12.1...v0.12.2](https://github.com/dry-rb/dry-types/compare/v0.12.1...v0.12.2)
480
522
 
481
- # v0.12.1 2017-10-11
523
+ ## 0.12.1 2017-10-11
482
524
 
483
- ## Fixed
525
+
526
+ ### Fixed
484
527
 
485
528
  - `Constructor#try` rescues `ArgumentError` (raised in cases like `Integer('foo')`) (flash-gordon)
486
529
  - `#constructor` works correctly for default and enum types (solnic)
487
530
  - Optional sum types work correctly in `safe` mode (GustavoCaso)
488
531
  - The equalizer of constrained types respects meta (flash-gordon)
489
532
 
490
- [Compare v0.12.0...v0.12.1](https://github.com/dry-rb/dry-types/compare/v0.12.0...v0.12.1)
491
533
 
492
- # v0.12.0 2017-09-15
534
+ [Compare v0.12.0...v0.12.1](https://github.com/dry-rb/dry-types/compare/v0.12.0...v0.12.1)
493
535
 
494
- ## Added
536
+ ## 0.12.0 2017-09-15
495
537
 
496
- - A bunch of shortcut methods for constructing types to the autogenerated module, e.g. `Types.Constructor(String, &:to_s)` (flash-gordon)
497
538
 
498
- ## Deprecated
539
+ ### Added
499
540
 
541
+ - A bunch of shortcut methods for constructing types to the autogenerated module, e.g. `Types.Constructor(String, &:to_s)` (flash-gordon)
542
+ - ## Deprecated
500
543
  - `Types::Array#member` was deprecated in favor of `Types::Array#of` (flash-gordon)
501
544
 
502
- [Compare v0.11.1...v0.12.0](https://github.com/dry-rb/dry-types/compare/v0.11.1...v0.12.0)
503
545
 
504
- # v0.11.1 2017-08-14
546
+ [Compare v0.11.1...v0.12.0](https://github.com/dry-rb/dry-types/compare/v0.11.1...v0.12.0)
505
547
 
506
- ## Changed
548
+ ## 0.11.1 2017-08-14
507
549
 
508
- - Constructors are now equalized using `fn` and `meta` too (flash-gordon)
509
550
 
510
- ## Fixed
551
+ ### Fixed
511
552
 
512
553
  - Fixed `Constructor#name` with `Sum`-types (flash-gordon)
513
554
 
555
+ ### Changed
556
+
557
+ - Constructors are now equalized using `fn` and `meta` too (flash-gordon)
558
+
514
559
  [Compare v0.11.0...v0.11.1](https://github.com/dry-rb/dry-types/compare/v0.11.0...v0.11.1)
515
560
 
516
- # v0.11.0 2017-06-30
561
+ ## 0.11.0 2017-06-30
562
+
517
563
 
518
- ## Added
564
+ ### Added
519
565
 
520
566
  - `#to_ast` available for all type objects (GustavoCaso)
521
567
  - `Types::Array#of` as an alias for `#member` (maliqq)
522
568
  - Detailed failure objects are passed to results which improves constraint violation messages (GustavoCaso)
523
569
 
570
+
524
571
  [Compare v0.10.3...v0.11.0](https://github.com/dry-rb/dry-types/compare/v0.10.3...v0.11.0)
525
572
 
526
- # v0.10.3 2017-05-06
573
+ ## 0.10.3 2017-05-06
574
+
527
575
 
528
- ## Added
576
+ ### Added
529
577
 
530
578
  - Callable defaults accept the underlying type (v-kolesnikov)
531
579
 
580
+
532
581
  [Compare v0.10.2...v0.10.3](https://github.com/dry-rb/dry-types/compare/v0.10.2...v0.10.3)
533
582
 
534
- # v0.10.2 2017-04-28
583
+ ## 0.10.2 2017-04-28
584
+
535
585
 
536
- ## Fixed
586
+ ### Fixed
537
587
 
538
588
  - Fixed `Type#optional?` for sum types (flash-gordon)
539
589
 
590
+
540
591
  [Compare v0.10.1...v0.10.2](https://github.com/dry-rb/dry-types/compare/v0.10.1...v0.10.2)
541
592
 
542
- # v0.10.1 2017-04-28
593
+ ## 0.10.1 2017-04-28
594
+
543
595
 
544
- ## Added
596
+ ### Added
545
597
 
546
598
  - `Type#optional?` returns true if type is Sum and left is nil (GustavoCaso)
547
599
  - `Type#pristine` returns a type without `meta` (flash-gordon)
548
600
 
549
- ## Fixed
601
+ ### Fixed
550
602
 
551
603
  - `meta` is used in type equality again (solnic)
552
604
  - `Any` works correctly with meta again (flash-gordon)
553
605
 
606
+
554
607
  [Compare v0.10.0...v0.10.1](https://github.com/dry-rb/dry-types/compare/v0.10.0...v0.10.1)
555
608
 
556
- # v0.10.0 2017-04-26
609
+ ## 0.10.0 2017-04-26
610
+
557
611
 
558
- ## Added
612
+ ### Added
559
613
 
560
614
  - Types can be used in `case` statements now (GustavoCaso)
561
615
 
562
- ## Fixed
616
+ ### Fixed
563
617
 
564
618
  - Return original value when Date.parse raises a RangeError (jviney)
565
619
 
566
- ## Changed
620
+ ### Changed
567
621
 
568
622
  - Meta data are now stored separately from options (flash-gordon)
569
623
  - `Types::Object` was renamed to `Types::Any` (flash-gordon)
570
624
 
571
625
  [Compare v0.9.4...v0.10.0](https://github.com/dry-rb/dry-types/compare/v0.9.4...v0.10.0)
572
626
 
573
- # v0.9.4 2017-01-24
627
+ ## 0.9.4 2017-01-24
574
628
 
575
- ## Added
629
+
630
+ ### Added
576
631
 
577
632
  - Added `Types::Object` which passes an object of any type (flash-gordon)
578
633
 
634
+
579
635
  [Compare v0.9.3...v0.9.4](https://github.com/dry-rb/dry-types/compare/v0.9.3...v0.9.4)
580
636
 
581
- # v0.9.3 2016-12-03
637
+ ## 0.9.3 2016-12-03
582
638
 
583
- ## Fixed
639
+
640
+ ### Fixed
584
641
 
585
642
  - Updated to dry-core >= 0.2.1 (ruby warnings are gone) (flash-gordon)
586
643
 
644
+
587
645
  [Compare v0.9.2...v0.9.3](https://github.com/dry-rb/dry-types/compare/v0.9.2...v0.9.3)
588
646
 
589
- # v0.9.2 2016-11-13
647
+ ## 0.9.2 2016-11-13
590
648
 
591
- ## Added
649
+
650
+ ### Added
592
651
 
593
652
  - Support for `"Y"` and `"N"` as `true` and `false` values, respectively (scare21410)
594
653
 
595
- ## Changed
654
+ ### Changed
596
655
 
597
656
  - Optimized object allocation in hash schemas, resulting in up to 25% speed boost (davydovanton)
598
657
 
599
658
  [Compare v0.9.1...v0.9.2](https://github.com/dry-rb/dry-types/compare/v0.9.1...v0.9.2)
600
659
 
601
- # v0.9.1 2016-11-04
660
+ ## 0.9.1 2016-11-04
661
+
602
662
 
603
- ## Fixed
663
+ ### Fixed
604
664
 
605
665
  - `Hash#strict_with_defaults` properly evaluates callable defaults (bolshakov)
606
666
 
607
- ## Changed
667
+ ### Changed
608
668
 
609
669
  - `Hash#weak` accepts Hash-descendants again (solnic)
610
670
 
611
671
  [Compare v0.9.0...v0.9.1](https://github.com/dry-rb/dry-types/compare/v0.9.0...v0.9.1)
612
672
 
613
- # v0.9.0 2016-09-21
673
+ ## 0.9.0 2016-09-21
614
674
 
615
- ## Added
675
+
676
+ ### Added
616
677
 
617
678
  - `Hash#strict_with_defaults` which validates presence of all required keys and respects default types for missing _values_ (backus)
618
679
  - `Type#constrained?` method (flash-gordon)
619
680
 
620
- ## Fixed
681
+ ### Fixed
621
682
 
622
683
  - Summing two constrained types works correctly (flash-gordon)
623
684
  - `Types::Array::Member#valid?` in cases where member type is a constraint (solnic)
624
685
  - `Hash::Schema#try` handles exceptions properly and returns a failure object (solnic)
625
686
 
626
- ## Changed
687
+ ### Changed
627
688
 
628
689
  - [BREAKING] Renamed `Hash##{schema=>permissive}` (backus)
629
690
  - [BREAKING] `dry-monads` dependency was made optional, Maybe types are available after `Dry::Types.load_extensions(:maybe)` (flash-gordon)
@@ -634,43 +695,47 @@
634
695
 
635
696
  [Compare v0.8.1...v0.9.0](https://github.com/dry-rb/dry-types/compare/v0.8.1...v0.9.0)
636
697
 
637
- # v0.8.1 2016-07-13
698
+ ## 0.8.1 2016-07-13
699
+
638
700
 
639
- ## Fixed
701
+ ### Fixed
640
702
 
641
703
  - Compiler no longer chokes on type nodes without args (solnic)
642
704
  - Removed `bin/console` from gem package (solnic)
643
705
 
706
+
644
707
  [Compare v0.8.0...v0.8.1](https://github.com/dry-rb/dry-types/compare/v0.8.0...v0.8.1)
645
708
 
646
- # v0.8.0 2016-07-01
709
+ ## 0.8.0 2016-07-01
710
+
647
711
 
648
- ## Added
712
+ ### Added
649
713
 
650
714
  - `Struct` now implements `Type` interface so ie `SomeStruct | String` works now (flash-gordon)
651
715
  - `:weak` Hash constructor which can partially coerce a hash even when it includes invalid values (solnic)
652
716
  - Types include `Dry::Equalizer` now (flash-gordon)
653
717
 
654
- ## Fixed
718
+ ### Fixed
655
719
 
656
720
  - `Struct#to_hash` descends into arrays too (nepalez)
657
721
  - `Default#with` works now (flash-gordon)
658
722
 
659
- ## Changed
723
+ ### Changed
660
724
 
661
725
  - `:symbolized` hash schema is now based on `:weak` schema (solnic)
662
726
  - `Struct::Value` instances are now **deeply frozen** via ice_nine (backus)
663
727
 
664
728
  [Compare v0.7.2...v0.8.0](https://github.com/dry-rb/dry-types/compare/v0.7.2...v0.8.0)
665
729
 
666
- # v0.7.2 2016-05-11
730
+ ## 0.7.2 2016-05-11
667
731
 
668
- ## Fixed
732
+
733
+ ### Fixed
669
734
 
670
735
  - `Bool#default` gladly accepts `false` as its value (solnic)
671
736
  - Creating an empty schema with input processor no longer fails (lasseebert)
672
737
 
673
- ## Changed
738
+ ### Changed
674
739
 
675
740
  - Allow multiple calls to meta (solnic)
676
741
  - Allow capitalised versions of true and false values for boolean coercions (nil0bject)
@@ -682,24 +747,26 @@
682
747
 
683
748
  [Compare v0.7.1...v0.7.2](https://github.com/dry-rb/dry-types/compare/v0.7.1...v0.7.2)
684
749
 
685
- # v0.7.1 2016-04-06
750
+ ## 0.7.1 2016-04-06
751
+
686
752
 
687
- ## Added
753
+ ### Added
688
754
 
689
755
  - `JSON::*` types with JSON-specific coercions (coop)
690
756
 
691
- ## Fixed
757
+ ### Fixed
692
758
 
693
759
  - Schema is properly inherited in Struct (backus)
694
760
  - `constructor_type` is properly inherited in Struct (fbernier)
695
761
 
762
+
696
763
  [Compare v0.7.0...v0.7.1](https://github.com/dry-rb/dry-types/compare/v0.7.0...v0.7.1)
697
764
 
698
- # v0.7.0 2016-03-30
765
+ ## 0.7.0 2016-03-30
699
766
 
700
767
  Major focus of this release is to make complex type composition possible and improving constraint errors to be more meaningful.
701
768
 
702
- ## Added
769
+ ### Added
703
770
 
704
771
  - `Type#try` interface that tries to process the input and return a result object which can be either a success or failure (solnic)
705
772
  - `#meta` interface for setting arbitrary meta data on types (solnic)
@@ -709,12 +776,12 @@ Major focus of this release is to make complex type composition possible and imp
709
776
  - Compiler supports `[:constructor, [primitive, fn_proc]]` nodes (solnic)
710
777
  - Compiler supports building schema-less `form.hash` types (solnic)
711
778
 
712
- ## Fixed
779
+ ### Fixed
713
780
 
714
781
  - `Sum` now supports complex types like `Array` or `Hash` with member types and/or constraints (solnic)
715
782
  - `Default#constrained` will properly wrap a new constrained type (solnic)
716
783
 
717
- ## Changed
784
+ ### Changed
718
785
 
719
786
  - [BREAKING] Renamed `Type#{optional=>maybe}` (AMHOL)
720
787
  - [BREAKING] `Type#optional(other)` builds a sum: `Strict::Nil | other` (AMHOL)
@@ -729,11 +796,11 @@ Major focus of this release is to make complex type composition possible and imp
729
796
 
730
797
  [Compare v0.6.0...v0.7.0](https://github.com/dry-rb/dry-types/compare/v0.6.0...v0.7.0)
731
798
 
732
- # v0.6.0 2016-03-16
799
+ ## 0.6.0 2016-03-16
733
800
 
734
801
  Renamed from `dry-data` to `dry-types` and:
735
802
 
736
- ## Added
803
+ ### Added
737
804
 
738
805
  - `Dry::Types.module` which returns a namespace for inclusion which has all
739
806
  built-in types defined as constants (solnic)
@@ -745,7 +812,7 @@ Renamed from `dry-data` to `dry-types` and:
745
812
  - `Types.register_class` accepts a second arg which is the name of the class'
746
813
  constructor method, defaults to `:new` (solnic)
747
814
 
748
- ## Fixed
815
+ ### Fixed
749
816
 
750
817
  - `Struct` will simply pass-through the input if it is already a struct (solnic)
751
818
  - `default` will raise if a value violates constraints (solnic)
@@ -757,30 +824,37 @@ Renamed from `dry-data` to `dry-types` and:
757
824
  no single primitive for an optional value (solnic)
758
825
  - `Optional` passes-through a value which is already a maybe (solnic)
759
826
 
760
- ## Changed
827
+ ### Changed
761
828
 
762
829
  - `Dry::Types::Definition` is now the base type definition object (solnic)
763
830
  - `Dry::Types::Constructor` is now a type definition with a constructor function (solnic)
764
831
 
765
832
  [Compare v0.5.1...v0.6.0](https://github.com/dry-rb/dry-types/compare/v0.5.1...v0.6.0)
766
833
 
767
- # v0.5.1 2016-01-11
834
+ ## 0.5.1 2016-01-11
835
+
768
836
 
769
- ## Added
837
+ ### Added
770
838
 
771
839
  - `Dry::Data::Type#safe` for types which can skip constructor when primitive does
772
840
  not match input's class (solnic)
773
841
  - `form.array` and `form.hash` safe types (solnic)
774
842
 
843
+
775
844
  [Compare v0.5.0...v0.5.1](https://github.com/dry-rb/dry-types/compare/v0.5.0...v0.5.1)
776
845
 
777
- # v0.5.0 2016-01-11
846
+ ## 0.5.0 2016-01-11
847
+
778
848
 
779
- ## Added
849
+ ### Added
780
850
 
781
851
  - `Type#default` interface for defining a type with a default value (solnic)
782
852
 
783
- ## Changed
853
+ ### Fixed
854
+
855
+ - `attribute` raises proper error when type definition is missing (solnic)
856
+
857
+ ### Changed
784
858
 
785
859
  - [BREAKING] `Dry::Data::Type.new` accepts constructor and _options_ now (solnic)
786
860
  - Renamed `Dry::Data::Type::{Enum,Constrained}` => `Dry::Data::{Enum,Constrained}` (solnic)
@@ -789,60 +863,62 @@ Renamed from `dry-data` to `dry-types` and:
789
863
  - `strict.*` category uses constrained types with `:type?` predicate (solnic)
790
864
  - `SumType#call` no longer needs to rescue from `TypeError` (solnic)
791
865
 
792
- ## Fixed
793
-
794
- - `attribute` raises proper error when type definition is missing (solnic)
795
-
796
866
  [Compare v0.4.2...v0.5.0](https://github.com/dry-rb/dry-types/compare/v0.4.2...v0.5.0)
797
867
 
798
- # v0.4.2 2015-12-27
868
+ ## 0.4.2 2015-12-27
799
869
 
800
- ## Added
870
+
871
+ ### Added
801
872
 
802
873
  - Support for arrays in type compiler (solnic)
803
874
 
804
- ## Changed
875
+ ### Changed
805
876
 
806
877
  - Array member uses type objects now rather than just their constructors (solnic)
807
878
 
808
- [Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-types/compare/v0.4.1...v0.4.2)
879
+ [Compare v0.4.0...v0.4.2](https://github.com/dry-rb/dry-types/compare/v0.4.0...v0.4.2)
880
+
881
+ ## 0.4.0 2015-12-11
809
882
 
810
- # v0.4.0 2015-12-11
811
883
 
812
- ## Added
884
+ ### Added
813
885
 
814
886
  - Support for sum-types with constraint type (solnic)
815
887
  - `Dry::Data::Type#optional` for defining optional types (solnic)
816
888
 
817
- ## Changed
889
+ ### Changed
818
890
 
819
891
  - `Dry::Data['optional']` was **removed** in favor of `Dry::Data::Type#optional` (solnic)
820
892
 
821
893
  [Compare v0.3.2...v0.4.0](https://github.com/dry-rb/dry-types/compare/v0.3.2...v0.4.0)
822
894
 
823
- # v0.3.2 2015-12-10
895
+ ## 0.3.2 2015-12-10
824
896
 
825
- ## Added
897
+
898
+ ### Added
826
899
 
827
900
  - `Dry::Data::Value` which works like a struct but is a value object with equalizer (solnic)
828
901
 
829
- ## Fixed
902
+ ### Fixed
830
903
 
831
904
  - Added missing require for `dry-equalizer` (solnic)
832
905
 
906
+
833
907
  [Compare v0.3.1...v0.3.2](https://github.com/dry-rb/dry-types/compare/v0.3.1...v0.3.2)
834
908
 
835
- # v0.3.1 2015-12-09
909
+ ## 0.3.1 2015-12-09
836
910
 
837
- ## Changed
911
+
912
+ ### Changed
838
913
 
839
914
  - Removed require of constrained type and make it optional (solnic)
840
915
 
841
916
  [Compare v0.3.0...v0.3.1](https://github.com/dry-rb/dry-types/compare/v0.3.0...v0.3.1)
842
917
 
843
- # v0.3.0 2015-12-09
918
+ ## 0.3.0 2015-12-09
919
+
844
920
 
845
- ## Added
921
+ ### Added
846
922
 
847
923
  - `Type#constrained` interface for defining constrained types (solnic)
848
924
  - `Dry::Data` can be configured with a type namespace (solnic)
@@ -850,41 +926,45 @@ Renamed from `dry-data` to `dry-types` and:
850
926
  - `Dry::Data::Type#enum` for defining an enum from a specific type (solnic)
851
927
  - New types: `symbol` and `class` along with their `strict` versions (solnic)
852
928
 
929
+
853
930
  [Compare v0.2.1...v0.3.0](https://github.com/dry-rb/dry-types/compare/v0.2.1...v0.3.0)
854
931
 
855
- # v0.2.1 2015-11-30
932
+ ## 0.2.1 2015-11-30
933
+
856
934
 
857
- ## Added
935
+ ### Added
858
936
 
859
937
  - Type compiler supports nested hashes now (solnic)
860
938
 
861
- ## Fixed
939
+ ### Fixed
862
940
 
863
941
  - `form.bool` sum is using correct right-side `form.false` type (solnic)
864
942
 
865
- ## Changed
943
+ ### Changed
866
944
 
867
945
  - Improved structure of the ast (solnic)
868
946
 
869
947
  [Compare v0.2.0...v0.2.1](https://github.com/dry-rb/dry-types/compare/v0.2.0...v0.2.1)
870
948
 
871
- # v0.2.0 2015-11-29
949
+ ## 0.2.0 2015-11-29
872
950
 
873
- ## Added
951
+
952
+ ### Added
874
953
 
875
954
  - `form.nil` which coerces empty strings to `nil` (solnic)
876
955
  - `bool` sum-type (true | false) (solnic)
877
956
  - Type compiler supports sum-types now (solnic)
878
957
 
879
- ## Changed
958
+ ### Changed
880
959
 
881
960
  - Constructing optional types uses the new `Dry::Data["optional"]` built-in type (solnic)
882
961
 
883
962
  [Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-types/compare/v0.1.0...v0.2.0)
884
963
 
885
- # v0.1.0 2015-11-27
964
+ ## 0.1.0 2015-11-27
965
+
886
966
 
887
- ## Added
967
+ ### Added
888
968
 
889
969
  - `form.*` coercible types (solnic)
890
970
  - `Type::Hash#strict` for defining hashes with a strict schema (solnic)
@@ -893,8 +973,9 @@ Renamed from `dry-data` to `dry-types` and:
893
973
  setting its `.new` method as the constructor (solnic)
894
974
  - `Dry::Data::Compiler` for building a type from a simple ast (solnic)
895
975
 
896
- [Compare v0.0.1...HEAD](https://github.com/dry-rb/dry-types/compare/v0.0.1...HEAD)
897
976
 
898
- # v0.0.1 2015-10-05
977
+ [Compare v0.0.1...v0.1.0](https://github.com/dry-rb/dry-types/compare/v0.0.1...v0.1.0)
978
+
979
+ ## 0.0.1 2015-10-05
899
980
 
900
981
  First public release