File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -926,7 +926,7 @@ A partial function is a [function](#function) which is not defined for all argum
926926// sum :: [Number] -> Number
927927const sum = arr => arr .reduce ((a , b ) => a + b)
928928sum ([1 , 2 , 3 ]) // 6
929- sqrt ([]) // TypeError: Reduce of empty array with no initial value
929+ sum ([]) // TypeError: Reduce of empty array with no initial value
930930
931931// example 2: get the first item in list
932932// first :: [A] -> A
@@ -957,7 +957,7 @@ Fortunately a partial function can be converted to a regular (or total) one. We
957957// sum :: [Number] -> Number
958958const sum = arr => arr .reduce ((a , b ) => a + b, 0 )
959959sum ([1 , 2 , 3 ]) // 6
960- sqrt ([]) // 0
960+ sum ([]) // 0
961961
962962// example 2: get the first item in list
963963// change result to Option
You can’t perform that action at this time.
0 commit comments