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
Hi! I'd like to know what is the proper way to group multiple independent env vars prefixed with a component name into a Haskell component structure that represent the component as a whole? Basically I want these vars
DB_NAME=
DB_PORT=
to be mapped into a single data DbSettings ..., so that DbSettings itself can be used in larger env var parsers like:
data AppSettings = AppSettings
{ something :: Text
, dbSettings :: DbSettings
}
Normally, I'd first define an instance of Var a, but fromVar is only provided with a single variable, not a set of items. Does it mean that I should omit declaring instances for Var a and proceed with manual parsing inside instances of FromEnv a?
The text was updated successfully, but these errors were encountered:
Hi! I'd like to know what is the proper way to group multiple independent env vars prefixed with a component name into a Haskell component structure that represent the component as a whole? Basically I want these vars
to be mapped into a single
data DbSettings ...
, so thatDbSettings
itself can be used in larger env var parsers like:Normally, I'd first define an instance of
Var a
, butfromVar
is only provided with a single variable, not a set of items. Does it mean that I should omit declaring instances forVar a
and proceed with manual parsing inside instances ofFromEnv a
?The text was updated successfully, but these errors were encountered: