Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdded maybe function #299
Conversation
JustusAdam
changed the title from
Added meybe function
to
Added maybe function
Jul 16, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
texastoland
Jul 17, 2015
I think,
map (+1) (fromString x) `withDefault` 0reads better than,
maybe (+1) 0 (fromString x) -- flipped orderfor Elm's target user coming from JS. I bet it already exists in another package though?
texastoland
commented
Jul 17, 2015
|
I think, map (+1) (fromString x) `withDefault` 0reads better than, maybe (+1) 0 (fromString x) -- flipped orderfor Elm's target user coming from JS. I bet it already exists in another package though? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
texastoland
commented
Jul 17, 2015
|
Check out map (+1) (fromString x) ? 0 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jul 17, 2015
Member
I think map ((+) 1) maybe ? 0 is preferable over this. We have #216 to track that, but as @dnalot says, you can use it in Maybe.Extra until we make a decision about moving it into core.
|
I think |
JustusAdam commentedJul 16, 2015
I'd really like to get the maybe function back. In Haskell I tend to use it a ton.