Submit Search
Upload
ゆるふわなHaskell話
•
10 likes
•
4,535 views
Kousuke Ruichi
Follow
Technology
Report
Share
Report
Share
1 of 55
Download now
Download to read offline
Recommended
Haskell Day2012 - 参照透過性とは何だったのか
Haskell Day2012 - 参照透過性とは何だったのか
Kousuke Ruichi
並行プログラミングと継続モナド
並行プログラミングと継続モナド
Kousuke Ruichi
An engineer uses monads
An engineer uses monads
Kousuke Ruichi
Purescript with Monad
Purescript with Monad
Kousuke Ruichi
数学プログラムを Haskell で書くべき 6 の理由
数学プログラムを Haskell で書くべき 6 の理由
Hiromi Ishii
磯野ー!関数型言語やろうぜー!
磯野ー!関数型言語やろうぜー!
Ra Zon
圏とHaskellの型
圏とHaskellの型
KinebuchiTomo
grpc-haskell.pdf
grpc-haskell.pdf
Kousuke Ruichi
Recommended
Haskell Day2012 - 参照透過性とは何だったのか
Haskell Day2012 - 参照透過性とは何だったのか
Kousuke Ruichi
並行プログラミングと継続モナド
並行プログラミングと継続モナド
Kousuke Ruichi
An engineer uses monads
An engineer uses monads
Kousuke Ruichi
Purescript with Monad
Purescript with Monad
Kousuke Ruichi
数学プログラムを Haskell で書くべき 6 の理由
数学プログラムを Haskell で書くべき 6 の理由
Hiromi Ishii
磯野ー!関数型言語やろうぜー!
磯野ー!関数型言語やろうぜー!
Ra Zon
圏とHaskellの型
圏とHaskellの型
KinebuchiTomo
grpc-haskell.pdf
grpc-haskell.pdf
Kousuke Ruichi
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
Atomu Hidaka
20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory
osamut
プレイマットのパターン生成支援ツール
プレイマットのパターン生成支援ツール
sugiuralab
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
iPride Co., Ltd.
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
iPride Co., Ltd.
プレイマットのパターン生成支援ツールの評価
プレイマットのパターン生成支援ツールの評価
sugiuralab
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
danielhu54
PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000
Shota Ito
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
More Related Content
Recently uploaded
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
Atomu Hidaka
20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory
osamut
プレイマットのパターン生成支援ツール
プレイマットのパターン生成支援ツール
sugiuralab
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
iPride Co., Ltd.
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
iPride Co., Ltd.
プレイマットのパターン生成支援ツールの評価
プレイマットのパターン生成支援ツールの評価
sugiuralab
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
danielhu54
PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000
Shota Ito
Recently uploaded
(8)
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory
プレイマットのパターン生成支援ツール
プレイマットのパターン生成支援ツール
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
プレイマットのパターン生成支援ツールの評価
プレイマットのパターン生成支援ツールの評価
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000
Featured
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Featured
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
ゆるふわなHaskell話
1.
ゆるふわなHaskell話 @ruicc 13年6月23日日曜日
2.
誰 @ruicc Haskeller 13年6月23日日曜日
3.
ゆるふわな話 IOの話 13年6月23日日曜日
4.
IOの話 13年6月23日日曜日
5.
よく聞きそうな話 「HaskellはIO実行が簡単に出来な い、つらい」 13年6月23日日曜日
6.
Haskeller視点 「大抵の言語はIOがいつでもどこでも 実行出来てしまって危険極まりない、 つらい」 13年6月23日日曜日
7.
それを聞いた非Haskeller Haskellは副作用使用罪がある! コワイ! 僕:それは怖いねー(棒読み) 13年6月23日日曜日
8.
もう少し詳しく見る 「HaskellはIO実行が簡単に出来な い、(ちょっとしたスクリプト感覚で 書けなくて)つらい」 13年6月23日日曜日
9.
もう少し詳しく見る 「大抵の言語はIOがいつでもどこでも 実行出来てしまって危険極まりない、 (チーム開発時やコードの保守やコー ドの再利用性が無くて)つらい」 13年6月23日日曜日
10.
要は見ている問題が違う 全ての言語への言及は「適材適所」を 詳しく語ったもの 13年6月23日日曜日
11.
以降 ゆるふわな心で お楽しみください。 13年6月23日日曜日
12.
IOの何が問題なのか? IO実行を書く事は プログラムに「制御不可能なコード」 を埋め込むこと 13年6月23日日曜日
13.
例えば現在時刻の取得 現在時刻取得はIO実行 リアルワールドの参照 time = getTime();
// IO発生!! 13年6月23日日曜日
14.
例えば現在時刻の取得 関数の中で現在時刻を取得してみる var f =
function doSomething() { var time = getTime(); // IO!! // do something... } ➡ リアルワールドの現在時刻に依存した!!! ➡ 制御不可能な値に依存する関数は筋が悪い 13年6月23日日曜日
15.
制御不可能な関数 IOが含まれる制御不可能な関数 テストがつらい 再利用時につらい 保守がつらい 13年6月23日日曜日
16.
じゃあどうする シングルトンパターンを使うよ! えっ 13年6月23日日曜日
17.
シングルトンパターン シングルトンという名のグローバル変数 グローバル変数に依存した関数 テストがつらい 再利用時につらい 保守がつらい 13年6月23日日曜日
18.
じゃあどうする RubyならOpen classで出来るよ! えっと 13年6月23日日曜日
19.
それXXX言語ならできるよ 言語依存の機能 まあいいんですけど いいんですよ 何も問題は無い...その言語なら。 13年6月23日日曜日
20.
もっと一般的に問題を解く 開発サーバの実行時間変えるよ! はい 13年6月23日日曜日
21.
言語の外を触る 言語からは制御出来ない、言語の外の 部分を変更する 人間がナニカを保証する必要がある テストが終わったら元に戻す 他に影響を出さない 保守対象が増える 13年6月23日日曜日
22.
言語内で問題を解く 関数の外部でIO実行、引数で渡す var f =
function doSomething(time) { // do something... } ➡ IOは発生しない ➡ 安全!再利用しやすい!保守しやすい! 13年6月23日日曜日
23.
引数渡しは何か問題が? 引数を引き回す事はあまり問題ではない テスト可能性が低下するよりマシ 保守性が低下するよりマシ 再利用性が低下するよりマシ 13年6月23日日曜日
24.
IOは隔離する 引数引き回しはともかく、 IO実行部分は隔離することが望ましい 言語によらない 13年6月23日日曜日
25.
IOと設計 getTimeを例に考えてきた 制御不能部分を考えることは、設計行為 ➡ IOを考える事は、設計行為 13年6月23日日曜日
26.
おまけ 引数を一つ増やす? そうですねいろんな所が増えそうですね 13年6月23日日曜日
27.
引数引き回しはダサいか 引数引き回しがダサいという風潮 ...がある気がする 意味がわからないよ! ダサさの前に問題を解こうぜ 13年6月23日日曜日
28.
引数引き回し問題 それが問題になるなら問題を解こう 引数引き回し問題は、IOとは別問題 Readerモナモナ ここでは触れません 13年6月23日日曜日
29.
まとめ:IOとは どんな言語でも、 大抵のプログラムでは、 設計上、 隔離するべきもの HaskellはIOを型で検知するに過ぎない 13年6月23日日曜日
30.
IOが隔離不可能な場合 IOの隔離が出来ない場合はどうする? 13年6月23日日曜日
31.
次の問題 IOと切り離せないドメインはどうする Graphics Sounds GUI REPL 13年6月23日日曜日
32.
素直に書く 全ての関数IO直書きするよ! ふむ 13年6月23日日曜日
33.
IO直書き IOがいつ何処で発生するか分からない 他の言語と変わらない 13年6月23日日曜日
34.
つまり D4Cが発生する まちがいない 13年6月23日日曜日
35.
D4C いともたやすく行われるえげつない行為 dirtyDeedsDoneDirtCheap :: IO
President チーム開発中に能力が発現 よくわからないところにありえないコードが 埋没している 保守を壊滅的にしてくれる 13年6月23日日曜日
36.
D4Cは防がねばならない 13年6月23日日曜日
37.
自分でコンテキスト作成 Monad TransformerでIOくるむよ! えーと 13年6月23日日曜日
38.
モナド変換子 liftIOで結局IO使い放題 いつIOが起こるか分からない! newtype MyIO a
= MyIO { runMyIO :: IO a } deriving (Functor, Monad, MonadIO) main = runMyIO $ do myPutStrLn “Hello, MyWorld!” liftIO $ dirtyDeedsDoneDirtCheap -- D4C 13年6月23日日曜日
39.
モナド変換子では D4Cは防げない 13年6月23日日曜日
40.
Symantics... 特定のアクションを束ねるよ! Symanticsは詳しく知らないが.. Symantcs = Syntax
+ Semantics 13年6月23日日曜日
41.
SymanticsとIO 結局副作用にはIOモナドが要る 注:元々SymanticsはIOをなんとかするものではない composedAction :: Monad
m => Database m -> m () composedAction db = do insert db "foo" insert db "bar" dirtyDeedsDoneDirtCheap -- D4C http://mizondev.net/d/20130420 13年6月23日日曜日
42.
やはり D4Cは防げない 13年6月23日日曜日
43.
Free Monadを使う Free Monad DSLが簡単に生成出来るモナド プログラムを表現と解釈に分離 13年6月23日日曜日
44.
Free Monad as
a Limited IO! Freeを制限されたIOとして使う 安全! ゆるふわ! D4Cから守られたコンテクスト! モナド! お馴染みの書き方で書ける 13年6月23日日曜日
45.
まとめ: IOは制限する IOは制限し、必要な箇所で必要な分量 だけ使う 言語によらないはずだが.. 13年6月23日日曜日
46.
IOを制限出来る言語 Haskell Agda Idris ➡要するにHaskell 13年6月23日日曜日
47.
初めの発言 「HaskellはIO実行が簡単に出来な い、つらい」 13年6月23日日曜日
48.
なにHaskellはIOが厳しい? 逆に考えるんだ 「他にIOをまともに扱う 言語が存在しないんだ」 と考えるんだ 13年6月23日日曜日
49.
いや本当にIOをコントロール出来ない 言語ばかりなの何故ですかね Haskellerが抱く 13年6月23日日曜日
50.
IO Monadは 悪なのか? 13年6月23日日曜日
51.
IO Monad IO Monadは悪という風潮 ...がある気がする 気持ちはわからなくはない 13年6月23日日曜日
52.
他言語とIO 他言語では常にIOコンテキスト下 HaskellをIOだけで書いても Scala,OCaml,F#と同程度の安全性 13年6月23日日曜日
53.
私見 必要であればIOモナドにガリガリ書い てもいいと思いますよ。 13年6月23日日曜日
54.
まとめ:IOとは どんな言語でも 制御されるべきもの しかしそれが可能な言語は何故か少ない 13年6月23日日曜日
55.
ゆるふわなHaskell話でした。 13年6月23日日曜日
Download now