Add `safeAfter` helper function to `Maybe` name space
See original GitHub issueWith all those crazy value | undefined
or Something | Another | Something Else
returning functions in the wild it may be handy to take care of lifting the result of functions into a Maybe
based on a some predicate. While safeLift
can be used to check an input before calling a function, the typical compose(safe(pred), someFunc)
can be replaced with this safeAfter
function. It has the following signature:
safeLift :: ((a -> Boolean) | Pred) -> (a -> b) -> a -> Maybe b
This will need the following to be accomplished:
- Add code:
-
src/Maybe/safeAfter.js
-
- Add specs
-
src/Maybe/safeAfter.spec.js
-
- Documentation
- Update ReadMe (
src/Maybe/README.md
) - Add to Docs with description and example usage (
docs/src/pages/docs/crocks/Maybe.md
) - Add link to Helpers Section (
docs/src/pages/docs/functions/index.md
)
- Update ReadMe (
- Expose new functions to public API (
src/index.js
)- Entry for
safeAfter
- Entry for
- Add specs for new public functions (
src/index.spec.js
)- Entry for
safeAfter
- Entry for
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
'Helper' functions in C++ - Stack Overflow
Overhead is not an issue, namespaces have some advantages though. You can reopen a namespace in another header, grouping things more ...
Read more >iPhone Contacts Say "Maybe"? Here's Why & The Real Fix!
It says “Maybe” next to the name of the contact! In this article, I'll explain why your iPhone contacts say “Maybe” and show...
Read more >Data Access - Spring
This is a proxy for a target DataSource , which wraps the target DataSource to add awareness of Spring-managed transactions.
Read more >perldiag - man pages section 1: User Commands
Perl Programmers Reference Guide PERLDIAG(1) NAME perldiag - various Perl diagnostics ... or maybe the script needs to add the library name to...
Read more >Developing Character through Literature - GovInfo
help our children to reflect, to decide, to become a principled person. Isn't that the under- lying purpose of all character education? Perhaps...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@evilsoft - Also, I’m pretty sure it’s a typo, but I just wanted to confirm for good measure - the returned function should be returning
Just(result)
, right? (instead ofJust(x)
).This has been completed and merged, will go out in the next release
0.9.1