Use fromValue
authorwidmogrod <widmogrod@gmail.com>
Wed, 20 Dec 2017 00:19:35 +0000 (01:19 +0100)
committerwidmogrod <widmogrod@gmail.com>
Wed, 20 Dec 2017 00:19:35 +0000 (01:19 +0100)
src/Functional/functions.php

index eab68d6..8e5711a 100644 (file)
@@ -283,7 +283,7 @@ function filter(callable $predicate, Foldable $list = null)
     return curryN(2, function (callable $predicate, Foldable $list) {
         return reduce(function (Listt $list, $x) use ($predicate) {
             return call_user_func($predicate, $x)
-                ? append($list, fromIterable($x))
+                ? append($list, fromValue($x))
                 : $list;
         }, Listt::mempty(), $list);
     })(...func_get_args());