isJust & fromJust
See original GitHub issueI do not see in the docs a isJust
or fromJust
(potential to throw but unless isJust
was checked) nor isNothing
. Even the pure Haskell has theme functions.
The primary importance (for me) is that values passed around are explicit but how I implement a function is not where errors arise. The fact that a value is a Maybe is obvious (or will raise obvious errors). My function should be able to deal with that logically without needing to get into callback functions (JavaScript does not even have do
notation to make things at least look better). I give up compile time type safety/checking by using isJust
and fromJust
, but wait, JS is not statically typed anyway.
It is true I likely may never use isJust
or fromJust
and have the simple alternative with the other functions. But I am unwilling to start using a library without complete definitions (if I want to get a value from a Just
(regardless of whether I theoretically should (even Haskell has performUnsafeIO
!)) how can I do it?).
Thanks, Jonathan
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
I guess that is reasonable. They are not that hard to implement oneself.
For anyone who sees this looking for an implementation here is one:
@JonathanILevi Personally, I see those “theme” functions as bloat and while we use Haskell for some reference and provide some functions with the same name (
fanout
,fst
, etc), we try not to let their choices influence what we provide in the library.As far as your need for these functions, could you provide an example of where you would find them useful?
While it is a bummer that you feel this library is not complete without those two functions or theme functions, there are other libs out there like Sanctuary that do provide those functions and may feel more complete to you.