Soumettre la recherche
Mettre en ligne
Haskell golf intro
•
Télécharger en tant que KEY, PDF
•
3 j'aime
•
2,072 vues
N
notogawa
Suivre
第4回 スタートHaskell2 LT
Lire moins
Lire la suite
Signaler
Partager
Signaler
Partager
1 sur 14
Télécharger maintenant
Recommandé
Haskell Lecture 2
Haskell Lecture 2
Yusuke Matsushita
グラフィックにおける数学的モチーフ
グラフィックにおける数学的モチーフ
Ayumu Nagamatsu
Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)
Masahiro Sakai
An engineer uses monads
An engineer uses monads
Kousuke Ruichi
折り紙とコンパスで計算してみよう@ノラヤ・サイエンス・バー
折り紙とコンパスで計算してみよう@ノラヤ・サイエンス・バー
Junpei Tsuji
正規表現で作るワンライナーライフゲーム
正規表現で作るワンライナーライフゲーム
manaten
「日曜数学のススメ 」情報科学若手の会・冬の陣2015 #wakate2015w
「日曜数学のススメ 」情報科学若手の会・冬の陣2015 #wakate2015w
Junpei Tsuji
定規とコンパスで足し算 科学勉強会第二回公開発表会
定規とコンパスで足し算 科学勉強会第二回公開発表会
Junpei Tsuji
Recommandé
Haskell Lecture 2
Haskell Lecture 2
Yusuke Matsushita
グラフィックにおける数学的モチーフ
グラフィックにおける数学的モチーフ
Ayumu Nagamatsu
Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)
Masahiro Sakai
An engineer uses monads
An engineer uses monads
Kousuke Ruichi
折り紙とコンパスで計算してみよう@ノラヤ・サイエンス・バー
折り紙とコンパスで計算してみよう@ノラヤ・サイエンス・バー
Junpei Tsuji
正規表現で作るワンライナーライフゲーム
正規表現で作るワンライナーライフゲーム
manaten
「日曜数学のススメ 」情報科学若手の会・冬の陣2015 #wakate2015w
「日曜数学のススメ 」情報科学若手の会・冬の陣2015 #wakate2015w
Junpei Tsuji
定規とコンパスで足し算 科学勉強会第二回公開発表会
定規とコンパスで足し算 科学勉強会第二回公開発表会
Junpei Tsuji
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
Contenu connexe
En vedette
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
En vedette
(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 golf intro
1.
Haskell golf への
おさそい notogawa
2.
だれ? • 大川 徳之 •
notogawa • Haskell golfer
3.
golf ? • code
golf (short codingとも) • 「より少ないバイト数で所与の課題 をプログラミングする遊び。より少 ない打(鍵)数を競うところがゴルフに 似ているところからの命名。」(はて なキーワードより)
4.
Haskell golf 場 •
Haskell golf といえば • anarchy golf • AtCoder でもできなくはない?
5.
おもしろいの?
6.
実際タノシイ! • パズルや制限プレイの感覚と同じ • 雰囲気がよくわかるエントリー
• あなごるの楽しみ方
7.
Haskell golf の特徴 •
抽象的にみると短くなりやすい! • 短かくなってもわかりやすい!
8.
やってみよう! • 第1回スタートHaskell2 練習問題
より • 1 から 10 までのすべての整数で割り切れ る数字 • 簡単のため最小の1個を出力としましょう
9.
普通に書くと • うろおぼえですが当時出てた回答例 main
:: IO () main = print $ head [ n | n <- [ 1 .. ] , and [ 0 == mod n d | d <- [ 1 .. 10 ] ] ] こんなだったような?(当時はまだIOやって ないので,適当に加えました)
10.
この問題って結局... • 1∼10で割り切れる数 •
= 1∼10の公倍数 • 最小公倍数の関数があるじゃない • lcm :: Integral a => a -> a -> a
11.
縮めていこう main :: IO
() main = print $ 1 `lcm` 2 `lcm` 3 `lcm` 4 `lcm` 5 `lcm` 6 `lcm` 7 `lcm` 8 `lcm` 9 `lcm` 10 アッ!この計算foldだ!進研ゼミで(ry main :: IO () main = print $ foldl1 lcm [ 1 .. 10 ] なくてもいい型シグネチャや空白を消す main=print$foldl1 lcm[1..10]
12.
危険性 • golfしかできなくなる •
「Haskellわかりませんがgolfはでき ます.」という謎スキル • お仕事では控えたほうがいいかも • やるなよ?やるなよ?
13.
おわり やさしいgolfer達がみんなを待ってます
14.
文献 •
Haskell Golf 入門 • Short Coding 職人達の技法 • Haskellじゃないけど参考になる
Notes de l'éditeur
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Télécharger maintenant