Ivano,

You are right; and we have to remind whoever is willing to listen that:

Kleisli category is defined for a monad. This fact can be found in
"Categories for the Working Mathematicians", if the voice of reason is not
enough.

Thanks,
-Vlad

On Fri, Oct 20, 2017 at 10:40 AM, pagoda_5b <ivano.pag...@gmail.com> wrote:

> I don't understand if you're asking how to implement compose as a
> primitive on List, or if you're generally asking what opinion we have on
> defining compose as one of the building blocks for the other operations...
>
> Apart from this, the different definitions are equivalent, in the sense
> that to be able to define the kleisli composition for the Functor F, there
> must be some underlying ability to define for F operations which are
> equivalent to unit + join, or unit + flatMap, because that underlying
> capability is what makes it possible for the corresponding Kleisli to be a
> category and therefore to have a compose function.
>
> I know it may sounds a bit vague, but the corresponding math is what gives
> meaning to the Monad definition and the operations on that.
>
> I hope it helps, otherwise feel free to elaborate more
>
> Ivano
>
>
> On Thursday, August 31, 2017 at 7:54:33 PM UTC+2, Philip Schwarz wrote:
>>
>>
>> <https://lh3.googleusercontent.com/-nrhmLl4SP6g/WahMoxJJ4eI/AAAAAAAAAyg/lfvzmXSxjVMNYQZfktc_U2HLCSNhK0sngCLcBGAs/s1600/Screen%2BShot%2B2017-08-28%2Bat%2B09.06.51.png>
>>
>>
>> <https://lh3.googleusercontent.com/-asXR3bIZX34/WahMf_tFBjI/AAAAAAAAAyc/WcG5YNJeSPADZ8X9ahbVq_Oa57aVRpiXgCLcBGAs/s1600/Screen%2BShot%2B2017-08-28%2Bat%2B09.06.42.png>
>>
>> Hello,
>>
>>
>> I have put together three slides capturing how https://www.manning.com/bo
>> oks/functional-programming-in-scala defines a monad in terms of primitive
>> combinators unit+flatMap, unit+compose and unit+map+join: https://twitter
>> .com/philip_schwarz/status/902083644797399040
>>
>>
>> <https://lh3.googleusercontent.com/-9pLJ_MRbw3M/WahMKIrqsLI/AAAAAAAAAyY/V5lkL5B_mlA_vbejtUuM_vlRx0YhVkZsACLcBGAs/s1600/Screen%2BShot%2B2017-08-28%2Bat%2B09.06.33.png>
>>
>>
>>
>> <https://lh3.googleusercontent.com/-asXR3bIZX34/WahMf_tFBjI/AAAAAAAAAyc/WcG5YNJeSPADZ8X9ahbVq_Oa57aVRpiXgCLcBGAs/s1600/Screen%2BShot%2B2017-08-28%2Bat%2B09.06.42.png>
>>
>>
>>
>> <https://lh3.googleusercontent.com/-nrhmLl4SP6g/WahMoxJJ4eI/AAAAAAAAAyg/lfvzmXSxjVMNYQZfktc_U2HLCSNhK0sngCLcBGAs/s1600/Screen%2BShot%2B2017-08-28%2Bat%2B09.06.51.png>
>>
>>
>>
>> As you can see on the slide for unit+compose, the implementation of
>> compose (Kleisli composition), for the list monad in this case, is left
>> unspecified. In the answers to the book's exercises I have found an
>> implementation of compose in terms of flatMap https://github.com/fpi
>> nscala/fpinscala/blob/master/answerkey/monads/07.answer.scala
>> <https://www.linkedin.com/redir/redirect?url=https%3A%2F%2Fgithub%2Ecom%2Ffpinscala%2Ffpinscala%2Fblob%2Fmaster%2Fanswerkey%2Fmonads%2F07%2Eanswer%2Escala&urlhash=Bz31&_t=tracking_anet>,
>> but what does composition look like as a primitive?
>>
>> Any thoughts?
>>
>> Thanks,
>>
>> Philip Schwarz
>>
> --
> You received this message because you are subscribed to the Google Groups
> "scala-functional" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scala-functional+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"scala-functional" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to scala-functional+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to