This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
A Generic Tree API.
version 3.1.0
license MIT
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 3.1.0
Committed At 2018-05-07 16:20:44 UTC
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

Modules

README

Canopy

A Generic Tree API, based on the Rose Tree algebraic data type, augmented with helpers for building, querying and manipulating nodes.

Building a tree is basically done with using node and leaf:

tree : Node String
tree =
    node "root"
        [ node "foo"
            [ leaf "bar" ]
        , node "baz"
            [ leaf "qux" ]
        ]

The API focuses on node values for common operations:

tree
    |> remove "baz"
    |> append "foo" "bingo"
    == node "root"
        [ node "foo"
            [ leaf "bar"
            , leaf "bingo"
            ]
        ]

It exposes powerful helpers for working with tree data structures:

node 1
    [ node 2
        [ leaf 3, leaf 4 ]
    , node 5
        [ leaf 6 ]
    ]
    |> flatMap (value >> (*) 2)
    |> List.sum
    == 42

License

MIT.