2015/01/30 12:51 nikolaj 2014/09/13 18:11 nikolaj 2014/09/11 23:08 nikolaj 2014/09/11 23:06 nikolaj 2014/09/11 14:25 nikolaj 2014/09/11 14:23 nikolaj 2014/09/11 14:19 nikolaj 2014/09/11 14:19 nikolaj 2014/09/11 11:48 nikolaj 2014/09/11 11:47 nikolaj 2014/09/11 11:46 nikolaj 2014/09/11 11:45 nikolaj 2014/09/10 00:35 nikolaj 2014/09/09 23:42 nikolaj 2014/09/09 23:41 nikolaj 2014/09/06 17:15 nikolaj 2014/08/28 19:26 nikolaj 2014/08/28 19:24 nikolaj 2014/08/28 19:23 nikolaj 2014/08/25 00:14 nikolaj 2014/08/25 00:05 nikolaj 2014/08/25 00:04 nikolaj 2014/08/25 00:04 nikolaj 2014/08/25 00:04 nikolaj 2014/08/24 21:54 nikolaj 2014/08/24 20:04 nikolaj 2014/08/24 19:58 nikolaj
2015/01/30 12:51 nikolaj 2014/09/13 18:11 nikolaj 2014/09/11 23:08 nikolaj 2014/09/11 23:06 nikolaj 2014/09/11 14:25 nikolaj 2014/09/11 14:23 nikolaj 2014/09/11 14:19 nikolaj 2014/09/11 14:19 nikolaj 2014/09/11 11:48 nikolaj 2014/09/11 11:47 nikolaj 2014/09/11 11:46 nikolaj 2014/09/11 11:45 nikolaj 2014/09/10 00:35 nikolaj 2014/09/09 23:42 nikolaj 2014/09/09 23:41 nikolaj 2014/09/06 17:15 nikolaj 2014/08/28 19:26 nikolaj 2014/08/28 19:24 nikolaj 2014/08/28 19:23 nikolaj 2014/08/25 00:14 nikolaj 2014/08/25 00:05 nikolaj 2014/08/25 00:04 nikolaj 2014/08/25 00:04 nikolaj 2014/08/25 00:04 nikolaj 2014/08/24 21:54 nikolaj 2014/08/24 20:04 nikolaj 2014/08/24 19:58 nikolaj 2014/08/24 19:53 nikolaj 2014/08/24 19:52 nikolaj 2014/08/24 19:27 nikolaj 2014/08/24 19:22 nikolaj 2014/08/24 19:21 nikolaj 2014/08/24 18:14 nikolaj 2014/08/24 18:03 nikolaj 2014/08/24 18:01 nikolaj 2014/08/24 18:00 nikolaj 2014/08/24 17:42 nikolaj 2014/08/24 17:41 nikolaj 2014/08/24 17:38 nikolaj 2014/08/24 17:38 nikolaj 2014/08/24 17:36 nikolaj 2014/08/24 17:33 nikolaj 2014/08/24 17:31 nikolaj 2014/08/24 17:30 nikolaj 2014/08/24 17:29 nikolaj 2014/08/24 17:27 nikolaj 2014/08/24 17:27 nikolaj 2014/08/24 17:05 nikolaj 2014/08/24 17:02 nikolaj 2014/08/24 17:02 nikolaj 2014/08/24 17:00 nikolaj
monad_._haskell [2014/09/13 18:11]
monad_._haskell [2015/01/30 12:51] (current)
Note that conversely, '<​*>'​ doesn'​t suffice to define a '>>​='​. Note that conversely, '<​*>'​ doesn'​t suffice to define a '>>​='​.
- I'm going to explain what this (<*>) does in mathematical terminology:​ The Yoneda lemma implies that there is an isomorphism from $FA$ to $\mathrm{nat}(\mathrm{Hom}(A,​B),​FB)$. Consider a the category with exponential objects and arrows corresponding to components of the natural transformations (such as is the case for Hask, where the above map is $at\mapsto g\mapsto T(g)(ta):​FA\to B^A\to FB$), then we can apply the functors arrow map to the latter and obtain a map $FA\to F\,B^A\to FFB)$ to. One could say that this is provides a way to "​apply"​ $tg:F\,B^A$ to $ta:FA$. Note, however, that $T\,B^A$ isn't necessarily a honest function space anymore, so that's abuse of terminology. (For example, '​Noting :: Maybe (Int->​Int)'​ isn't a function. Things still work out, however, because if you pass '​Noting',​ the outer arrow mapping in the described function takes care of it. In that case the '​tg'​ value doesn'​t even matter so this is hardly an "​evaluation"​ of '​Nothing'​.). Lastly, if the functor comes with a monadic '​join',​ then we can get rid of the second $F$ in $FFB$ in the type of the function, and then it's called '<​*>'​. + I'm going to explain what this (<*>) does in mathematical terminology:​ The Yoneda lemma implies that there is an isomorphism from $FA$ to $\mathrm{nat}(\mathrm{Hom}(A,​B),​FB)$. Consider a category with exponential objects and arrows corresponding to components of the natural transformations (such as is the case for Hask, where the above map is $at\mapsto g\mapsto T(g)(ta):​FA\to B^A\to FB$), then we can apply the functors arrow map to the latter and obtain a map $FA\to F\,B^A\to FFB)$ to. One could say that this is provides a way to "​apply"​ $tg:F\,B^A$ to $ta:FA$. Note, however, that $T\,B^A$ isn't necessarily a honest function space anymore, so that's abuse of terminology. (For example, '​Noting :: Maybe (Int->​Int)'​ isn't a function. Things still work out, however, because if you pass '​Noting',​ the outer arrow mapping in the described function takes care of it. In that case the '​tg'​ value doesn'​t even matter so this is hardly an "​evaluation"​ of '​Nothing'​.). Lastly, if the functor comes with a monadic '​join',​ then we can get rid of the second $F$ in $FFB$ in the type of the function, and then it's called '<​*>'​.
== Alternative definitions == == Alternative definitions ==
monad_._haskell.txt · Last modified: 2015/01/30 12:51 by nikolaj