SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
姫路 IT 系勉強会 Vol.11
           L1 グランプリ
               Haskell

                               @kakkun61


姫路 IT 系勉強会 Vol. 11 @kakkun61               1/27
自己紹介
 ●   岡本和樹
 ●   @kakkun61
 ●   23 歳
 ●   大阪府立大学 4 回生
 ●   Haskell 歴 本格的には半年ぐらい



姫路 IT 系勉強会 Vol. 11 @kakkun61   2/27
Haskell




姫路 IT 系勉強会 Vol. 11 @kakkun61   3/27
Haskell




姫路 IT 系勉強会 Vol. 11 @kakkun61   4/27
Haskell
 ●   純粋関数型
 ●   遅延評価
 ●   参照透明
 ●   代数的データ型
 ●   モナド



姫路 IT 系勉強会 Vol. 11 @kakkun61   5/27
Haskell
 ●   純粋関数型
 ●   遅延評価
 ●   参照透明
 ●   代数的データ型
 ●   モナド
                      こわくないよ !
姫路 IT 系勉強会 Vol. 11 @kakkun61     6/27
Haskell
 ●   とりあえず『すごい Haskell たのしく学
     ぼう!』読む
 ●   読んだら気付いたら分かってる




姫路 IT 系勉強会 Vol. 11 @kakkun61   7/27
Haskell




姫路 IT 系勉強会 Vol. 11 @kakkun61   8/27
Haskell
 ●   会議で委員会が発足しそこで作られた珍
     しい言語
 ●   学術的な方面からの要請
 ●   1990 年に最初のバージョン




姫路 IT 系勉強会 Vol. 11 @kakkun61   9/27
Haskell
 ●   デファクトスタンダード
 ●   The Glorious Glasgow Haskell
     Compilation System
 ●   GHC
 ●   Simon Peyton Jones と Simon Marlow




姫路 IT 系勉強会 Vol. 11 @kakkun61             10/27
Haskell
 ●   Simon Peyton Jones
 ●   Microsoft Research in Cambridge
 ●   C-- の作者でもある




姫路 IT 系勉強会 Vol. 11 @kakkun61           11/27
問題 1 Fizz Buzz
 ●   1-100 の Fizz Buzz




姫路 IT 系勉強会 Vol. 11 @kakkun61   12/27
問題 1 Fizz Buzz




姫路 IT 系勉強会 Vol. 11 @kakkun61   13/27
問題 1 Fizz Buzz
 ●   fizzbuzz
 ●   数値を取って文字列を返す関数
 ●   1→"1"
 ●   3→"fizz"
 ●   5→"buzz"
 ●   ……


姫路 IT 系勉強会 Vol. 11 @kakkun61   14/27
問題 1 Fizz Buzz
 ●   map fizzbuzz [1..100]
 ●   [1, 2, 3, 4, 5, …… 100]
 ●                ↓
 ●   ["1", "2", "fizz", 4, "buzz", ……
     "buzz"]




姫路 IT 系勉強会 Vol. 11 @kakkun61            15/27
問題 1 Fizz Buzz
 ●   mapM_ putStrLn ["1", "2", "fizz", 4,
     "buzz", …… "buzz"]
 ●   それぞれの要素を 1 行に表示する




姫路 IT 系勉強会 Vol. 11 @kakkun61                16/27
問題 2 GPA 計算
 ●   A-D, F→4-1, 0 に変換し平均
 ●   出典
 ●   AtCoder Regular Contest #3 A 問題




姫路 IT 系勉強会 Vol. 11 @kakkun61           17/27
問題 2 GPA 計算




姫路 IT 系勉強会 Vol. 11 @kakkun61   18/27
姫路 IT 系勉強会 Vol. 11 @kakkun61   19/27
問題 2 GPA 計算




姫路 IT 系勉強会 Vol. 11 @kakkun61   20/27
問題 2 GPA 計算




姫路 IT 系勉強会 Vol. 11 @kakkun61   21/27
問題 3 tail -n 5
 ●   tail -n 5




姫路 IT 系勉強会 Vol. 11 @kakkun61   22/27
問題 3 tail -n 5




