Hi,
1. I think your data type is isomorphic to
data Allpass w m a = Pass Bool (m a) w
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.
3. What does this data type intend to represent?
Best,
toz
Send Beginners mailing list submissions to
beginners@haskell.org
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
beginners-request@haskell.org
You can reach the person managing the list at
beginners-owner@haskell.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Is it possible such Monad? (Baa)
----------------------------------------------------------------------
Message: 1
Date: Wed, 25 Oct 2017 13:56:31 +0300
From: Baa <aquagnu@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <beginners@haskell.org>
Subject: [Haskell-beginners] Is it possible such Monad?
Message-ID: <20171025135631.1f9913d2@Pavel>
Content-Type: text/plain; charset=US-ASCII
Hello All!
Is it possible to write Monad for such type:
data Allpass w m a = Nopass (m a) w | Allpass (m a) w
I can write (>>=), IMHO such type can not be Monad due to `w` is not
under `m` monad, right?
===
Best regards, Paul
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 112, Issue 22
******************************************