     do_each(iterator.(next), iterator, fun)
   end
 
-  defp do_each({ :stop, _, _ }, _, _) do
+  defp do_each(:stop, _, _) do
     []
   end
 
   ## filter
 
-  defp do_filter({ h, next }, iterator, acc, fun) do
+  defp do_filter({ h, next }, iterator, acc, fun, ctor) do
     case fun.(h) do
-    match: false
-      do_filter(iterator.(next), iterator, acc, fun)
-    match: nil
-      do_filter(iterator.(next), iterator, acc, fun)
-    else:
-      do_filter(iterator.(next), iterator, [h|acc], fun)
-    end
-  end
-
-  defp do_filter({ :stop, ctor, _ }, _, acc, _) do
+    match: x when x == false or x == nil
+      do_filter(iterator.(next), iterator, acc, fun, ctor)
+    else:
+      do_filter(iterator.(next), iterator, [h|acc], fun, ctor)
+    end
+  end
+
+  defp do_filter(:stop, _, acc, _, ctor) do
     ctor.(List.reverse(acc))
   end
 
   ## filter_map
 
-  defp do_filter_map({ h, next }, iterator, acc, filter, mapper) do
+  defp do_filter_map({ h, next }, iterator, acc, filter, mapper, ctor) do
     case filter.(h) do
-    match: false
-      do_filter_map(iterator.(next), iterator, acc, filter, mapper)
-    match: nil
-      do_filter_map(iterator.(next), iterator, acc, filter, mapper)
-    else:
-      do_filter_map(iterator.(next), iterator, [mapper.(h)|acc], filter, mapper)
-    end
-  end
-
-  defp do_filter_map({ :stop, ctor, _ }, _, acc, _, _) do
+    match: x when x == false or x == nil
+      do_filter_map(iterator.(next), iterator, acc, filter, mapper, ctor)
+    else:
+      do_filter_map(iterator.(next), iterator, [mapper.(h)|acc], filter, mapper, ctor)
+    end
+  end
+
+  defp do_filter_map(:stop, _, acc, _, _, ctor) do
     ctor.(List.reverse(acc))
   end
 


  defp do_any?({ h, next }, iterator, fun) do
    case fun.(h) do
    match: false
      do_any?(iterator.(next), iterator, fun)
    match: nil
      do_any?(iterator.(next), iterator, fun)
    else:
      true
    end
  end

  defp do_any?({ :stop, _, _ }, _, _) do
    false
  end

  ## drop_while

  defp do_drop_while({ h, { t, ctor } = next }, iterator, fun) do
    case fun.(h) do
    match: false
      ctor.([h|t])
    match: nil
      ctor.([h|t])
    else:
      do_drop_while(iterator.(next), iterator, fun)
    end
  end

  defp do_drop_while({ :stop, ctor, _ }, _, _) do
    ctor.([])
  end



  defp do_find_value({ h, next }, iterator, ifnone, fun) do
    case fun.(h) do
    match: x when x == false or x == nil
      do_find_value(iterator.(next), iterator, ifnone, fun)
    match: other
      other
    end
  end

  defp do_find_value(:stop, _, ifnone, _) do
    ifnone
  end

