You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@vrom911 That's an excellent idea! I think we should try to implement generalised combinator since it will be the most useful and composable. First idea is something like:
validate:: (a->Bool) ->Key->TomlCodeca
or we can use Either Text ... instead of Bool to give an ability to provide better custom errors. But the most general form probably should be somehow be a more polymorphic version of the _TextBy combinator, but it's not clear immediately how to do this, need to think more...
Sometimes you need something to be valid only if satisfy the predicate. It would be nice to have such a function in
tomland
.Recently I've done the one for
Text
usingtextBy
function:https://github.com/kowainik/summoner/blob/2ce94372c0bccaf4adf377814324f6d4fd751366/summoner-cli/src/Summoner/CustomPrelude.hs#L23-L32
However, I don't really see how this could be generalised. Do you have any idea? And do you think that this is generally useful for the library?
The text was updated successfully, but these errors were encountered: