Releases: Symbolica/Symbolica.Extensions.Configuration.FSharp
Releases · Symbolica/Symbolica.Extensions.Configuration.FSharp
0.4.0
Breaking Changes
There have been quite a few cosmetic changes to the public API in this release. In 0.3.0 the Api module was auto opened, but this is no longer the case and instead most things are now located in the Bind module. So by and large most changes can be fixed be adding Bind. to the front of the function call. For example section -> Bind.section. A summary of the crucial breaking changes are listed below:
BindResulthas been made generic on the error type.- The error type in the top level API is now long
string list, but instead a customErrortype. This is to facilitate applicative and alternative accumulation of errors, as well as making the errors easier to compose and more descriptive. Binderhas been made completely generic.- The
Decodertype has been removed and everything is aBindernow, just with different input types. - The
Decodemodule is gone and these functions are now in theBindmodule. valueOfhas been removed.Bind.valueAttakes its place and even if the value being bound is a string it must still be specified withBind.string. For exampleBind.valueAt "key" Bind.string. This helps to unify the API by not treating string binding as a special case.
API Translation from 0.3.0
The following is a list of the most common translations from the code in 0.3.0 to the equivalent in 0.4.0:
section->Bind.sectionoptSection->Bind.optSectionvalue "key"->Bind.valueAt "key" Bind.stringvalueOf Decode.bool "key"->Bind.valueAt "key" Bind.booloptValue "key"->Bind.optValueAt "key" Bind.stringoptValueOf Decode.bool "key"->Bind.optValueAt "key" Bind.bool
New Additions
- A custom
Errortype. Error messages can be still be obtained at the top level by callingToString()on anErrorinstance. - The
Bindmodule. - The following new functions have been added to the
BindResultmodule.altgetOrFailofResultmapFailuretraverseOptsequenceOpttraverseListsequenceList
- The following new functions have been added to the
Bindermodule.askaltcontramapmapFailuretraverseOptsequenceOpttraverseListsequenceList
Full Changelog: 0.3.0...0.4.0
0.3.0
0.2.0
Breaking Changes
sectionandoptSectionare no longer computation expressions. They are now combinator functions that allow the binding of child sections to be nested under require and optional parent sections respectively. A newbindCE takes their place for performing the binding of individual values. The crucial difference is thatbindimplicitly operates at the same level of theIConfigurationthat it is fed. This means that it's now possible to write a singlebindCE for a type and then reuse it in either an optional or required section. See the example in the README for more details.