All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to the Haskell Package Versioning Policy.
Weaken
instances forSizeGreaterThan
,SizeLessThan
.weakenAndLeft
,weakenAndRight
,weakenOrLeft
,weakenOrRight
type inference helper functions.
- bump
base
: "< 4.18" -> "< 4.19" - bump
mtl
: "< 2.3" -> "< 2.4" - bump
template-haskell
: "< 2.20" -> "< 2.21"
- on GHC >=9, make
refineTH
andrefineTH_
work in any monad(Quote m, MonadFail m)
. - bump
base
: "< 4.17" -> "< 4.18" - bump
template-haskell
: "< 2.19" -> "< 2.20" - bump
aeson
: "< 2.1" -> "< 2.2"
- make
Refined
predicate typep
kind polymorphic (p :: Type
->p :: k
)
Hashable
instance forRefined
FromJSONKey
instance forRefined
ToJSONKey
instance forRefined
shrink
forRefined
'sArbitrary
instance.refineEither
function
- improved efficiency of
strengthen
- bump multiple dependency upper bounds
strengthen
no longer returns anEither
, since the proof that it should always succeed is in its constraints.- correct
success
documentation
- upper bound on QuickCheck: <2.14 -> <2.15
validate
now takes aProxy
as its first argument.- All uses of prettyprinter are now just
Text
- Refined.These module
- Dependency on
prettyprinter
- bug in
sized
internal helper that caused formatting issues in sized predicate errors
refineTH_
is now implemented in terms ofrefineTH
- Fix pretty-printing of
RefineException
s during compile-time
- sized Predicate instances for
Text
- sized Predicate instances for strict and lazy
ByteString
- INLINABLE pragmas on
refine_
reifyPredicate
NFData
instance forRefined
- RefineSomeException constructor. Enables recovering specific validation exceptions. Thanks to @haroldcarr for adding this.
- RefineXorException constructor.
Empty
andNotEmpty
predicates.NaN
andInfinite
predicates for floating-point numbers.- @since pragmas to EVERYTHING.
- lower bound on mtl to 2.2.2 due to use of liftEither. Thanks to @k0ral for reporting this
- Generalize sized predicates
- Allow newer template-haskell (< 0.16 ==> < 0.17)
- Allow newer aeson (< 1.5 ==> < 1.6) Thanks to @locallycompact for this change.
Refined.Internal
module Thanks to @nikita-volkov for pushing me to do this.- Orphan modules Thanks to @symbiont-sam-halliday for pointing out the silliness of these modules.
RefineT
. It was a needless abstraction that just made the library harder to learn and use, providing little benefit overMaybe RefineException
. Thanks to @nikita-volkov for helping me see the light.
- Refined.These module in favour of Data.These from these-skinny
refine_
refineTH_
- test suite: unit tests for compiling.
- Allow newer
template-haskell
andQuickCheck
.
reifyPredicate
Arbitrary
instance forRefined
should now always terminate. Thanks to @symbiont-joseph-kachmar for reporting this.
exceptRefine
,strengthen
, andstrengthenM
- Documentation fix for
DivisibleBy
- Re-export
DivisibleBy
,Even
, andOdd
from moduleRefined
. - Re-export all constructors from module
Refined
.
- Re-removed dependency of
these
package.
Even
,Odd
, andDivisibleBy
predicates.- doctests for all predicates.
- Make all predicates unary data constructors, instead of nullary, and export those newly added constructors.
- Serious regression where
Not p
~p
. Thanks to @k0ral who reported this.
- 'NegativeFromTo', a Predicate that ensures a numeric value is within a range [a,b], where a < 0 and b >= a. Thanks to github.com/futtetennista for this change.
RefinedNotException
now has a child (it should have had one in v2. This was an oversight.)displayRefineException
no longer uses tabs, instead 2 spaces.- make implementation of
displayRefineException
more clear via formatting.
- Internal module, and Unsafe modules, making sure to take care w.r.t. the scope of coercions related to the use of the 'Refined' constructor.
- 'IdPred' predicate, predicate that never fails.
- Generic instances for all predicates.
reallyUnsafeRefine
,reallyUnsafeUnderlyingRefined
,reallyUnsafeAllUnderlyingRefined
, functions that allow one to use 'Coercion's to manually prove things about 'Refined' values.
- Type role of Refined from 'phantom Representational' to 'nominal nominal'.
With the old type role, one can use
coerce
to proveQ x
given anyP x
. The second parameter should also be nominal because of interactions with something likeGreaterThan
andData.Ord.Down
. Thanks to David Feuer for pointing this out. - Change docs to point users to 'Refined.Unsafe' module instead of recommending 'Unsafe.Coerce.unsafeCoerce'.
- 'Ascending' and 'Descending' predicates now use 'Foldable' instead of 'IsList'.
- Lowered the lower bound on 'exceptions'; it was too strict for the support window.
- Dependency of the 'these' package. It brings in some very
heavy transitive dependencies, even though the datatype
in
refined
is used to the most minimal extent. This is a breaking change because this change is exposed to the end user via 'RefineAndException'. It is exported from a module called 'Refined.These'. Users wishing to interact with such exceptions can either just use the datatype constituting a minimal API there, or depend on the 'these' package.
- back in the 'Foldable' instance for 'Refined'. It is safe.
- Unsafe typeclass instances that could break the 'Refined' invariant. These should not have been added.
- Unsafe typeclass instances that could break the 'Refined' invariant. These should not have been added.
- Radical rewrite of the library, centred around 'RefineException' and the 'RefineT' monad transformer. 'validate' now has the type signature validate :: (Predicate p x, Monad m) => p -> x -> RefineT m ()
- More predicates