Our great sponsors
-
excoptional
A fully typed, zero-dependency implementation of the functional programming Option object for JavaScript and TypeScript
One benefit to keeping your value wrapped in a Maybe is that as you transform and manipulate the value and pass it around in your system, you leave it up to the last place in your system that uses the value to define the fallback value in the case of a None rather than defining a fallback value part way through and establish a convention that the fallback value means nothing was found at some other part of your system.
Another benefit to using Maybes is that you avoid the rigamarole of null checks at every call site where you want to use the value. If you have a function that returns null or a value, whenever you call that function you'll always have to add an if guard to validate it's not null. If it is, that function itself may return null, and callers to it will again have to implement the same check.
I wrote a JS implementation of the Option object and the readme has lots of specific examples about these benefits: https://github.com/sbernheim4/excoptional
-
There are a good deal of resources explaining these concepts in non-Haskell languages. This one is quite good and in javascript: https://github.com/MostlyAdequate/mostly-adequate-guide
As far as functors this could be rephrased more comprehensibly to those unfamiliar with Haskell as "What is a Functor, really? Functor is an interface here are some definitions:"
(typescript)
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Related posts
- Mostly adequate guide to Functional Programming (in JavaScript)
- How do you run an effective clean code book club, and looking for homework ideas?
- [AskJS] object oriented or functional , which one you guys oftenly use while writing code in vanilla JavaScript?
- FP techniques that will help you write better JavaScript
- Having hard times to understand why my code dose'nt work (JS)