<div dir="auto"><a href="https://github.com/HeinrichApfelmus/reactive-banana/issues/101">https://github.com/HeinrichApfelmus/reactive-banana/issues/101</a> discusses Monad Behaviour in the context of reactive-banana</div><div class="gmail_extra"><br><div class="gmail_quote">On 20 Jan 2018 3:19 pm, "Alexey Vagarenko" <<a href="mailto:vagarenko@gmail.com">vagarenko@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Both `reflex`[1] and `frpnow`[2] provide Monad instance for behavior.<div>AFAIK only `reactive-banana` and arrowized FRP libraries don't have it.<div><br><div>[1] <a href="https://github.com/reflex-frp/reflex/blob/develop/src/Reflex/Class.hs#L598" target="_blank">https://github.com/reflex-<wbr>frp/reflex/blob/develop/src/<wbr>Reflex/Class.hs#L598</a></div><div>[2] <a href="https://hackage.haskell.org/package/frpnow-0.18/docs/Control-FRPNow-Core.html" target="_blank">https://hackage.haskell.<wbr>org/package/frpnow-0.18/docs/<wbr>Control-FRPNow-Core.html</a></div></div></div></div><div id="m_7775439266333022182DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid #d3d4de">
        <tr>
        <td style="width:55px;padding-top:13px"><a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png" alt="" width="46" height="29" style="width:46px;height:29px"></a></td>
                <td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" style="color:#4453ea" target="_blank">www.avg.com</a>
                </td>
        </tr>
</table><a href="#m_7775439266333022182_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div><div class="gmail_extra"><br><div class="gmail_quote">2018-01-20 19:00 GMT+05:00 martin <span dir="ltr"><<a href="mailto:martin.drautzburg@web.de" target="_blank">martin.drautzburg@web.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello all,<br>
<br>
it appears to be difficult to define a Monad instance for Behavior and in many (if not all) reactive libraries Behavior<br>
is not a Monad. Why is that so?<br>
<br>
If a Beahvior is conceptionally a function from Time to something,<br>
<br>
        newtype Behavior a = Behavior (Time -> a)<br>
<br>
then its Monad instance should work like a Reader Monad.<br>
<br>
Alternatively one can look at the join function<br>
<br>
        join :: Behavior (Behavior a) -> Behavior a.<br>
<br>
This corresponds to the situation where you switch between Channels on a TV remote controle and each Channel is a<br>
behavior of Image. Then<br>
<br>
        join Behavior (Behavior image)<br>
<br>
should give you the video stream you see on the screen. How can one possibly live without this operation?<br>
<br>
I assume this has something to do with the actual implementation and not so much with the semantics, because<br>
semantically I don't see any problems.<br>
<br>
So,<br>
- why is Behavior not a Monad and<br>
- how would you express the TV-remote example without a Monad?<br>
<br>
<br>
______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/haskell-caf<wbr>e</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
Only members subscribed via the mailman list are allowed to post.<br></blockquote></div></div>