<div dir="auto">Hi,</div><div dir="auto"><br></div><div dir="auto">1. I think your data type is isomorphic to</div><div dir="auto"><br></div><div dir="auto">data Allpass w m a = Pass Bool (m a) w</div><div dir="auto"><br></div><div dir="auto">2. Maybe first try to write a Functor instance? Then you can find out what constraints are necessary for 'w' and 'm' to write it.</div><div dir="auto"><br></div><div dir="auto">3. What does this data type intend to represent?</div><div dir="auto"><br></div><div dir="auto">Best,</div><div dir="auto"><br></div><div dir="auto">toz </div><div><br><div class="gmail_quote"><div>On Wed, Oct 25, 2017 at 5:32 AM <<a href="mailto:beginners-request@haskell.org">beginners-request@haskell.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send Beginners mailing list submissions to<br>
        <a href="mailto:beginners@haskell.org" target="_blank">beginners@haskell.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:beginners-request@haskell.org" target="_blank">beginners-request@haskell.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:beginners-owner@haskell.org" target="_blank">beginners-owner@haskell.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Beginners digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1.  Is it possible such Monad? (Baa)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 25 Oct 2017 13:56:31 +0300<br>
From: Baa <<a href="mailto:aquagnu@gmail.com" target="_blank">aquagnu@gmail.com</a>><br>
To: The Haskell-Beginners Mailing List - Discussion of primarily<br>
        beginner-level topics related to Haskell <<a href="mailto:beginners@haskell.org" target="_blank">beginners@haskell.org</a>><br>
Subject: [Haskell-beginners] Is it possible such Monad?<br>
Message-ID: <20171025135631.1f9913d2@Pavel><br>
Content-Type: text/plain; charset=US-ASCII<br>
<br>
Hello All!<br>
<br>
Is it possible to write Monad for such type:<br>
<br>
  data Allpass w m a = Nopass (m a) w | Allpass (m a) w<br>
<br>
I can write (>>=), IMHO such type can not be Monad due to `w` is not<br>
under `m` monad, right?<br>
<br>
<br>
===<br>
Best regards, Paul<br>
<br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
<br>
<br>
------------------------------<br>
<br>
End of Beginners Digest, Vol 112, Issue 22<br>
******************************************<br>
</blockquote></div></div>