一言でいうと、Comonadからcopoint*1を除いたものです。
- http://mth.io/talks/zippers-and-comonads/#/44
- つい先日のmarkhibberdさんのスライドの中では「SemiComonad」と呼んでいた
- https://gist.github.com/tonymorris/5572544
- scalaのOptionとListにcoflatMapとcoflattenあると便利では?というやつ?
- https://github.com/tonymorris/type-class/blob/a2b2c5f007a8e3975def37/src/Data/Functor/Extend.hs
- これはたぶん↑tonymorrisさんが考えた「理想のtypeclassの継承関係」という感じのプロジェクト?(継承関係だけ表されてて、instanceがほとんどない。少なくとも現状まったく実用は考えてない感)
- https://gist.github.com/tonymorris/3871764/2a1ade28d70f79c29bec0ece8bd997ff7574823b#file-typeclass-hs-L72-L75
- おそらくそれ(僕の考えた理想のtypeclassの継承関係)を、githubに移す前にgist上で試行錯誤していたもの?
これが本当に有用ならばScalazの場合は以下のように
https://github.com/xuwei-k/scalaz/commit/5487aa1075e74b
もしくは以下のように、OptionやListなどを既存のCojoinとCobindのインスタンスにすればいいと思うのだけれども
https://github.com/xuwei-k/scalaz/commit/af0d3dbdad77b4
なぜ、そうなってないのだろう。*2
これ最初に書いた数時間後に実装された・・・
https://github.com/scalaz/scalaz/commit/c9ab4bdab91b3d3a797
https://github.com/scalaz/scalaz/commit/86685074715425ae2d1
というか、先にcoflatmapとcoflatten直接実装してたからコメントした
https://github.com/scalaz/scalaz/commit/db10e6202a7270ed657c52bf03d94d131aa3376e#commitcomment-3253093
ちなみにHaskellの場合、現在 ekmett/semigroupoids にExtendがあります。
これ、実は昔は ekmett/comonad にあって、
class Extend w => Comonad w where
と、Commonad は Extend を継承していたようです!
- https://github.com/ekmett/comonad/commit/532c2c324463c
- https://github.com/ekmett/comonad/commit/a847f527a8fe32#L0L47
- https://github.com/ekmett/semigroupoids/commit/77b232686280#L1R28
なぜ 継承しなくなって、しかも semigroupoids に移したのだろう・・・色々と謎