Skip to content

Conversation

@nsaunders
Copy link
Owner

@nsaunders nsaunders commented Feb 9, 2023

Since originally publishing this library, I came to learn that row labels in PureScript don't have to be camel-case. Considering this, there isn't much point in this library attempting to map environment variable names. Instead, we might as well just use the environment variable name as the label, and allow the client code to map to camel-case if needed, hence this PR.

This is a breaking change, of course, but at least client code is simplified...

Before

TypedEnv.fromEnv (Proxy :: _ (foo :: String <: "FOO"))

After

TypedEnv.fromEnv (Proxy :: _ ("FOO" :: String))

Before

case TypedEnv.fromEnv (Proxy :: _ (foo :: String <: "FOO")) of
  Left err ->
    -- ...
  Right { foo } ->
    -- ....

After

case TypedEnv.fromEnv (Proxy :: _ ("FOO" :: String)) of
  Left err ->
    -- ...
  Right { "FOO": foo } ->
    -- ....

@nsaunders nsaunders merged commit 4e4b671 into master Feb 9, 2023
@nsaunders nsaunders added the breaking Breaking API change label Feb 10, 2023
@nsaunders nsaunders deleted the new-api 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants