Skip to content

Naming improvements for the Dhall module #1393

Open
@sjakobi

Description

@sjakobi

@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 and InputType.
  • input suggests a link to InputType but is actually more related to Interpret.
  • InterpretOptions are used both by Interpret and by Inject.

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
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussmarshallingMarshalling between Dhall and Haskell

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions