You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An operation for composing two [monad](#monad)-returning functions (Kleisli Arrows) where they have compatible types. In Haskell this is the `>=>` operator.
725
+
726
+
Using [Option](#option):
727
+
728
+
```js
729
+
// safeParseNum :: String -> Option Number
730
+
constsafeParseNum= (b) => {
731
+
constn=parseNumber(b)
732
+
returnisNaN(n) ?none() :some(n)
733
+
}
734
+
735
+
// validatePositive :: Number -> Option Number
736
+
constvalidatePositive= (a) => a >0?some(a) :none()
737
+
738
+
// kleisliCompose :: Monad M => ((b -> M c), (a -> M b)) -> a -> M c
0 commit comments