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
Haskell Introduction
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Seiya
July 14, 2018
Technology
0
110
Haskell Introduction
プログラミング言語のHaskellの紹介スライドです。
JOI2017夏季セミナーで作った資料な気がします。
Seiya
July 14, 2018
Tweet
Share
More Decks by Seiya
See All by Seiya
ATProtocol ざっくり概要把握してみた @ DWeb Tokyo Meetup #2
silmin_
0
14
おうちGitLabのススメ
silmin_
3
1.5k
Git入門
silmin_
31
20k
暗号について
silmin_
0
170
LinuxCommand入門
silmin_
0
370
LinuxCommand入門2
silmin_
0
260
Webについて
silmin_
3
180
ネットワークとは
silmin_
0
230
コンピュータとは|初心者向け資料
silmin_
1
180
Other Decks in Technology
See All in Technology
ZOZOにおけるAI活用の現在 ~開発組織全体での取り組みと試行錯誤~
zozotech
PRO
5
5k
Agile Leadership Summit Keynote 2026
m_seki
1
570
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
500
Tebiki Engineering Team Deck
tebiki
0
24k
変化するコーディングエージェントとの現実的な付き合い方 〜Cursor安定択説と、ツールに依存しない「資産」〜
empitsu
4
1.3k
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
150
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
240
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.8k
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
310
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.3k
What happened to RubyGems and what can we learn?
mikemcquaid
0
250
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
870
Featured
See All Featured
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
450
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Faster Mobile Websites
deanohume
310
31k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
320
Done Done
chrislema
186
16k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Between Models and Reality
mayunak
1
180
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Skip the Path - Find Your Career Trail
mkilby
0
53
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
Transcript
Haskell Introduction mina @silmin_
はじめに 「純粋関数型データ構造」という本で純粋関数型(ryを学んだ () これは ➢ 参照透過性 ➢ 永続性 ➢ 副作用のNASA
➢ なんでも関数 ➢ 簡潔かつ混沌() などが特徴(らしい) 今回はHaskellで実装した
Haskell とは 芸術
型宣言 Haskellは美しい data Color = Red | Blue | Yellow
toJpn :: Color -> String toJpn Red = “aka” toJpn Blue = “ao” toJpn Yellow = “ki” main = print $ toJpn Red パターンマッチ 関数実行 & 出力 enum Color { Red, Blue, Yellow };
関数のいろいろ 関数名 引数1 引数2.......で呼び出し temp a b -> a `temp` b とも書ける (
1 + ) , ( 5 * ) : 一引数関数 ( 1 + ) . ( 5 * ) : 関数合成 ( 5倍して1足す関数) f x y = print $ gcd x y f x = print . gcd x f = (print .) . gcd
実行してみる 関数合成
二分探索木(木の定義) data Tree a = Leaf | Node (Tree a)
a (Tree a) Leaf - 末端ノードの先にいる 実質虚無 末 Node - ただのノード 子を持ってる a ... ... 葉 葉
二分探索木(search関数) search::Ord a => Tree a -> a -> Bool
search Leaf b = False search (Node tl a tr) b = if b < a then search tl b else if b > a then search tr b else True 型宣言 パターンマッチ
最後に 興味を持った方は「Haskell Platform」で検索 ※UNIX / Mac の方はパッケージがあるのでinstallしましょう Haskellには光と闇が存在します
Haskell とは 芸術
Thank you for listening !!!