Comments (10)
What is dioptional
?
Link points to
lastT :: (Key -> BiToml a) -> Key -> BiToml (Last a)
lastT = Toml.wrapper . Toml.maybeT
the function uses maybeT
self.
from tomland.
@willbasky Sorry, link is wrong. It should be with commit. Look at dimaybeT
. This function should convert BiCodec a
to BiCodec (Maybe a)
from tomland.
This function should convert BiCodec a to BiCodec (Maybe a)
Do you mean TomlCodec a -> TomlCodec (Maybe a)
?
as it is in maybeT :: forall a . (Key -> TomlCodec a) -> Key -> TomlCodec (Maybe a)
from tomland.
And why change maybeT
with dimaybeT
?
from tomland.
Do you mean TomlCodec a -> TomlCodec (Maybe a)?
No, this function should be general and work for BiCodec
Line 47 in d1720a0
And why change maybeT with dimaybeT?
maybeT
is wrong an it often happens that maybeT
doesn't work as expected. So maybeT
should be removed. So I want to have something like optional
for Alternative
for our our Codec
. Unfortunately, optional
for Codec
works in the following way:
optional :: Codec r w a b -> Codec r w a (Maybe b)`
while I want:
dioptional :: Codec r w a b -> Codec r w (Maybe a) (Maybe b)
If you can write dioptional
for Codec
instead of BiCodec
, it would be even better 👍
from tomland.
How does it possible, on Hackage and on Github?
from tomland.
type TomlCodec a = BiCodec Env St a
is the same with type BiToml a = Bi Env St a
?
from tomland.
@willbasky Yeah, types were renamed in some recent PR. And the new version is not on Hackage yet.
from tomland.
Does dimaybeT
something like workaround now?
from tomland.
Yes, it is. After dioptional
is implemented in tomland
, it will replace dimaybeT
in summoner
from tomland.
Related Issues (20)
- Property-based tests generate invalid TOML keys occasionally HOT 3
- Profunctor of `Codec` can use some generalization. HOT 1
- Arrays of Arrays of Tables
- Failing build on Hackage HOT 2
- Compatibility with GHC 9.2 HOT 1
- change the key of a codec
- Test failure in test/Test/Toml/Codec/Combinator/Common.hs:39:5
- Top-level Tables HOT 3
- Compatibility with mtl-2.3 HOT 2
- Encodes unicode characters with double backslash
- How to parse a primitive type to a more constrained type? e.g. how to parse an 'IP' from a text field? HOT 5
- Compatibility with GHC 9.4 HOT 5
- Prepare release 1.3.3.2
- Support GHC 9.6 HOT 2
- Please make Hackage revision HOT 3
- Generic codec for Map should accept tables
- Wrong parsing of quotes
- Bump time dependency to < 1.15 HOT 2
- Dynamic Keys into `Map Text X` by
- Add to stackage? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tomland.