Skip to content

Documention for def is misleading #26

Description

@pbrisbin

In the Haddocks for def it says,

Note: specifying it means the parser won't ever fail.

This is not correct:

> X="" stack ghci --package envparse
λ> Env.parse id $ Env.var (Env.eitherReader (\_ -> Left "oops")) "X" (Env.def ())
Available environment variables:

  X

Parsing errors:

  X has value oops: "hi" that cannot be parsed

I'm happy to PR a quick fix, but I wanted to see what the intention was. Is the note meant to read won't ever fail on a missing environment variable? I'd argue that's pretty obvious and would just remove the note entirely in that case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions