0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Haskellの実装パターン(メモ)

Last updated at Posted at 2024-09-18

目的

Haskellの実装のパターンと応用例の収集。(個人的なメモ)

パターン

実装パターン 説明 実装例
Monoid 単位元(空白文字とか)と結合があるもの 文字列の結合
Semigroup 結合があるもの
Monad ユーザーによる拡張可能な状態・変数を持った手続型のプログラミングを可能にするもの do記法、Maybeモナド、Stateモナドなど。
Monad Transformer モナドの上に異なるモナドを乗せるもの IOモナドにStateモナドを被せるとか。
Reader Monad
Writer Monad
State Monad
Continuation Monad
Free Monad
Indexed Monad
Graded Monad
Comonad Monadの双対 Zipper、他の例(Lensなど)
Applicative
Arrow Monadが出力の型を持っているのに対して、入力の型も持っているもの Functional Reactive Programming,デジタル回路
Functor 何らかの入れ物に入ったデータ型を変換するもの MapReduceのMap
BiFunctor
Profunctor Box
Foldable Reduceの一般化 配列の合計、最大、最小などの集計
Traversable
Lens/Optics
Contravariant Functorの逆 ログの出力のフォーマット変換
Yoneda Fusion
CoYoneda
Representable テンソルのブロードキャスト
GHC.Generics

ToDo

  • Stackageからの応用例の収集

参考文献

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?