-
Notifications
You must be signed in to change notification settings - Fork 8
/
Changes
415 lines (237 loc) · 12.2 KB
/
Changes
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
{{$NEXT}}
0.48 2022-06-11
- Importing types into a class which inherited from another class that had
imported types wouldn't work, leaving the child class with no `t()`
sub. Patch by Kerin Millar.
0.47 2021-01-29
- Change Specio constraint object's stringification overloading to return the
type name rather than the default Perl object stringification, which gives
you something like
"Specio::Constraint::Parameterized=HASH(0x564d258efb48)". Anonymous types
are special cased to return something you can print.
- All types now overload the `eq` comparison operator. Moose expects types to
be comparable in this manner when doing role summation. This fixes a bug
reported by Martin Gruner. GH #18.
0.46 2020-03-14
- No code changes, just fixing a mistake in the POD. Reported by Petr
Pisar. GH #17.
0.45 2019-11-24
- Made XString a prereq if installing with Perl 5.10+.
0.44 2019-08-14
- Replaced the use of B with XString if it is installed. The latter is much
smaller and provides the one subroutine from B we cared about. Based on GH
#15. Implemented by Nicolas R.
0.43 2018-10-26
- Optimized compile-time operations to make Specio itself quicker to
load. Specio's load time is a non-trivial part of the load time of DateTime
(and presumably other things that use it). Based on
https://github.com/houseabsolute/DateTime.pm/issues/85. Reported by
versable.
0.42 2017-11-04
- The Perl library claimed it provided types named LaxVersionStr and
StrictVersionStr but they were really named LaxVersion and
StrictVersion. The names have now been fixed to match the documentation, so
they are LaxVersionStr and StrictVersionStr.
0.41 2017-11-04
- Fixed checks for whether a class is loaded in light of upcoming optimization
in Perl 5.28. Fixed by Sprout (GH #12).
0.40 2017-08-03
- Fixed more bugs with {any,object}_{can,does,isa}_type. When passed a glob
(not a globref) they would die in their type check. On Perl 5.16 or earlier,
passing a number to an any_* type would also die.
- Fixed subification overloading. If Sub::Quote was loaded, this would be
used, but any environment variables needed for the closure would not be
included. This broke enums, among other things.
0.39 2017-08-02
- Many bug fixes and improves to the types created by
{any,object}_{can,does,isa}_type. In some cases, an invalid value could
cause an exception in type check itself. In other cases, a value which
failed a type check would cause an exception when generating a message
describing the failure. These cases have all been fixed.
- The messages describing a failure for all of these types have been improved.
- You can now create anonymous *_does and *_isa types using the exports from
Specio::Declare.
0.38 2017-07-01
- Simplify checks for overloading to not call overload::Overloaded(). Just
checking the return value of overload::Method() is sufficient.
0.37 2017-05-09
- Possible fix for very weird failures seen under threaded Perls with some
modules that use Specio.
0.36 2017-02-19
- Inlined coercions would attempt to coerce for every type which matched the
value given, instead of stopping after the first type. Fixed by Graham Knop
(GH #11).
- Inlined coercions did not include the inline environment variables needed by
the type from which the coercion was being performed. Fixed by Graham Knop
(GH #8).
- When you use the same type repeatedly as coderef (for example, as a
constraint with Moo), it will only generated its subified form once, rather
than regenerating it each time it is de-referenced.
- Added an API to Specio::Subs to allow you to combine type libraries and
helper subs in one package for exporting. See the Specio::Exporter docs for
more details.
0.35 2017-02-12
- Added Specio::Subs, a module which allows you to turn one or more library's
types into subroutines like is_Int() and to_Int().
- Added an inline_coercion method to Specio constraints.
0.34 2017-01-29
- Packages with Specio::Exporter as their parent can now specify additional
arbitrary subs to exporter. See the Specio::Exporter docs for details.
- Importing the same library twice in a given package would throw an
exception. The second attempt to import is now ignored.
- Added an alpha implementation of structured types. See
Specio::Library::Structured for details.
0.33 2017-01-24
- Fixed a mistake in the SYNOPSIS for Specio::Declare. The example for the
*_isa_type helpers was not correct.
- Removed the alpha warning from the docs. This is being used by enough of my
modules on CPAN that I don't plan on doing any big breaking changes without
a deprecation first.
0.32 2017-01-12
- Fixed a bug in the inlining for types create by any_can_type() and
object_can_type(). This inlining mostly worked by accident because of some
List::Util XS magic, but this broke under the debugger. Reported by
Christian Walde (GH #6) and Chan Wilson
(https://github.com/houseabsolute/DateTime.pm/issues/49).
0.31 2016-11-05
- The stack trace contained by Specio::Exception objects no longer includes a
stack frames for the Specio::Exception package.
- Made the inline_environment() and description() methods public on type and
coercion objects.
0.30 2016-10-15
- Fix a bug with the Sub::Quoted sub returned by $type->coercion_sub. If a
type had more than one coercion, the generated sub could end up coercing the
value to undef some of the time. Depending on hash key ordering, this could
end up being a heisenbug that only occured some of the time.
0.29 2016-10-09
- Doc Specio::PartialDump because you may want to use it as part of the
failure message generation code for a type.
0.28 2016-10-02
- Added a Test::Specio module to provide helpers for testing Specio libraries.
- Fixed another bug with a subtype of special types and inlining.
0.27 2016-10-01
- Cloning a type with coercions defined on it would cause an exception.
- Creating a subtype of a special type created by *_isa_type, *_can_type, or
*_does_type, or enum would die when trying to inline the type constraint.
- Removed the never-documented Any type.
- Added documentation for each type in Specio::Library::Builtins.
0.26 2016-09-24
- Require Role::Tiny 1.003003. This should fix the test failures some
CPANTesters reported with this error:
Can't resolve method "???" overloading "&{}" in package
"Specio::Constraint::Simple" at Specio::Constraint::Simple->new line 35.
0.25 2016-09-04
- Calling {any,object}_{isa,does}_type repeatedly in a package with the same
class or role name would die. These subs are now special-cased to simply
return an existing type for the given name when they receive a single
argument (the name of the class or role). This could come up if you had two
attributes both of which required an object of the same type.
0.24 2016-06-20
- Fix a bizarre failure on Perl before 5.14. AFAICT this was a test problem,
not a library problem.
0.23 2016-06-20
- Added intersection types.
0.22 2016-06-18
- Require version.pm 0.83. I know 0.77 doesn't work but I'm not sure exactly
which version fixed the problem, since I cannot install older
versions. Reported by Slaven Rezic. RT #115418.
0.21 2016-06-18
- Don't load Sub::Quote, but use it if it's already loaded. Since Moo uses it,
this should make Specio constraints just work with Moo.
0.20 2016-06-18
- Removed test dependency on namespace::autoclean.
0.19 2016-06-17
- Removed dependency on Devel::PartialDump by making a copy of just the bits
we need. Gross but effective.
0.18 2016-06-15
- Added union types.
- If a subtype's parent could be inlined and the subtype itself did not
specify any additional constraints (inlinable or not), then the subtype was
not being inlined, even though it could be.
- This distro now works with Perl 5.8 (though it was only tested with 5.8.8).
0.17 2016-06-01
- Change "use v5.10" to "use 5.010". The former appears to cause warnings on
older Perls.
0.16 2016-05-30
- Remove use of Class::Load and Module::Runtime.
0.15 2016-05-30
- The Num and Int type now accepts numbers in scientific notation such as 1e10
or -1.2e-5.
- Removed various prereqs that weren't really needed.
- Added three new libraries, Specio::Library::String, ::Numeric, and
::Perl. These provide additional commonly used string and numeric types, as
well as some types related to Perl syntax.
0.14 2016-05-22
- Added an inline_assert method for constraint objects. This makes certain
types of inlining tasks easier.
- Parameterized constraint objects now have a default name based on the parent
type and contained type.
- Rewrote the code used for inlined types so that the generated inline code is
optimized to check the most common cases first.
- Fixed a bug where two enum types could not be inlined together in the same
sub.
0.13 2016-05-15
- Parameterizing a type which generated inline parameterized constraints (like
the ArrayRef and HashRef builtins) now dies if given a parameter which
cannot itself be inlined. Mixing inlinable and non-inlinable constraints
previously caused very confusing errors.
0.12 2015-12-19
- Fixed tests that failed if Moose wasn't installed. Reported by Karen
Etheridge. RT #109247.
0.11 2014-05-27
- Remove a Perl 5.14-ism.
0.10 2014-05-26
- Added Class::Method::Modifiers to prereqs.
- Made Specio classes faster by inlining all accessors and constructors.
- Added support for Moo. Specio constraints now overloading sub-ification so
you can pass them as "isa" values for Moo attributes. Also added a new
$type->coercion_sub() method which returns a sub ref suitable for the
"coerce" value. These all use Sub::Quote so that the returned sub refs can
be inlined.
0.09 2014-05-25
- Reimplemented entirely without Moose. This module now implements its own
half-assed (really, more like eighth-assed) OO system.
* TODO: Integrate cleanly with Moo and Moose.
* TODO: Improve the internal OO system to do some eighth-assed inlining so
creating type objects is faster.
0.08 2013-06-08
- Removed the use of the encoding pragma from the tests. This pragma is
deprecated in 5.18.
0.07 2013-03-03
- Disabled the tests that rely on an as-yet-unreleased Moose. These were
mostly disabled but some cpan testers boxes were set up in a way that made
them run.
0.06 2013-03-02
- Renamed Type to Specio.
0.05 2012-10-14
- This module didn't really need XS. It turns out that 5.10 added
re::is_regexp() so we can use that instead. Thanks to Jesse Luehrs for
pointing this out.
0.04 2012-09-30
- Added any_does_type and object_does_type declaration helpers. These check
whether a class and/or object does a given role. They work with Moose,
Mouse, and Role::Tiny.
- Fixed implementation of any_isa_type and object_isa_type to match docs. If
given more than one argument, the docs said they expected named parameters
but internally the code expected positional parameters.
0.03 2012-09-30
- Various hacks to make Specio::Constraint objects play nice with Moose. Needs
changes to Moose to work properly, however.
- The message generator sub is no longer called as a method. It is called as a
sub so it doesn't receive the type as an argument.
- The inline environment variable names used for each type are now
unique. This means that types will not step on each other if you want to
inline more than one type check in the same scope.
- Non-inlined type coercions were completely broken.
- Added $type->is_same_type_as and $type->is_a_type_of methods.
- The Maybe type was a subtype of Ref in the code, which is wrong. It is now a
subtype of Item.
- This module now explicitly requires Perl 5.10.
0.02 2012-05-14
- Now with lots more documentation, but this is still very alpha. Feedback
from potential users is welcome.
0.01 2012-05-13
- First release upon an unsuspecting world. This is very alpha and subject to
change. I'm mostly releasing it to get some feedback on the design. Do not
use this in your code yet, unless you promise not to complain about the lack
of docs or the fact that the next release breaks your code.