Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information