haskellite 0.0.2
haskellite: ^0.0.2 copied to clipboard
Haskell-inspired functionality for Dart. Provides useful types and syntaxes for more concise, functional-style programming.
haskellite #
Haskell-like functionality for Dart
Features #
- ✅ Open Source
- ✅ Fully Tested and Documented
- ✅ Lightweight and Fast
- ✅ Pure Dart (no Flutter dependencies)
- ✅ Cross-platform
Types #
Maybe<T>- Represents a value or the absence of a value.Either<L, R>- Represents a value of typeLor a value of typeRResult<T>- Represents the result of a computation, either succeeding with a value, or failing with an errorRandomVariable<T>- Describes a variable with a random component, allowing for lazy evaluation and other utilities (convenient reuse/caching/mocking). Inspired by Haskell's strict handling of randomness
Extensions #
Iterablehead,tail,init,lastMaybe(to avoid naming conflicts)fold1- likefoldbut without an initial valuescanandscan1- likefold, but returning anIterableof all intermediate valuesintersperse- inserts elements in between existing elements
int1.to(5)- a replacement for Haskell's[1..5]1.toInfinity()- a replacement for Haskell's[1..]
And More #
curryanduncurry- easy partial function application in DartrepeatandIterable.cycle- create a list of repeating values
Contributing #
Suggestions, feedback and pull requests welcome at Github