-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtree-traversals.cabal
79 lines (73 loc) · 2.74 KB
/
tree-traversals.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
cabal-version: 2.2
name: tree-traversals
version: 0.1.3.0
synopsis: Functions and newtype wrappers for traversing Trees
description:
The tree-traversals package defines
<https://en.wikipedia.org/wiki/Tree_traversal#Types in-order, pre-order, post-order, level-order, and reversed level-order traversals>
for tree-like types:
.
> inorder, preorder, postorder, levelorder, rlevelorder
> :: (TreeLike tree, Applicative f) => (a -> f b) -> tree a -> f (tree b)
.
The package also provides newtype wrappers for the various traversals so they
may be used with @traverse@, i.e.
.
> traverse f (InOrder tree) = inorder f tree
> traverse f (PreOrder tree) = preorder f tree
> traverse f (PostOrder tree) = postorder f tree
> traverse f (LevelOrder tree) = levelorder f tree
> traverse f (RLevelOrder tree) = rlevelorder f tree
.
To implement the various orders, the tree-traversals package provides the
'Control.Applicative.Phases.Phases' applicative transformer for organizing effects
into distinct phases.
.
Instances of 'Data.Traversable.TreeLike.TreeLike' are provided for
rose trees ('Data.Tree.Tree'),
binary trees ('Data.BinaryTree.BinaryTree'),
forests ('Data.Traversable.TreeLike.Forest'),
and algebraic combinations of trees (@'Data.Functor.Compose.Compose' outerTree innerTree@,
@'Data.Functor.Product' fstTree sndTree@, @'Data.Functor.Sum' leftTree rightTree@).
homepage: /~https://github.com/rampion/tree-traversals
license: CC0-1.0
license-file: LICENSE
author: Noah Luck Easterly
maintainer: noah.easterly@gmail.com
category: Data
build-type: Simple
extra-source-files: ChangeLog.md
, README.md
source-repository head
type: git
location: git://github.com/rampion/tree-traversals.git
source-repository this
type: git
location: git://github.com/rampion/tree-traversals.git
tag: v0.1.0.0
flag Development
description: Enable all warnings and upgrade warnings to errors
default: False
manual: True
library
exposed-modules: Control.Applicative.Phases
, Data.BinaryTree
, Data.Monoid.TreeDiagram
, Data.Traversable.TreeLike
-- other-extensions:
build-depends: base >=4.10 && <4.20
, containers
hs-source-dirs: src
default-language: Haskell2010
if flag(development)
ghc-options: -Wall -Wextra -Werror
test-suite doctests
type: exitcode-stdio-1.0
main-is: doctests.hs
build-depends: base >=4.10
, doctest >=0.13
, containers
, mtl >=2.2.1
default-language: Haskell2010
if flag(development)
ghc-options: -Wall -Wextra -Werror