uncons
Version, currently master branch1 version
- master branchlatestDec 19, 2016
github.com/Fusion/uncons.cr
A toy implementation of head|tail destructuring for the Immutable library
Installation
# Add this to your shard.yml
dependencies:
uncons:
github: Fusion/uncons.cr
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.19.4- License
- MIT
- Author
- Chris F Ravenscroft
Dependencies
Runtime Dependencies
- immutable*github: lucaong/immutable
README
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
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Dec 19, 2016
- Crystal
0.19.4- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/Fusion/uncons.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 17, 2026
- Synced
- Aug 17, 2026
- Versions
- 1