๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

์ „์ฒด ๊ธ€

(385)
[Kotlin][Java] Java์˜ Stream์ด ์žˆ์Œ์—๋„ Kotlin์˜ Sequence๋Š” ์™œ ๋งŒ๋“ค์—ˆ์„๊นŒ ์ถœ์ฒ˜Kotlin In Actionhttps://bcp0109.tistory.com/359 Kotlin Collections ์™€ Sequences ์˜ ์ฐจ์ด์  (feat. Java Stream)Overview Java8 ์—์„œ๋Š” Collection ์„ ๋‹ค๋ฃจ๊ธฐ ์œ„ํ•ด Stream ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. Kotlin ์€ Collections ์ž์ฒด์—์„œ filter, map ๋“ฑ์˜ ์—ฌ๋Ÿฌ ๊ฐ€์ง€ API ๋ฅผ ์ œ๊ณตํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋งค๋ฒˆ .streams() ๋ฅผ ๋ถ™์ด์ง€ ์•Š์•„๋„ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ์žฅ์ bcp0109.tistory.com  ์ž๋ฐ”์˜ Stream๊ณผ ์ฝ”ํ‹€๋ฆฐ์˜ Collection, Sequence ๋น„๊ตhttps://bcp0109.tistory.com/359 Kotlin Collections ์™€ Sequences ์˜ ์ฐจ์ด์  (feat. Jav..
[ํ•จ์ˆ˜ํ˜• ํ”„๋กœ๊ทธ๋ž˜๋ฐ][Kotlin] ๊ณ ์ฐจํ•จ์ˆ˜ HOF High-order Function, Combinator Pattern ์ถœ์ฒ˜https://softwarepatternslexicon.com/patterns-kotlin/functional/combinator/ Combinator in KotlinExplore the Combinator Design Pattern in Kotlin, a powerful functional programming technique to combine functions, promoting flexible and reusable code. Learn how to implement and use combinators with real-world examples and programmatic illustrations.softwarepatternslexicon.comhttps://kotlinlang.org..
[Kotlin][ํ•จ์ˆ˜ํ˜• ํ”„๋กœ๊ทธ๋ž˜๋ฐ] ๋ฉค๋ฒ„ ์ฐธ์กฐ ์ถœ์ฒ˜Kotlin In Actionhttps://antonioleiva.com/function-references-kotlin/ Function references in Kotlin: use functions as lambdas everywhereFunction references allow to use regular functions as lambdas. With them you can write cleaner code in a more functional style.antonioleiva.comhttps://inpa.tistory.com/entry/JAVA8-%E2%98%95-%EB%9E%8C%EB%8B%A4%EC%8B%9D%EC%9D%84-%EB%8D%94-%EC%A7%A7%EA%B2%8C-%EB%A..
[ํ•จ์ˆ˜ํ˜• ํ”„๋กœ๊ทธ๋ž˜๋ฐ] ์—ํƒ€ ๋ณ€ํ™˜ eta conversion ์ถœ์ฒ˜ChatGPThttps://sookocheff.com/post/fp/eta-conversion/ Eta ReductionThe purpose of eta reduction (also written \(\eta\)-reduction) is to drop an abstraction over a function to simplify it. This is possible when there is nothing more that a function can do to its argument. For example, imagine that we have a simple functionsookocheff.comhttps://library.fiveable.me/key-terms/programming-languages..
[Java][Kotlin] ๊ฐ€์‹œ์„ฑ ๋ณ€๊ฒฝ์ž ์ฐจ์ด ๋น„๊ต ๋ถ„๋ฅ˜์ž๋ฐ”์ฝ”ํ‹€๋ฆฐ๊ธฐ๋ณธ ๊ฐ€์‹œ์„ฑํด๋ž˜์Šค, ๋ฉ”์„œ๋“œ, ํ•„๋“œ์˜ ๊ธฐ๋ณธ ๊ฐ€์‹œ์„ฑ์€ ํŒจํ‚ค์ง€๋กœ ๊ฒฐ์ •๋œ๋‹ค. ๊ฐ€์‹œ์„ฑ ๋ณ€๊ฒฝ์ž๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š์œผ๋ฉด ํ•ด๋‹น ์š”์†Œ๋Š” ๋™์ผํ•œ ํŒจํ‚ค์ง€ ๋‚ด์—์„œ๋งŒ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•˜๋‹ค.๊ธฐ๋ณธ ๊ฐ€์‹œ์„ฑ์€ public์ด๋‹ค. ๋ณ„๋„์˜ ๊ฐ€์‹œ์„ฑ ๋ณ€๊ฒฝ์ž๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š์œผ๋ฉด ํ•ด๋‹น ํด๋ž˜์Šค๋‚˜ ๋ฉ”์„œ๋“œ๋Š” ์–ด๋””์„œ๋“  ์ ‘๊ทผ ๊ฐ€๋Šฅํ•˜๋‹ค.๊ฐ€์‹œ์„ฑ ๋ณ€๊ฒฝ์ž ๋น„๊ตpublicํด๋ž˜์Šค, ๋ฉ”์„œ๋“œ, ํ•„๋“œ ๋ชจ๋‘ ๋ชจ๋“  ๊ณณ์—์„œ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•˜๋‹ค.์ž๋ฐ”์™€ ๋™์ผํ•˜๊ฒŒ ๋ชจ๋“  ๊ณณ์—์„œ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•˜๋‹ค.privateํด๋ž˜์Šค ๋‚ด๋ถ€์—์„œ๋งŒ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•˜๋‹ซ.๊ฐ™์€ ํด๋ž˜์Šค ์•ˆ์—์„œ๋งŒ ์ ‘๊ทผ์ด ํ—ˆ์šฉ๋œ๋‹ค.์ž๋ฐ”์™€ ๋™์ผํ•˜๊ฒŒ ๊ฐ™์€ ํด๋ž˜์Šค ๋‚ด๋ถ€์—์„œ๋งŒ ์ ‘๊ทผ์ด ๊ฐ€๋Šฅํ•˜์ง€๋งŒ, ๊ฐ™์€ ํŒŒ์ผ ๋‚ด์˜ ์ตœ์ƒ์œ„ ์ˆ˜์ค€์˜ ์„ ์–ธ์— ๋Œ€ํ•ด์„œ๋„ private๊ฐ€ ์ ์šฉ๋  ์ˆ˜ ์žˆ๋‹ค.ํŒŒ์ผ ๋‚ด์— ์—ฌ๋Ÿฌ ํด๋ž˜์Šค๊ฐ€ ์žˆ์œผ๋ฉด ๋‹ค๋ฅธ ํด๋ž˜์Šค์—์„œ ์ ‘๊ทผ์ด ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹คprotected๋™..
[Kotlin] Local Functions ๋กœ์ปฌ ํ•จ์ˆ˜ ์ถœ์ฒ˜https://kotlintutorial.io/local-functions-in-kotlin/ Local functions in KotlinIn Kotlin there are local functions that can be defined within a larger function. These functions are only visible within this larger function and cannot be accessed from outside. Local functions have the advantage of making code more readable and clear bykotlintutorial.ioChatGPThttps://cornswrold.tistory.com/464 [Ko..
[ํ”„๋กœ๊ทธ๋ž˜๋ฐ] ๋ฉ”์„œ๋“œ ์ถ”์ถœ ๋ฆฌํŒฉํ† ๋ง Extract Method ์ถœ์ฒ˜https://zaengle.com/blog/refactoring-techniques-extract-method Refactoring Techniques: Extract Method | Zaengle CorpInsights on refactoring techniques focusing on the extract method and Martin Fowlers's book Refactoring - Improving the Design of Existing Code.zaengle.comhttps://hceris.com/the-humble-extract-method/ The Humble Extract MethodThe extract method refactoring is a low-cost, high-imp..
[Kotlin] Infix call ์ค‘์œ„ ํ˜ธ์ถœ ์ถœ์ฒ˜https://torbjorn.tistory.com/753 [Kotlin] infix call (์ค‘์œ„ ํ˜ธ์ถœ)์ฝ”ํ‹€๋ฆฐ์—์„œ๋Š” ํ•จ์ˆ˜์— infix ํ‚ค์›Œ๋“œ๋ฅผ ๋ถ™์—ฌ ๋ฉ”์†Œ๋“œ๋กœ ์ค‘์œ„ํ˜ธ์ถœ์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค public infix fun A.to(that: B): Pair = Pair(this, that) ์˜ˆ๋ฅผ ๋“ค๋ฉด Pair๋ฅผ ๋งŒ๋“œ๋Š” to ๋ฉ”์†Œ๋“œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค val numToEng = mapOf( 1 to "one",torbjorn.tistory.comhttps://kotlinlang.org/docs/functions.html#infix-notation Functions | Kotlin kotlinlang.orgChatGPT์ค‘์œ„ ํ˜ธ์ถœ(Infix call)์€ ์ฝ”ํ‹€๋ฆฐ์—์„œ ํŠน์ •ํ•œ ํ•จ์ˆ˜ ํ˜ธ์ถœ ๋ฐฉ์‹์ด๋‹ค. ํ•จ์ˆ˜ ์ด๋ฆ„์„ ๋‘ ์ธ์ž ์‚ฌ์ด..