-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defaultInterpretOptions is not inherited from parent record #33
Comments
@Gabriel439 Thanks for the quick fix ! Works like a charm. |
@Gabriel439 I am now using a list and it doesn't bubble down ...
|
Gabriella439
added a commit
that referenced
this issue
Mar 27, 2017
Consider the following Haskell program: ``` {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} import Dhall hiding (auto) import qualified Data.Text.Lazy interpretOptions :: InterpretOptions interpretOptions = defaultInterpretOptions { fieldModifier = Data.Text.Lazy.dropWhile (== '_') } data GitRepo = GitRepo { _host :: Text , _repo :: Text } deriving (Generic, Interpret, Show) data BoxConfig = BoxConfig { _userName :: Text , _dotfilesRepo :: Vector GitRepo } deriving (Generic, Interpret, Show) main :: IO () main = do x <- Dhall.input (autoWith interpretOptions) "./config" print (x :: BoxConfig) ``` Before this change the above program attempts to decode a value of type: ``` { userName : Text, dotfilesRepo : List { _host : Text, _repo : Text } } ``` ... when it should be decoding a value of type: ``` { userName : Text, dotfilesRepo : List { host : Text, repo : Text } } ``` This change ensures that `InterpretOptions` correctly propagate to elements of `List` or `Optional` values
Latter issue fixed by e7e799f |
Thanks for the quick fix ! |
You're welcome! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given this code:
It will force me to have this config file:
but I wish to have
The text was updated successfully, but these errors were encountered: