Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/minibill/elm-rope
List-like data structure with fast concatenation
https://github.com/minibill/elm-rope
Last synced: about 8 hours ago
JSON representation
List-like data structure with fast concatenation
- Host: GitHub
- URL: https://github.com/minibill/elm-rope
- Owner: miniBill
- License: bsd-3-clause
- Created: 2023-05-16T22:46:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-12T11:11:36.000Z (about 2 months ago)
- Last Synced: 2024-09-12T22:30:53.959Z (about 2 months ago)
- Language: Elm
- Homepage: https://package.elm-lang.org/packages/miniBill/elm-rope/latest/
- Size: 542 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-rope
A `Rope` is a data structure similar to a list, but supporting fast concatenation at both ends.
It's useful when you're concatenating many lists, especially if recursively. You can build a `Rope` and then call `toList` at the end and only do the concatenation once.
# Example
```elm
import Ropeten : Rope Int
ten =
Rope.fromList (List.range 1 10)result : List Int
result =
ten
|> Rope.concatMap
(\one ->
ten
|> Rope.concatMap
(\two ->
ten
|> Rope.concatMap
(\three ->
Rope.fromList [ one, two, three ]
)
)
)
|> Rope.toList
```