개인 자료란 (JE)

  서버 커뮤니티

Profile muqhc 대표칭호 없음
Profile

커뮤니티 소통 개발하기 잡담

끔찍한 코틀린 람다 관련 라이브러리

2022.01.07 조회 수 1462 추천 수 0


import io.github.runction.*
val plusTwo = { x: Int -> x + 2 }
val plusTen = { x: Int -> x + 10 }


/ /plusTwelve = { x -> plusTen( plusTwo( x ) ) }
val plusTwelve = plusTwo composite plusTen  // { x -> println( plusTwelve( x ) ) }.invoke( 6 ) plusTwelve composite ::println bind 6 //output: 18
val modulo = runc<Int,Runction<Int,Boolean,Boolean,Boolean>,Int,Int> { b ->
    runc { a ->
        a % b == 0
    }
}

val isOdd = modulo(2) compositeOn { not() }

0..9 bindOn
        { toList() } bindOn
        { this::filter bind isOdd } bind ::println

//output: [1, 3, 5, 7, 9]

documentation : https://github.com/muqhc/runction/blob/master/README.md

github repo : https://github.com/muqhc/runction

maven central : https://search.maven.org/artifact/io.github.muqhc/runction




1개의 댓글

명이
2022.01.09

"코드 일부분의 아름다움을 희생하는 대신 다른 일부분의 아름다움을 극대화 시켜주는 라이브러리"

뉴스 및 창작물
/files/thumbnails/762/770/003/262x150.crop.jpg?20240418073724

레드스톤

T.B.H (고민중독) | 노트블럭 버전 | NoteBlock Cover [한국어 영어 중국어 가사 추가]

노트블럭전문가

2024-04-18

0

/files/thumbnails/218/767/003/262x150.crop.jpg?20240412130213

레드스톤

우리의 꿈 - 원피스 오프닝

노트블럭전문가

2024-04-12

0

/files/thumbnails/505/766/003/262x150.crop.jpg?20240411122306

레드스톤

기동전사 건담 수성의 마녀 | 노트블럭 커버 1

노트블럭전문가

2024-04-11

1

/files/thumbnails/932/765/003/262x150.crop.jpg?20240410124459

레드스톤

마인크래프트 노트블록으로 만든 『 밤양갱 (Bam Yang Gang) 』

노트블럭전문가

2024-04-10

0

/files/thumbnails/403/765/003/262x150.crop.jpg?20240409190538

레드스톤

마인크래프트 노트블록으로 만든 『 밤양갱 (Bam Yang Gang) 』

Sonttukk

2024-04-09

4