姫路 IT 系勉強会 Vol. 11 @kakkun61   23/27
問題 3 tail -n 5
 ●   args -> getArgs
 ●   引数に束縛




姫路 IT 系勉強会 Vol. 11 @kakkun61   24/27
問題 3 tail -n 5
 ●   contents ->
 ●          if null args
 ●                  then getContents
 ●                  else readFile $ head args
 ●   args が null なら標準入力を
 ●   じゃなかったら args の 1 つめのファイル
     名のファイルを読んで contents を束縛
姫路 IT 系勉強会 Vol. 11 @kakkun61                    25/27
問題 3 tail -n 5
 ●   putStr . unlines . reverse . take 5 .
     reverse . lines $ contents
 ●   contents (文字列)を lines で行のリス
     トに変換
 ●   reverse で反転
 ●   take 5 で頭から 5 つだけにする
 ●   reverse で反転

姫路 IT 系勉強会 Vol. 11 @kakkun61                 26/27
問題 3 tail -n 5
 ●   putStr . unlines . reverse . take 5 .
     reverse . lines $ contents
 ●   unlines で行のリストを改行区切りの 1
     つの文字列に
 ●   putStr で出力




姫路 IT 系勉強会 Vol. 11 @kakkun61                 27/27

Mais conteúdo relacionado

Último

プレイマットのパターン生成支援ツール
プレイマットのパターン生成支援ツールプレイマットのパターン生成支援ツール
プレイマットのパターン生成支援ツールsugiuralab
 
20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directoryosamut
 
プレイマットのパターン生成支援ツールの評価
プレイマットのパターン生成支援ツールの評価プレイマットのパターン生成支援ツールの評価
プレイマットのパターン生成支援ツールの評価sugiuralab
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。iPride Co., Ltd.
 
PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000Shota Ito
 
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxIoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxAtomu Hidaka
 
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
新人研修のまとめ       2024/04/12の勉強会で発表されたものです。新人研修のまとめ       2024/04/12の勉強会で発表されたものです。
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。iPride Co., Ltd.
 

Último (8)

プレイマットのパターン生成支援ツール
プレイマットのパターン生成支援ツールプレイマットのパターン生成支援ツール
プレイマットのパターン生成支援ツール
 
20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory
 
プレイマットのパターン生成支援ツールの評価
プレイマットのパターン生成支援ツールの評価プレイマットのパターン生成支援ツールの評価
プレイマットのパターン生成支援ツールの評価
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
 
PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000
 
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxIoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
 
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
新人研修のまとめ       2024/04/12の勉強会で発表されたものです。新人研修のまとめ       2024/04/12の勉強会で発表されたものです。
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
 

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)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 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd 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 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 IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...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
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 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 ChatGPTEverything 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 EngineeringsProduct 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 HealthHow 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.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO 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)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 2024How 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 InsightsSocial 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 2024Trends 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 summary5 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 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 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 IntentGoogle'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 How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe 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...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

