개인 자료란 (JE)

  서버 커뮤니티

Profile muqhc 대표칭호 없음
Profile

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

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

2022.01.07 조회 수 1478 추천 수 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

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

뉴스 및 창작물
사진이 없습니다.

모드

아이리스 쉐이더

gyeol12

2024-09-07

0

/files/thumbnails/382/873/003/262x150.crop.jpg?20240903125347

레드스톤

[노트블럭커버] 숙청행진 - 밀그램

노트블럭전문가

2024-09-03

0

/files/thumbnails/069/864/003/262x150.crop.jpg?20240819102737

레드스톤

[노트블럭커버] 만찬가 - tuki

노트블럭전문가

2024-08-19

1

/files/thumbnails/647/816/003/262x150.crop.jpg?20240619112336

건축

숭례문(프리퀄) 4

KHC

2024-06-19

0

/files/thumbnails/932/812/003/262x150.crop.jpg?20240622110502

업데이트

마인크래프트 1.21 정식 업데이트

학교가기싫다

2024-06-14

1