uncons.cr
uncons
Somewhat naive, thread-safe head|tail destructuring for Luca Ongaro's Immutable library.
It's a toy implementation that adds path copying to the 'left side' of the hybrid trie implemented by Luca. It fits my need for a proper 'uncons' mechanism but I would not recommend using it against really big data structures.
Speaking of functional programming, a quick re-read shows that it is unlikely that LLVM will be able to perform tail recursion optimization on the library itself.
If you are interested in persistent data structures, I would recommend researching balanced binary trees and reading any publication by Chris Okasaki.
Installation
Add this to your application's shard.yml
:
dependencies:
uncons:
github: fusion/uncons.cr
Usage
require "uncons"
You get, for Vector only: uncons
head
head?
tail
tail?
Contributing
- Fork it ( https://github.com/fusion/uncons/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- fusion Chris F Ravenscroft - creator, maintainer
uncons.cr
- 0
- 0
- 0
- 0
- 1
- almost 8 years ago
- December 19, 2016
MIT License
Thu, 07 Nov 2024 04:30:44 GMT