Giter VIP home page Giter VIP logo

Comments (10)

willbasky avatar willbasky commented on June 15, 2024

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.

chshersh avatar chshersh commented on June 15, 2024

@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.

willbasky avatar willbasky commented on June 15, 2024

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.

willbasky avatar willbasky commented on June 15, 2024

And why change maybeT with dimaybeT?

from tomland.

chshersh avatar chshersh commented on June 15, 2024

Do you mean TomlCodec a -> TomlCodec (Maybe a)?

No, this function should be general and work for BiCodec

type BiCodec r w a = Codec r w a a

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.

willbasky avatar willbasky commented on June 15, 2024

How does it possible, on Hackage and on Github?

from tomland.

willbasky avatar willbasky commented on June 15, 2024

type TomlCodec a = BiCodec Env St a is the same with type BiToml a = Bi Env St a?

from tomland.

chshersh avatar chshersh commented on June 15, 2024

@willbasky Yeah, types were renamed in some recent PR. And the new version is not on Hackage yet.

from tomland.

willbasky avatar willbasky commented on June 15, 2024

Does dimaybeT something like workaround now?

from tomland.

chshersh avatar chshersh commented on June 15, 2024

Yes, it is. After dioptional is implemented in tomland, it will replace dimaybeT in summoner

from tomland.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.