Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guid75/ziplist
A simple Elm zipper implementation
https://github.com/guid75/ziplist
elm zipper
Last synced: 26 days ago
JSON representation
A simple Elm zipper implementation
- Host: GitHub
- URL: https://github.com/guid75/ziplist
- Owner: Guid75
- License: bsd-3-clause
- Created: 2017-06-16T15:59:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-13T07:12:23.000Z (over 5 years ago)
- Last Synced: 2024-10-21T18:21:14.179Z (2 months ago)
- Topics: elm, zipper
- Language: Elm
- Homepage: http://package.elm-lang.org/packages/Guid75/ziplist/latest
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ziplist
A ZipList is a type of collection in which you can move a pointer on a current element forwards or backwards.
Here is a simple example:
```elm
import ZipList exposing (..)zlist : ZipList.ZipList Number
zlist = ZipList.fromList [1, 2, 3] -- this ziplist points on the first element (1) after creationa : Maybe Number
a = ZipList.current zlist -- worth Just 1b : Maybe Number
b =
zlist
|> ZipList.forward
|> ZipList.forward
|> ZipList.current -- worth Just 3list = ZipList.toList zlist -- worth [1, 2, 3]
```