Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
하스켈과 타입
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Hong Minhee (洪 民憙)
April 04, 2015
Programming
1.2k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
하스켈과 타입
하스켈과 타입에 대해 설명합니다.
2015년 4월 4일 하스켈 프로그래밍 다섯번째 모임
http://haskell.kr/meetup/2015-04-04/
Hong Minhee (洪 民憙)
April 04, 2015
More Decks by Hong Minhee (洪 民憙)
See All by Hong Minhee (洪 民憙)
Gukhanmun: 國漢文을 한글로 바꾸기
minhee
0
24
Nobody's job, everybody's problem: F/OSS in the age of AI
minhee
0
35
Fedify: Building ActivityPub servers without the pain
minhee
0
38
Optique: TypeScript의 타입 추론으로 CLI 유효성 검사를 대체하기
minhee
0
52
야크 셰이빙: 새로운 오픈 소스의 원동력
minhee
0
56
Embracing yak shaving
minhee
1
48
BotKit by Fedify:誰でも簡単に作れるActivityPubボット
minhee
0
190
国漢文混用体からHolloまで
minhee
2
660
Fedify — ActivityPub 서버 프레임워크
minhee
1
100
Other Decks in Programming
See All in Programming
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.7k
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
1
110
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.7k
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
340
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
240
初めてのKubernetes 本番運用でハマった話
oku053
0
120
コーディングルールの鮮度を保ちたい for SRE NEXT 2026 / keep-fresh-go-internal-conventions-sre-next-2026
handlename
0
120
フィードバックで育てるAI開発
kotaminato
1
100
Creating Composable Callables in Contemporary C++
rollbear
0
190
関数型プログラミングのメリットって何だろう?
wanko_it
0
140
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
300
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
130
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Optimizing for Happiness
mojombo
378
71k
The SEO Collaboration Effect
kristinabergwall1
1
500
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Technical Leadership for Architectural Decision Making
baasie
3
430
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
220
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.6k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Transcript
ೞझுҗ ఋੑ ഘ൞ http://hongminhee.org/
Data type • օܻ ॳח ߣয: ܐഋ • ୶ஏೡ ࣻ
٠, ܐ(data)ܳ ࠙ܨ(type)ೞח Ѫ • Ӓۢ ࠙ܨೠ ܐٜ যڌѱ ࢤӟ Ѫੌө?
Value • օܻ ॳח ߣয: ч • য٥оী ഃࢲ աী
੍൧ ࣻ • ଃীࢲ ଃਵ۽ ೧ ࣻ
Value • օܻ ॳח ߣয: ч • ݫݽܻա ٣झী ೞҊ
աী ৌযࠅ ࣻ • ֎ਕܳ ా೧ ࣠ؼ ࣻ
Value • օܻ ॳח ߣয: ч • ܴয ࣻب Ҋ,
ܴ যڃ чਸ ڷೞחب ঌ ࣻ • ೣࣻ ੋ۽ ٜযт ࣻب Ҋ, ೣࣻ۽ࠗఠ աৢ ࣻب
ч > let factorial n = product [1..n] > let
x = 10 > factorial x 3628800
ܴয ࣻ > let factorial n = product [1..n]
> let x = 10 > factorial x 3628800
ܴ ڷਸ ঌ ࣻ > let factorial n =
product [1..n] > let x = 10 > factorial x 3628800
ೣࣻ ੋ۽ ٜযт ࣻ > let factorial n =
product [1..n] > let x = 10 > factorial x 3628800
ೣࣻ۽ࠗఠ աৢ ࣻ > let factorial n = product
[1..n] > let x = 10 > factorial x 3628800
ч ࢿ • чٜ ݃ ةౠೠ ࢿ • 1
? 2. Ӓۢ 2 ? 3. • ['a', 'b', 'c'] ӡח? 3. • [] ? ݾ۾ೠప ‘’ۆ ަө? • 1 ӡח? ࣻೠప ‘ӡ’ۆ ަө?
ч ࢿ > succ 1 2 > succ 2 3
> length ['a', 'b', 'c'] 3
ч ࢿ > succ ['a', 'b', 'c'] <interactive>:16:1: No instance
for (Enum [Char]) arising from a use of ‘succ’ In the expression: succ ['a', 'b', 'c'] In an equation for ‘it’: it = succ ['a', 'b', 'c']
ч ࢿ > length 1 <interactive>:17:8: No instance for (Num
[a0]) arising from the literal ‘1’ In the first argument of ‘length’, namely ‘1’ In the expression: length 1 In an equation for ‘it’: it = length 1
ܐഋ • чٜ ݃ ةౠೠ ࢿ • Ӓ۞ա ࢿ
൚ࢎೠ Ѫՙܻ ݽইࢲ ࠙ܨೡ ࣻ • ‘’ Ҋ, ف ч ‘’ чٜ ‘эਵݶ’ ف ч ‘эҊ’, ‘؊ೡ ࣻ’ Ҋ, ‘ࡓ ࣻ’ب Ҋ… → ࣻ ܐഋ • 0ѐ ࢚ чਸ ‘ನೣ’ೡ ࣻ Ҋ, ನೣػ чٜ ࢎী ‘ࣽࢲ’ о Ҋ… → ݾ۾ ܐഋ
ܐഋ • ࠺तೠ ࢿ чٜਸ ݽইفݶ ಞܻೞ • о۸, ؔࣅਸ
ೡ ٸ ‘؊ೡ ࣻ ח’ ࢿ чٜ݅ ߉Ҋ र → ࣻ ܐഋ݅ ߉ਵݶ ػ • о۸, іࣻܳ ҳೡ ٸ ‘чਸ ನೣೡ ࣻ ח’ ࢿ чٜ݅ ߉Ҋ र → ݾ۾ ܐഋ݅ ߉ਵݶ ػ
factorial ࣻ݅ ߉ח > factorial ['a', 'b', 'c'] <interactive>:26:1: No
instance for (Num [Char]) arising from a use of ‘factorial’ In the expression: factorial ['a', 'b', 'c'] In an equation for ‘it’: it = factorial ['a', 'b', 'c']
ч ܐഋ (पઁח ࠁ ખ؊ ࠂפ) > let factorial n
= product ([1..n] :: [Integer]) :: Integer > let x = 10 :: Integer > factorial x :: Integer 3628800 :: Integer
ܐഋ ঌইࠁӝ (पઁח ࠁ ખ؊ ࠂפ) > :t x x
:: Integer > :t factorial factorial :: Integer -> Integer
ৈӝࢶ ܖ ঋח ઁ • ࣻ ܐഋ (algebraic data
type) • Parametric polymorphism • ఋੑېझ (typeclass) • ⊥ (bottom) • ӝఋ ١١. ೞ݅ ށۄب ੌױ ೞझு ٬ द оמ
ࠗप೧ࢲ દ࣠פ bit.ly/haskell-kr-2015-04-04-type