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
A generic method to call in cases where the type is known to the compiler already, perhaps called simply query or perhaps even an operator. Also, it should have the Toml document as it's first argument for easy currying. (in fact, not sure why I put the Toml argument second everywhere... perhaps consistency with Data.Map?)
query :: Toml -> TomlPath -> Maybe a
And also one that has a default value provided:
queryDef :: Toml -> a -> TomlPath -> a
Then users can do something like:
let webserverASection = queryDef config Toml.empty "webservers.serverA"
let webserverSocket = queryDef webserverASection 8080 "port"
The text was updated successfully, but these errors were encountered:
clord
changed the title
Type-generic versions of lookupStr, etc
Type-generic versions of lookupStr, together with lenses
Apr 15, 2016
A generic method to call in cases where the type is known to the compiler already, perhaps called simply
query
or perhaps even an operator. Also, it should have theToml
document as it's first argument for easy currying. (in fact, not sure why I put theToml
argument second everywhere... perhaps consistency withData.Map
?)And also one that has a default value provided:
Then users can do something like:
The text was updated successfully, but these errors were encountered: