- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Monad, co-monad and missing duals?
Dear Scalarazzi,
The monad API provides a way to send code into a collection. This is one way to think about both map and bind. Likewise, the co-monad API provides a way to pull values out of a collection (and/or context). The monad API doesn't serve so well to put values into a collection. The unit natural transformation, for example, would not work well as a put operation into a stream or an add operation on a key-value map because it makes no guarantees about identity of the result, and the more common interpretation would have it that (val ( c1, c2 ) = ( unit( a1 ), unit( a2 ) ); c1 == c2) == false. Likewise, the co-monad API doesn't serve so well to pull code out of a collection. Doesn't it seem like these constitute two unexplored duals of these API's that might be worth investigating?
Best wishes,
--greg
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
7329 39th Ave SWSeattle, WA 98136
+1 206.650.3740
http://biosimilarity.blogspot.com
The monad API provides a way to send code into a collection. This is one way to think about both map and bind. Likewise, the co-monad API provides a way to pull values out of a collection (and/or context). The monad API doesn't serve so well to put values into a collection. The unit natural transformation, for example, would not work well as a put operation into a stream or an add operation on a key-value map because it makes no guarantees about identity of the result, and the more common interpretation would have it that (val ( c1, c2 ) = ( unit( a1 ), unit( a2 ) ); c1 == c2) == false. Likewise, the co-monad API doesn't serve so well to pull code out of a collection. Doesn't it seem like these constitute two unexplored duals of these API's that might be worth investigating?
Best wishes,
--greg
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
7329 39th Ave SWSeattle, WA 98136
+1 206.650.3740
http://biosimilarity.blogspot.com










Re: Monad, co-monad and missing duals?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 16/07/11 03:39, Meredith Gregory wrote:
> Dear Scalarazzi,
>
> The monad API provides a way to send code into a collection. This
> is one way to think about both map and bind. Likewise, the co-monad
> API provides a way to pull values out of a collection (and/or
> context). The monad API doesn't serve so well to put values into a
> collection. The unit natural transformation, for example, would not
> work well as a put operation into a stream or an add operation on a
> key-value map because it makes no guarantees about identity of the
> result, and the more common interpretation would have it that (val
> ( c1, c2 ) = ( unit( a1 ), unit( a2 ) ); c1 == c2) == false.
> Likewise, the co-monad API doesn't serve so well to pull code out
> of a collection. Doesn't it seem like these constitute two
> unexplored duals of these API's that might be worth investigating?
>
> Best wishes,
>
> --greg
>
That, and many many more useful APIs.
Scalaz7 includes Monad, Comonad, MonadTrans, ComonadTrans.
- --
Tony Morris
http://tmorris.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk4grxoACgkQmnpgrYe6r60sSQCfQJLP/l9u8j2+ZoD+qHe3YIxx
7QAAoJC3jNx63DOfe+7aCiAi5xEsMBe6
=OZOm
-----END PGP SIGNATURE-----