개인 자료란 (JE)

  서버 커뮤니티

Profile muqhc 대표칭호 없음
Profile

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

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

2022.01.07 조회 수 1467 추천 수 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/288/791/003/262x150.crop.jpg?20240602150002

아티클

《까다로운 시련》 업데이트 날짜 공개 및 정보

학교가기싫다

2024-06-02

0

/files/thumbnails/841/773/003/262x150.crop.jpg?20240526120908

레드스톤

마인크래프트 노트블록버전 『 봄을 고하다 (春を告げる) 』 [더블옥타브 버전]

노트블럭전문가

2024-05-26

0

/files/thumbnails/712/796/003/262x150.crop.jpg?20240525085438

레드스톤

마인크래프트 노트블록으로 만든 『 봄을 고하다 (春を告げる) 』 1

Sonttukk

2024-05-25

0

/files/thumbnails/268/789/003/262x150.crop.jpg?20240515192032

레드스톤

벌레먹은 돌 빠르게 제거하는 법

GlassesFilm

2024-05-15

0

/files/thumbnails/797/788/003/262x150.crop.jpg?20240515090924

건축

마인크래프트로 구현한 카르카손 보드게임

Warak

2024-05-15

2