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
mina
July 14, 2018
Technology
0
90
Haskell Introduction
プログラミング言語のHaskellの紹介スライドです。
JOI2017夏季セミナーで作った資料な気がします。
mina
July 14, 2018
Tweet
Share
More Decks by mina
See All by mina
おうちGitLabのススメ
silmin_
3
1.1k
Git入門
silmin_
23
14k
暗号について
silmin_
0
120
LinuxCommand入門
silmin_
0
320
LinuxCommand入門2
silmin_
0
220
Webについて
silmin_
3
140
ネットワークとは
silmin_
0
190
コンピュータとは|初心者向け資料
silmin_
1
140
ビットについて|入門者向け資料
silmin_
0
170
Other Decks in Technology
See All in Technology
Things you never dared to ask about LLMs — v2
glaforge
1
460
Oracle Cloud Infrastructure:2025年5月度サービス・アップデート
oracle4engineer
PRO
0
300
Data Hubグループ 紹介資料
sansan33
PRO
0
1.7k
LT:組込み屋さんのオシロが壊れた!
windy_pon
0
220
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
1
7.1k
技術書典18結果報告
mutsumix
1
160
オープンソースのハードウェアのコンテストに参加している話
iotengineer22
0
400
Oracle Database オプティマイザ・ヒントの活用
oracle4engineer
PRO
1
130
“新卒らしさ”を脱ぎ捨てて 〜1年を経て学んだこと〜
rebase_engineering
0
120
Microsoft Season of Agent AI エージェントの使用開始
takas0522
0
120
新卒から4年間、20年もののWebサービスと向き合って学んだソフトウェア考古学 - PHPカンファレンス新潟2025 / new graduate 4year software archeology
oguri
2
330
初めてのGoogle Cloud by AWS出身者
harukasakihara
1
720
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
Docker and Python
trallard
44
3.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.7k
Six Lessons from altMBA
skipperchong
28
3.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
25
2.8k
The Invisible Side of Design
smashingmag
299
50k
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
For a Future-Friendly Web
brad_frost
178
9.7k
Designing for Performance
lara
608
69k
BBQ
matthewcrist
88
9.7k
Building a Modern Day E-commerce SEO Strategy
aleyda
40
7.3k
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 !!!