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
The basic idea is that InterpretOptions are no longer applied globally but are now specified on a type-by-type basis, so the way you would fix your example is to do this:
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
moduleMainwhereimportDhallimportqualifiedData.TextdataGitRepo=GitRepo{_host::Text
, _repo::Text}deriving (Generic, Show)
dataBoxConfig=BoxConfig{_userName::Text
, _dotfilesRepo::GitRepo}deriving (Generic, Show)
instanceFromDhallGitRepowhere
autoWith =
genericAutoWithInputNormalizer defaultInterpretOptions
{ fieldModifier =Data.Text.dropWhile (=='_') }
instanceFromDhallBoxConfigwhere
autoWith =
genericAutoWithInputNormalizer defaultInterpretOptions
{ fieldModifier =Data.Text.dropWhile (=='_') }
main::IO()
main =do
x <- input auto "./config.dhall"print (x ::BoxConfig)
It seems like I stumbled upon a bug, which was already fixed in #33 a few years ago.
I slightly adjusted the old example:
Prepending _ only works for top-level attributes.
The text was updated successfully, but these errors were encountered: