packages feed

polytree 0.0.8 → 0.0.9

raw patch · 3 files changed

+6/−27 lines, 3 files

Files

changelog.md view
@@ -1,3 +1,7 @@+0.0.9++* Delete `leaves` function (use `traverse`)+ 0.0.8  * Add `leaves` function
polytree.cabal view
@@ -1,5 +1,5 @@ name:                 polytree-version:              0.0.8+version:              0.0.9 synopsis:             A polymorphic rose-tree description:          A rose-tree which has different data in the nodes and leaves license:              BSD3
src/Data/PolyTree.hs view
@@ -4,7 +4,7 @@  module Data.PolyTree where -import Control.Applicative ( Applicative(liftA2), Alternative(empty), asum )+import Control.Applicative ( Applicative(liftA2), Alternative(empty) ) import Control.Lens     ( preview,       iso,@@ -738,31 +738,6 @@   iso     (matchTree (, Nothing) (\a t -> (a, Just t)))     (\(a, t) -> maybe (Leaf a) (Node a) t)---- |------ >>> leaves (Leaf 1 :: Tree0' Int)--- [1]------ >>> leaves (Node 1 [] :: Tree0' Int)--- []------ >>> leaves (Node 1 [Leaf 2] :: Tree0' Int)--- [2]------ >>> leaves (Node 1 [Leaf 2, Node 3 []] :: Tree0' Int)--- [2]------ >>> leaves (Node 1 [Leaf 2, Node 3 [Leaf 4]] :: Tree0' Int)--- [2,4]-leaves ::-  (Traversable f, Alternative f) =>-  Tree f a b-  -> f b-leaves (Leaf b) =-  pure b-leaves (Node _ t) =-  asum (fmap leaves t)  -- | --