Skip to content

toori67/L

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

L

Simple set notation in Kotlin

Inspired by medium post

Usage

basic usage

listOf(1,2,3,4).L().cond { it%2==0 }.get()

with two list

val intList1 = listOf(1, 2, 3)
val intList2 = listOf(4, 5, 6)
listOf(1, 2, 3).L(CartesianZipper()).with(listOf(4, 5, 6).cond { x, y -> x * 2 == y }.get()

and many more

val intList1 = listOf(1, 3, 2)
val intList2 = listOf(4, 6, 5)
val intList3 = listOf(11, 13, 12)
val l3 = intList1.L(CartesianZipper()).with(intList2).with(intList3)
		.cond { _, y, z -> y * 2 == z }
		.cond { x, _, _ -> x > 2 }
		.get()
// [(3, 6, 12)]

About

Simple set notation in Kotlin

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages