Open
Description
@Gabriel439 had mentioned that Interpret
should be renamed to FromDhall
, and Inject
to ToDhall
. This was implemented in #1437.
IMHO there are more things in the Dhall
module that deserve better names:
Type
andInputType
.input
suggests a link toInputType
but is actually more related toInterpret
.InterpretOptions
are used both byInterpret
and byInject
.
This renaming would be a large breaking change, so we should try find a naming scheme that we're happy with and then implement it within a single version bump.
Here's what I perceive to be the "big" names and exports from Dhall
:
Dhall to Haskell
class FromDhall a where
autoWith :: InterpretOptions -> Decoder a
auto :: FromDhall a => Decoder a
data Decoder a = Decoder
{ extract :: Expr Src X -> Extractor Src X a
, expected :: Expr Src X
}
input :: Decoder a -> Text -> IO a
Haskell to Dhall
class ToDhall a where
injectWith :: InterpretOptions -> Encoder a
inject :: ToDhall a => Encoder a
data Encoder a =
{ embed :: a -> Expr Src X
, declared :: Expr Src X
}