Skip to content
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

Update changelog #10

Merged
merged 1 commit into from
Jul 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.2.0.0

* Removed 'Flag'.
* Changed notation: 'Named' is now '(:!)' in types, 'Arg' in patterns.
* Added 'arg', 'argF'.
* Support for optional parameters: see 'argDef', 'defaults', '(:?)'.

## 0.1.0.0

* First version. Released on an unsuspecting world.
7 changes: 5 additions & 2 deletions src/Named/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,16 @@ argF _ (ArgF fa) = fa

{- |

A variation of 'arg' for optional arguments. Requires a default value in case
the optional argument is missing:
A variation of 'arg' for optional arguments. Requires a default value to handle
the case when the optional argument was omitted:

@
fn (argDef \#answer 42 -> ans) = ...
@

In case you want to get a value wrapped in 'Maybe' instead, use 'argF' or
'ArgF'.

-}
argDef :: Name name -> a -> name :? a -> a
argDef _ d (ArgF fa) = fromMaybe d fa
Expand Down