姫路 IT 系勉強会 Vol. 11 L1 グランプリ Haskell

  • 1. 姫路 IT 系勉強会 Vol.11 L1 グランプリ Haskell @kakkun61 姫路 IT 系勉強会 Vol. 11 @kakkun61 1/27
  • 2. 自己紹介 ● 岡本和樹 ● @kakkun61 ● 23 歳 ● 大阪府立大学 4 回生 ● Haskell 歴 本格的には半年ぐらい 姫路 IT 系勉強会 Vol. 11 @kakkun61 2/27
  • 3. Haskell 姫路 IT 系勉強会 Vol. 11 @kakkun61 3/27
  • 4. Haskell 姫路 IT 系勉強会 Vol. 11 @kakkun61 4/27
  • 5. Haskell ● 純粋関数型 ● 遅延評価 ● 参照透明 ● 代数的データ型 ● モナド 姫路 IT 系勉強会 Vol. 11 @kakkun61 5/27
  • 6. Haskell ● 純粋関数型 ● 遅延評価 ● 参照透明 ● 代数的データ型 ● モナド こわくないよ ! 姫路 IT 系勉強会 Vol. 11 @kakkun61 6/27
  • 7. Haskell ● とりあえず『すごい Haskell たのしく学 ぼう!』読む ● 読んだら気付いたら分かってる 姫路 IT 系勉強会 Vol. 11 @kakkun61 7/27
  • 8. Haskell 姫路 IT 系勉強会 Vol. 11 @kakkun61 8/27
  • 9. Haskell ● 会議で委員会が発足しそこで作られた珍 しい言語 ● 学術的な方面からの要請 ● 1990 年に最初のバージョン 姫路 IT 系勉強会 Vol. 11 @kakkun61 9/27
  • 10. Haskell ● デファクトスタンダード ● The Glorious Glasgow Haskell Compilation System ● GHC ● Simon Peyton Jones と Simon Marlow 姫路 IT 系勉強会 Vol. 11 @kakkun61 10/27
  • 11. Haskell ● Simon Peyton Jones ● Microsoft Research in Cambridge ● C-- の作者でもある 姫路 IT 系勉強会 Vol. 11 @kakkun61 11/27
  • 12. 問題 1 Fizz Buzz ● 1-100 の Fizz Buzz 姫路 IT 系勉強会 Vol. 11 @kakkun61 12/27
  • 13. 問題 1 Fizz Buzz 姫路 IT 系勉強会 Vol. 11 @kakkun61 13/27
  • 14. 問題 1 Fizz Buzz ● fizzbuzz ● 数値を取って文字列を返す関数 ● 1→"1" ● 3→"fizz" ● 5→"buzz" ● …… 姫路 IT 系勉強会 Vol. 11 @kakkun61 14/27
  • 15. 問題 1 Fizz Buzz ● map fizzbuzz [1..100] ● [1, 2, 3, 4, 5, …… 100] ● ↓ ● ["1", "2", "fizz", 4, "buzz", …… "buzz"] 姫路 IT 系勉強会 Vol. 11 @kakkun61 15/27
  • 16. 問題 1 Fizz Buzz ● mapM_ putStrLn ["1", "2", "fizz", 4, "buzz", …… "buzz"] ● それぞれの要素を 1 行に表示する 姫路 IT 系勉強会 Vol. 11 @kakkun61 16/27
  • 17. 問題 2 GPA 計算 ● A-D, F→4-1, 0 に変換し平均 ● 出典 ● AtCoder Regular Contest #3 A 問題 姫路 IT 系勉強会 Vol. 11 @kakkun61 17/27
  • 18. 問題 2 GPA 計算 姫路 IT 系勉強会 Vol. 11 @kakkun61 18/27
  • 19. 姫路 IT 系勉強会 Vol. 11 @kakkun61 19/27
  • 20. 問題 2 GPA 計算 姫路 IT 系勉強会 Vol. 11 @kakkun61 20/27
  • 21. 問題 2 GPA 計算 姫路 IT 系勉強会 Vol. 11 @kakkun61 21/27
  • 22. 問題 3 tail -n 5 ● tail -n 5 姫路 IT 系勉強会 Vol. 11 @kakkun61 22/27
  • 23. 問題 3 tail -n 5 姫路 IT 系勉強会 Vol. 11 @kakkun61 23/27
  • 24. 問題 3 tail -n 5 ● args -> getArgs ● 引数に束縛 姫路 IT 系勉強会 Vol. 11 @kakkun61 24/27
  • 25. 問題 3 tail -n 5 ● contents -> ● if null args ● then getContents ● else readFile $ head args ● args が null なら標準入力を ● じゃなかったら args の 1 つめのファイル 名のファイルを読んで contents を束縛 姫路 IT 系勉強会 Vol. 11 @kakkun61 25/27
  • 26. 問題 3 tail -n 5 ● putStr . unlines . reverse . take 5 . reverse . lines $ contents ● contents (文字列)を lines で行のリス トに変換 ● reverse で反転 ● take 5 で頭から 5 つだけにする ● reverse で反転 姫路 IT 系勉強会 Vol. 11 @kakkun61 26/27
  • 27. 問題 3 tail -n 5 ● putStr . unlines . reverse . take 5 . reverse . lines $ contents ● unlines で行のリストを改行区切りの 1 つの文字列に ● putStr で出力 姫路 IT 系勉強会 Vol. 11 @kakkun61 27/27