Skip to content

New API uses variable name as record label. #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2023
Merged

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.

1 participant