File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -482,7 +482,7 @@ object.map(f).map(g)
482482The reference implementation of [ Option] ( #option ) is a functor as it satisfies the rules:
483483
484484``` js
485- some (1 ).map (x => x) // = some (1)
485+ Some (1 ).map (x => x) // = Some (1)
486486```
487487
488488and
491491const f = x => x + 1
492492const g = x => x * 2
493493
494- some (1 ).map (x => g (f (x))) // = some (4)
495- some (1 ).map (f).map (g) // = some (4)
494+ Some (1 ).map (x => g (f (x))) // = Some (4)
495+ Some (1 ).map (f).map (g) // = Some (4)
496496```
497497
498498## Pointed Functor
@@ -736,11 +736,11 @@ Using [Option](#option):
736736// safeParseNum :: String -> Option Number
737737const safeParseNum = (b ) => {
738738 const n = parseNumber (b)
739- return isNaN (n) ? none () : some (n)
739+ return isNaN (n) ? None () : Some (n)
740740}
741741
742742// validatePositive :: Number -> Option Number
743- const validatePositive = (a ) => a > 0 ? some (a) : none ()
743+ const validatePositive = (a ) => a > 0 ? Some (a) : None ()
744744
745745// kleisliCompose :: Monad M => ((b -> M c), (a -> M b)) -> a -> M c
746746const kleisliCompose = (g , f ) => (x ) => f (x).chain (g)
You can’t perform that action at this time.
0 commit comments