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
926
926
// sum :: [Number] -> Number
927
927
const sum = arr => arr .reduce ((a , b ) => a + b)
928
928
sum ([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
930
930
931
931
// example 2: get the first item in list
932
932
// first :: [A] -> A
@@ -957,7 +957,7 @@ Fortunately a partial function can be converted to a regular (or total) one. We
957
957
// sum :: [Number] -> Number
958
958
const sum = arr => arr .reduce ((a , b ) => a + b, 0 )
959
959
sum ([1 , 2 , 3 ]) // 6
960
- sqrt ([]) // 0
960
+ sum ([]) // 0
961
961
962
962
// example 2: get the first item in list
963
963
// change result to Option
You can’t perform that action at this time.
0 commit comments