package travesty
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=be89ec1c96fedcc47362568b359aa6b8d3fefb8b86f70133dd1a75ca72476807
sha512=19616b0a5fddd5725fdf7ab160e9f89d243f0dbaaaf53ba455bfbac2790cb07811862ecc5ada81be35a06869a987dcc149f24a7e84f461222216d45fe0036ca2
doc/CHANGES.html
v0.6.2 (2020-04-02)
Minor release with one new feature.
- Can now build with OCaml v4.10
- New feature: Traversable.Const, an implementation of a traversal that type-checks, but does nothing.
v0.6.1 (2019-11-27)
Minor release cut to relax various dependency pain-points caused by the last release being more than 4 months ago. (I intend to make a major release in the near future with a migration from monads to applicative functors, but this depends on enough free time being available.)
- Travesty now expects Dune 2.0 to build. This is technically a breaking change, but I felt that bumping to 0.7 at this stage of Travesty's lifecycle would give the wrong impression.
- Travesty now lets itself be built with v0.13 of the Jane Street packages.
- Travesty now lets itself be built with OCaml v4.09.
- Minor code formatting changes.
v0.6.0 (2019-06-25)
Major release with various breaking changes and new features, the main one being bi-traversables.
Breaking changes
- Most module signatures have moved from
XYZtoXYZ_types. For example,Bi_mappable.S2is nowBi_mappable_types.S2. This is to eliminate the 'intf pattern' previously used in Travesty. - Removed
Travesty_core_kernel_exts. UseTravesty_base_extsinstead. - Made
Bi_mappable.Make2's return module type use sharing constraints instead of destructive substitutions. This may cause shadowing where there previously wasn't any.
Bi_traversable
This release adds a Bi_traversable module---effectively being to Traversable as Bi_mappable is to Mappable.
Alist, Tuple2, and Or_error now expose Bi_traversable.S2, which subsumes their previous interface.
Biffs
This release also adds the ability to compose Mappables on the inside of Bi_mappables (and Traversables on the inside of Bi_traversables): what is often referred to as a 'biff' in the quirky world of Haskell. This complements the ability to compose them on the outside (a 'tannen').
Minor improvements
- Removed spurious dependencies that caused travesty to be unavailable on OCaml 4.08.
Bi_mappablearity-1 chaining functors now carry previously-missing sharing constraints equating their fixed types with those of their bi-mappable ancestor.- Added experimental F#-style
>>operator inTravesty_base_exts.Fn.Compose_syntax. - Added bi-traversable instance for
Result, from whichOr_errornow inherits.
v0.5.1 (2019-05-10)
As is becoming tradition, fixes a minor documentation comment caught between tagging on GitHub and publishing on OPAM. See the main changelog for details about what changed in v0.5.0.
v0.5.0 (2019-05-10)
Major release with new features and breaking changes, especially to module names and structures.
Breaking changes
See also the changes for v0.4.x, as that version didn't reach OPAM.
Extension modules
In a partial reversal of changes done in v0.4.x, the Travesty_base_exts and Travesty_core_kernel_exts modules no longer re-export the Base and Core_kernel modules on which they are based.
This means that any code using these extensions will need to open both original and extension modules (for example, by opening Travesty_base_exts as Tx and using Tx.List when Travesty extensions are needed.
This change avoids a large amount of coupling, inefficiency, and possible legal issues caused by including swathes of third party libraries.
Traversable module renaming
The functors, and signatures in Traversable have been renamed drastically to make them more consistent, and provide a better distinction between 'in-monad' and 'out-of-monad' signatures:
SXis nowBasicX_on_monad, to reflect that it only refers to the basic innerOn_monadpart of a traversable;Genericis nowGeneric_basic_on_monad, as per the above;On_monad1is nowS1_on_monad. There is noS0_on_monadyet, but this may change.SX_containeris now justSX, as it forms the main output of theTraversablefunctors;GenericX_containeris now justGenericX, to follow suit;BasicXis unchanged;Basic_containerXis nowBasicX_container;Extend_containerXis nowMakeX_container(as it makes anSXfrom aBasicX_container);Make_containerXis nowMakeX(as it transforms aBasicX).
### Bi_mappable module renaming
Similarly, Bi_mappable's functors and signatures have been renamed:
SX_with_extensionsis now justSX;- The various
Extensionsmodules no longer exist; - The
Extendfunctors are nowMakefunctors.
Other
Traversable.S1no longer carriesWith_elt. This is now a separate functor inTraversablecalledFix_elt.- The various
Bi_mappable.Extensionssignatures no longer carryFix_left,Fix_right,Map_left, andMap_right. These are now separate functors, and don't apply the extensions by default. - See
when_mandunless_mbelow: these now have an optional argument, which may cause breakage in rare situations. - Various modules and functor targets that previously substituted destructively now output sharing constraints. This means that, this side of OCaml 4.08, you may need to wrap some functor results in a
module type of X with type t := tstanza. This is to make it easier to chain together such modules.
New features
Bi_mappable
- New functors for fixing left and right types, as well as converting bi-mappables to mappables by focusing on one type. These replace the modules previously generated by
Bi_mappable.Extensions. - Added several more composition functors.
- Conversion functors no longer destructively substitute.
Extended Option
- Now includes
Monad_exts.
Extended Or_error
- Now a bi-mappable type.
Monad_exts
M.when_mandM.unless_mnow take an optional parameter?otherwise, which allows generalising the application ofM.returnwhen the condition doesn't hold.- New functions
M.map_when_mandM.map_unless_m, which generalisewhen_mandunless_mto take an arbitrary'a(and pass it to~f). - New functions
then_mand>>, which act as Haskell's>>(then) operator. - New functions
compose_mand>=>, which act as Haskell's>=>(Kleisli composition) operator.
v0.4.1 (2019-05-07)
Minor documentation fixup release. No other changes since v0.4.0. (Not released on OPAM.)
v0.4.0 (2019-05-07)
Major release with incompatible name and library division changes. (Not released on OPAM.)
Breaking changes
The main change in this release is that all 'extension' modules (T_xyz) have been renamed or moved into subpackages of Travesty:
Singletonnow lives inTravesty_containers.T_monadandT_containerhave changed toMonad_extsandContainer_exts;- Every other
T_module now lives in eitherTravesty_base_extsorTravesty_core_kernel_exts, and no longer has theT_suffix. - Modules in
Base_extsdepend on, and extend, theBaseversion of their namesake module. - Modules in
Core_kernel_extsdepend on, and extend, theCore_kernelversion of their namesake module. Usually, they do so by importing the extensions from theBase_extsversion on top of an import of theCore_kernelbaseline module.
Other breaking changes:
Fn.onnow takes its second argument with the label~f.
New features
This release contains a large amount of 'small' new features. Most of these are of minor extensions and convenience functions on top of Base and Core_kernel
- Submodule split: Travesty-unique containers are now in
Travesty_containers(dune:travesty.containers); extensions to Base containers are inTravesty_base_exts(travesty.base_exts); similar extensions to Core_kernel containers are inTravesty_core_kernel_exts. - Add
Monad_exts.tee, which is a counterpart totee_mthat accepts a non-monadic function. (This is somewhat less useful, but still helps in terms of slotting, say, debug printing into a monadic pipeline.) - Extensions: add
Or_error.combine_map[_unit], which are shorthand for mapping followed bycombine_errors[_unit]. These should be used instead ofmap_manditer_mwhen using lists andOr_error. - Extensions: add
Tuple2, an extendedCore_kernel.Tuple2adding bi-mappability. - Add chaining for arity-2 bi-mappable containers across arity-1 mappable containers. We now implement
Alist's bi-mappable interface using this andTuple2. Fn: addalways, which behaves likeconst true; andnever, which behaves asconst false.Alist: addcompose, which is the relational composition on two associative lists.Travesty_containers.Zipper: implementations of list zippers (imported fromact, and subject to change).Listextensions: addedWith_errors.replace_m,replace, andinsertfunctions (imported fromact, and subject to change). Future versions may generalisereplace_mto act on any monad.List.Associn the extension modules is now an alias forAlist, bringing the bifunctor extensions into scope there.
Other
Bi_mappable:Fix_leftandFix_right's signatures no longer destructively substitutet, soAlist.Fix_left(String).tshould now work.
v0.3.0 (2019-03-03)
Major release with incompatible dependency and name changes.
Breaking changes
- Now targeting v0.12 of Jane Street's upstream libraries. This release of travesty no longer supports v0.11.
- As a result, travesty no longer supports OCaml 4.06; please use 4.07+.
- Traversable signature names have changed:
Basic_container0is nowBasic0, andBasic_container1is nowBasic1. The original names are now used for stronger interfaces that include implementations ofContainer.S*; see 'new features' below for information.
New features
- Add
T_container.Extensions0andExtend0, which generalise most ofExtensions1/Extend1to arity-0 containers. - Generalise
T_container's predicate extensions (any/all/none) over arity-0 containers, provided that theireltisx -> boolfor somex. - Add
Bi_mappable, an implementation of bifunctors. - Add
T_alist, an extended form ofList.Assoc. - Split the Traversable container functors into two kinds: the
Make_container*functors now takeBasic*signatures (but are otherwise the same---they still produce their ownContainer.S*instances); the newExtend_container*functors take the now-strongerBasic_container*signatures, which include custom implementations ofContainer.S*, and use those instead. The idea is thatMakeis for building new containers from traversals, andExtendis for adding traversals to existing containers.
Other
T_listandT_optionnow useExtend_container1internally: the upshot of this is that they re-use the existing Core implementations of container operations where possible, rather than (slowly) re-building them usingfold_m.
v0.2.0 (2018-12-23)
Major release.
Breaking changes
- Potentially breaking change:
Traversable.S0_containernow containsmodule Elt : Equal.S, and constrainstype eltto be equal toElt.t. This reflects the situation inBasic_container0, and shouldn't break any code usingMake_container0, but may cause custom-built modules to fail to type-check. T_container.any's arguments have swapped order, to be more in line withCoreidioms.
New features
- Add
Traversable.Chain0, a functor for combining twoS0_containerinstances together for nested traversal. - Add
T_fn.disjto go withT_fn.conj. - Add
Filter_mappable, which generalisesList.filter_map. - Add
tee_mto monad extensions. This is a small wrapper overf x >>| fun () -> xthat allows unit-returning monadic side-effects to be treated as part of a monad pipeline. - Add
T_or_error: monad extensions forCore.Or_error. oneandtwoare now implemented onT_container, not justT_list. The errors are slightly less precise, but otherwise nothing has changed.- Add
T_container.at_most_oneto complementoneandtwo. - Add
Monad.To_mappable, which makes sure that monads can be converted to mappables. - Add
T_container.allandnone, to complementany.
Other
- Improve API documentation.
v0.1.3 (2018-12-13)
Bugfix release.
- Fix incorrect module name (was
Lib, notTravesty). - Restrict to OCaml v4.06+ (this was the case in the final v0.1.2 OPAM release, but not upstream).
v0.1.2 (2018-12-12)
Bugfix and minor improvement release.
- Improve API documentation.
- Move functors and concrete modules out of
Intffiles. - Generally rationalise the interface ready for a public release.
- Add various container modules from
act:Singleton,T_list, andT_option.
v0.1.1 (2018-12-10)
Bugfix release.
- Move API documentation, in an attempt to get
dune-releaseto work.
v0.1 (2018-12-10)
Initial release.
Existing functionality migrated from act's utils directory.