Skip to content

Conversation

@alunduil
Copy link

This combinator is a convenience for handling default values that may
fail. I use this pattern to determine sane defaults from the system if
available but if not enforce the value to be required instead of having
a default.

I'm not sure if this is the best location nor what the recommended
testing strategy is for something like this, but please let me know if
there is interest in adding a new combinator such as this and what I can
improve to ensure it's successfully merged.

This combinator is a convenience for handling default values that may
fail. I use this pattern to determine sane defaults from the system if
available but if not enforce the value to be required instead of having
a default.

I'm not sure if this is the best location nor what the recommended
testing strategy is for something like this, but please let me know if
there is interest in adding a new combinator such as this and what I can
improve to ensure it's successfully merged.
@HuwCampbell
Copy link
Collaborator

G'day,

Thanks for thinking about optparse.

While this might be useful, I don't feel like it's quite common enough that people will reach for it over just using the constituents. Once inlined it's just

maybe mempty value mx <> showDefault

or even

foldMap value mx <> showDefault

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants