Skip to Content
프로그래밍 스칼라: 실용적인 스칼라 활용법을 익히는 가장 확실한 실전 바이블 (2.11.x 버전 기반)
book

프로그래밍 스칼라: 실용적인 스칼라 활용법을 익히는 가장 확실한 실전 바이블 (2.11.x 버전 기반)

by 오현석, 딘 왐플러, 알렉스 페인
July 2016
Beginner to intermediate
776 pages
17h 26m
Korean
Hanbit Media, Inc.
Content preview from 프로그래밍 스칼라: 실용적인 스칼라 활용법을 익히는 가장 확실한 실전 바이블 (2.11.x 버전 기반)
308
2
기본기 다지기
Combinators
.
map
부분 적용한 새로운 함수를 정의했다.
flist
의 타입은
List
[
Int
]
=
>
List
[
String
]
이다. 따라서
map
을 사용하면
Int
=
>
String
타입의 함수를
List
[
Int
]
=
>
List
[
String
]
타입의 함수로 끌어올릴
lift
수 있다.
우리는 보통
map
을 컬렉션에 대해서는 아무것도 모르는 함수
f
:
A
=
>
B
를 사용해서 원소 타입
A
인 컬렉션을 크기가 같고 원소 타입이
B
인 다른 컬렉션으로 변환하는 함수라고 생각한다.
이제는
map
을 평범한 함수
f
:
A
=
>
B
를 새로운 함수
flist
:
List
[
A
] =
>
List
[
B
]
로 끌어올리
는 도구로 볼 수도 있음을 알았다. 비록 리스트를 가지고 설명하긴 했지만, 이는
map
을 지원하
는 모든 컨테이너에 대해 성립한다.
불행히도 스칼라 라이브러리에 있는 일반적인
map
메서드를 가지고는 이런 일을 할 수 없다.
map
이 인스턴스 메서드이기 때문에, 부분 적용을 통해 모든
List
의 인스턴스에 대해 적용 가능
한 끌어올려진 함수를 만들 수 없다.
아마 이는 스칼라가
OOP
FP
를 혼용하기 때문에 생겨난 일종의 제약일 것이다. 하지만 우리
가 이야기한 내용은 조금은 드문 경우에 속한다. 대부분의 경우에는 이미 컬렉션이 있고, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

스파크를 이용한 자연어 처리 : 대규모 텍스트를 다루는 가장 효율적인 딥러닝을 만나다

스파크를 이용한 자연어 처리 : 대규모 텍스트를 다루는 가장 효율적인 딥러닝을 만나다

이창현, 앨릭스 토머스

Publisher Resources

ISBN: 9788968482755