{"action":"closed","issue":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/186","repository_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library","labels_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/186/labels{/name}","comments_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/186/comments","events_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/186/events","html_url":"https://github.com/Gabriel439/Haskell-Turtle-Library/issues/186","id":180068437,"number":186,"title":"Default values for command line args/options","user":{"login":"mitchellwrosen","id":1074598,"avatar_url":"https://avatars.githubusercontent.com/u/1074598?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellwrosen","html_url":"https://github.com/mitchellwrosen","followers_url":"https://api.github.com/users/mitchellwrosen/followers","following_url":"https://api.github.com/users/mitchellwrosen/following{/other_user}","gists_url":"https://api.github.com/users/mitchellwrosen/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellwrosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellwrosen/subscriptions","organizations_url":"https://api.github.com/users/mitchellwrosen/orgs","repos_url":"https://api.github.com/users/mitchellwrosen/repos","events_url":"https://api.github.com/users/mitchellwrosen/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellwrosen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-29T14:41:02Z","updated_at":"2016-09-29T17:20:30Z","closed_at":"2016-09-29T17:20:30Z","body":"What do you think about adding default values to the API? It might come out looking something like this:\r\n\r\n```haskell\r\n-- same as before\r\nopt :: (Text -> Maybe a) -> ArgName -> ShortName -> Optional HelpMessage -> Parser a\r\n\r\n-- show default value with Show instance\r\noptDefault :: Show a => (Text -> Maybe a) -> ArgName -> ShortName -> a -> Optional HelpMessage -> Parser a\r\n\r\n-- show default value with given func\r\noptDefaultWith :: (Text -> Maybe a) -> ArgName -> ShortName -> (a -> Text) -> a -> Optional HelpMessage -> Parser a\r\n\r\n-- other funcs get an additional Optional arg\r\noptInt :: ArgName -> ShortName -> Optional Int -> Optional HelpMessage -> Parser Int\r\noptDouble :: ArgName -> ShortName -> Optional Double -> Optional HelpMessage -> Parser Double\r\n...\r\n```"}}
{"actor":{"display_login":"mitchellwrosen"}}