Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Haskell Introduction
Search
Seiya
July 14, 2018
Technology
0
100
Haskell Introduction
プログラミング言語のHaskellの紹介スライドです。
JOI2017夏季セミナーで作った資料な気がします。
Seiya
July 14, 2018
Tweet
Share
More Decks by Seiya
See All by Seiya
おうちGitLabのススメ
silmin_
3
1.4k
Git入門
silmin_
30
17k
暗号について
silmin_
0
150
LinuxCommand入門
silmin_
0
350
LinuxCommand入門2
silmin_
0
250
Webについて
silmin_
3
170
ネットワークとは
silmin_
0
220
コンピュータとは|初心者向け資料
silmin_
1
170
ビットについて|入門者向け資料
silmin_
0
200
Other Decks in Technology
See All in Technology
Challenging Hardware Contests with Zephyr and Lessons Learned
iotengineer22
0
190
Playwrightのソースコードに見る、自動テストを自動で書く技術
yusukeiwaki
13
5.3k
コンテキスト情報を活用し個社最適化されたAI Agentを実現する4つのポイント
kworkdev
PRO
0
690
re:Invent 2025 ふりかえり 生成AI版
takaakikakei
1
200
モダンデータスタック (MDS) の話とデータ分析が起こすビジネス変革
sutotakeshi
0
470
Lambdaの常識はどう変わる?!re:Invent 2025 before after
iwatatomoya
1
480
re:Invent2025 コンテナ系アップデート振り返り(+CloudWatchログのアップデート紹介)
masukawa
0
360
RAG/Agent開発のアップデートまとめ
taka0709
0
170
5分で知るMicrosoft Ignite
taiponrock
PRO
0
350
AWSを使う上で最低限知っておきたいセキュリティ研修を社内で実施した話 ~みんなでやるセキュリティ~
maimyyym
2
390
MapKitとオープンデータで実現する地図情報の拡張と可視化
zozotech
PRO
1
140
30分であなたをOmniのファンにしてみせます~分析画面のクリック操作をそのままコード化できるAI-ReadyなBIツール~
sagara
0
130
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Designing for humans not robots
tammielis
254
26k
Become a Pro
speakerdeck
PRO
31
5.7k
Producing Creativity
orderedlist
PRO
348
40k
Making Projects Easy
brettharned
120
6.5k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Code Review Best Practice
trishagee
74
19k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Building Applications with DynamoDB
mza
96
6.8k
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 !!!