Skip to content

Documention for def is misleading #26

@pbrisbin

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.

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