Yet Another Kotlin Collection Library and Additional Utility
Add the following line to build.gradle:
dependencies {
compile "com.github.kmizu:kollection:0.4"
}
KList
is a cons-based List. It provides access to head by hd
and access to tail by hd
. It takes only constant time
to insert a new element to front of the KList. Note that it takes linear time to append a new element to last of the KList
KStream
is like a KList
seemingly. But it differs from KList in that KStream
's tail is lazily evaluated.
Therefore, KStream
can represent an infinite stream. For example, ones
is an infinite stream that consists
of only 1 such as the following:
val ones: KStream<Int> = 1 cons { ones }
KOption
is a container which has only one value(Some
) or no value(None
).
KStack
is cons-based immutable stack implementation.
KListMap
is KList
-based immutable Map.
KListMap
is KList
-based immutable Set.
KTreeSet
is RedBlackTree
-based immutable Set.
KTreeMap
is RedBlackTree
-based immutable Map.