Skip to content

Conversation

@nsaunders
Copy link
Owner

With this change, fromEnv will accept the desired record type instead of a row type. I'm thinking this should simplify client code most of the time. For example:

Before

type ConfigRep =
  ( "FOO" :: String
  , "BAR" :: Int
  )

type Config = { | ConfigRep }

config :: Object String -> Either (List EnvError) Config
config = fromEnv (Proxy :: _ ConfigRep)

After

type Config =
  { "FOO" :: String
  , "BAR" :: Int
  }

config :: Object String -> Either (List EnvError) Config
config = fromEnv (Proxy :: _ Config)

@nsaunders nsaunders merged commit 2f474af into master Feb 10, 2023
@nsaunders nsaunders added enhancement New feature or request breaking Breaking API change labels Feb 10, 2023
@nsaunders nsaunders deleted the proxy-record branch February 10, 2023 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking API change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants