2024 08 16
2024-08-16¶
Currying (Scala)¶
참고: https://hamait.tistory.com/693
참고: https://partnerjun.tistory.com/27
참고: https://captainthomas.tistory.com/entry/%EC%8A%A4%EC%B9%BC%EB%9D%BC-%EC%BB%A4%EB%A7%81Currying-%EC%95%84%EB%A7%88%EB%8F%84-%EC%B2%AB%EB%B2%88%EC%A7%B8-%EA%B8%80
- 개념
- 파라미터가 여러개인 함수를 파라미터의 갯수가 적거나 같은 새로운 함수로 만들 수 있는 것.
(x,y -> ax + by)는(x -> y -> ax + by)형식으로 바꿀 수 있는 것.
- 예시
함수 합성¶
참고: https://scalabook.hatemogi.com/example/lambda.html
- Scala compose
- compose를 통해 함수를 합성할 수 있다.