PS

Haskell

String diagram による Applicative functor まとめ

Applicative Functors with Strings Applicative functor の記事をまとめました。 strcat/strapp.pdf at master · okomok/strcat · GitHub

Applicative functors in string diagrams rev.2

(役に立つような立たないような・・・) Comma operator Evaluation operator Applicative functors To monoidal functors とすると LiftAn 以上から直ちに: 参考文献 Applicative functors in String diagrams - PS

Reader monad transformers in string diagrams

(図にしてみれば怖くない・・・かも) Reader monad transformers Reader monads 上図の太枠を取り除いたもの。 参考文献 transformers: Concrete functor and monad transformers | Hackage scala - Is it just a coincidence that Kleisli, ReaderT, and Reade…

Haskell-monads in string diagrams rev.2

(・・・といっても Monads in string diagrams - PS にするしかなさそう) Haskell-monads To monads とすると 参考文献 Haskell-monad - PS

Cofree comonads in String diagrams

Cofree comonad Data *1 Implementations 再帰的に定義する(合わせ鏡のように)。 Functions 参考文献 Control.Comonad.Cofree *1:iso は真四角にした

Store comonads in String diagrams

Store(Costate) comonad Functions 参考文献 haskell - What is the Store comonad? - Stack Overflow

Haskell-comonads in String diagrams

@deprecated @todo ・・・と言っても Haskell-monads in String diagrams - PS を上下さかさまにしただけ。*1 Haskell-comonad Laws Functions 参考文献 https://hackage.haskell.org/package/comonad/docs/Control-Comonad.html All About Comonads (Part 1).p…

String diagram のすすめ

こちらは Haskell Advent Calendar 2015 - Qiita の 20 日目の記事です。 前の日・・・Hakyllでブログを作る(実践編) - Wake up! Good night* 次の日・・・「第2期 H本読書会 in 秋葉原」を終えて #readhbon #haskell - セカイノカタチ String diagram String diag…

Arrows in String diagrams

Arrow laws (・・・やっぱりつらいので左右逆にならないようにする) 以下、水平方向は考えないで、垂直方向のみ 1-category の composition とする。 メモ 「1.」と「 2.」は の functoriality。 「6.」は の についての extranaturality。 ただし、naturality …

Free monads in String diagrams

(・・・というのは少し嘘かもしれない) Catamorphisms Free monad - PS の より・・・ Free monad 参考文献 Haskell for all: Why free monads matter Control.Monad.Free

Traversable functors in String diagrams

Identity functor Constant functor Traversable functor Traversable functor laws Traversable functor - PS より・・・ foldMap/foldr 参考文献 Foldable and Traversable - Jakub Arnold Blog

Applicative functors in String diagrams

@deprecated 代わりに Applicative functors in string diagrams rev.2 - PS を参照。 以下、curry/uncurry したものは区別にしないことにする。 (右足を上げたり下げたりするだけ) Applicative functor Applicative functor laws Monoidal functors via app…

Identity monads in String diagrams

Identity monad 参考文献 All About Monads - HaskellWiki

List monads in String diagrams

Concatenation List monad 参考文献 All About Monads - HaskellWiki

Error monads in String diagrams

Error monad Maybe monad の を にしただけ。 throw/catch 参考文献 All About Monads - HaskellWiki haskell - Is there no standard (Either a) monad instance? - Stack Overflow

Maybe monads in String diagrams

Universality of coproducts Merge morphism Initializing morphism (とはたぶん言わない) Monoidal category with finite coproducts Cocartesian monoidal category ともいう。 命題 Maybe monad 参考文献 [1401.7220] Category Theory Using String Diagr…

Continuation monads in String diagrams

Evaluation Continuation monad Flip bijection を使って・・・ callCC ・・・かえって分かりにくい。 参考文献 All About Monads - HaskellWiki

Writer monads in String diagrams

Writer monad 参考文献 All About Monads - HaskellWiki

Reader monads in String diagrams

@deprecated 代わりに Reader monad transformers in string diagrams - PS を参照。 Constant morphism Reader monad を たちにばらまいている。 参考文献 All About Monads - HaskellWiki

State monads in String diagrams

Monoidal category にて・・・ Diagonal morphism Naturality Terminating morphism (とはたぶん呼ばない) Naturality これらは、より一般には cartesian monoidal category のときに作れる。 State monad get/put 参考文献 [1203.0202] Pictures of Processes:…

Haskell-monads in String diagrams

@deprecated 代わりに Haskell-monads in string diagrams rev.2 - PS を参照。 Monoidal category にて・・・ Haskell-monad の flip 版を使った方が分かりやすいみたい。*1 Haskell-monad laws Kleisli composition Haskell-monad @deprecated Haskell-monad …

Adjunction からの monad transformer

Adjunctionからのmonad - PS を一般化する。 Adjunction-associated monoidal functor (と呼んでいいと思う) Adjunction: について は monoidal functor: になる。 Monad sandwich Monoid lifting により functor: を作ることが出来る。 State monad transfo…

Continuation monad

Association between monads and adjunctions monad: adjunction: について を満たすとき、互いに associated というのであった。 Identity monad identity functor: identity natural transformation: は monad になる。 Trivial adjunction さらに とする…

Reader monad

Opposite monoidal category Monoidal category: について *1 は、monoidal categoryになる(と思う)ので と書くことにする。 *2 Comonoid object そのopposite monoidal categoryにおけるmonoid objectのこと。 Trivial comonoid object Monoidal category w…

Writer monad

Monoid lifting Monoidal functors send monoids to monoids: Monoidal functor: について、functor: *1 を定義できる。 Monads from monoids 特に、 のcodomainがmonoidal category of endofunctors: のとき *2 Writer monad とすると、monoidal functor: …

fold/build fusion

命題 endofunctor: forgetful functor: について、initial algebra: が存在するならば、そのcatamorphimの族: は、mediatorを とする limiting cone of になる: (fold/build fusion) 参考文献 Initial algebra semantics is enough

GADTs

複雑なGADTsはYoneda lemmaを使ってInductive family of types - PSにもっていける、ということらしい。 例 data Z data S n data IntList n where Nil :: IntList Z Cons :: Int -> IntList m -> IntList (S m) Covariant Yoneda lemma: をこっそり使って *…

Inductive family of types

(Higher inductive types・・・と言いたいがそれはまた別物らしい。) Family of inductive types たとえば、Free monad - PS: は、 をfixed pointとするinitial algebraが族になっているだけ(で問題ない)。 Inductive family of types 一方、free applicativeに…

Traversable functor

記法 Category of applicative functors - PS Traversable functor その1 functor: natural transformation: *1 のペアで (unitality) (linearity) を満たすもの。 Traversable functor その2 functor: natural transformation: *2 のペアで (identity) (com…

Category of applicative functors

Applicative morphism 二つのapplicative functor: の間のmorphismを を満たすnatural transformation: とする。 Monoidal morphism Applicative functorはmonoidal endofunctorで表現できたので、同様に 二つのmonoidal endofunctor on monoidal or : の間…