Skip to content

Commit

Permalink
use maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
syves committed Mar 26, 2019
1 parent 32e3d4d commit 6006db3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3138,10 +3138,9 @@
//. Nothing
//. ```
function tail(foldable) {
var empty = Z.empty (foldable.constructor);
return Z.reduce (function(m, x) {
return m.isNothing ?
Just (Z.empty (foldable.constructor)) :
Z.map (append (x), m);
return Just (maybe (empty) (append (x), m) (m));
}, Nothing, foldable);
}
_.tail = {
Expand Down

0 comments on commit 6006db3

Please sign in to comment.