Skip to content

tryzniak/elm-heap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elm-heap

Data structure for heaps, in Elm.

Usage

Install the package:

elm package install TSFoster/elm-heap

Use the heap:

import Heap exposing (Heap, smallest, biggest, by, thenBy)

type alias Person =
    { firstname : String
    , surname : String
    , age : Int
    }

init : Heap Person
init = Heap.empty (smallest |> by .surname)

defaultPeople : Heap Person
defaultPeople =
    Heap.fromList (biggest |> by .surname |> thenBy .firstName |> thenBy .age)
        [ { firstname = "Anders", surname = "And", age = 83 }
        , { firstname = "Bruce", surname = "Bogtrotter", age = 8 }
        , { firstname = "Charlie", surname = "Chaplin", age = 88 }
        , { firstname = "Donald", surname = "Duck", age = 83 }
        ]

For full documentation, see package.elm-lang.org.

git clone https://github.com/TSFoster/elm-heap.git
cd elm-heap
elm-test
npm install elm-doc-test && elm-doc-test && elm-test tests/Doc/Main.elm

License

MIT

About

Heaps for elmlang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elm 100.0%