[Haskell-beginners] Is it possible such Monad? (Baa)
Baa
aquagnu at gmail.com
Thu Oct 26 07:54:04 UTC 2017
Primary idea was to keep error messages. OK, I done it with `State`
monad :)
Thank you!
> 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
>
> On Wed, Oct 25, 2017 at 5:32 AM <beginners-request at haskell.org> wrote:
>
> > Send Beginners mailing list submissions to
> > beginners at 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 at haskell.org
> >
> > You can reach the person managing the list at
> > beginners-owner at 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 at gmail.com>
> > To: The Haskell-Beginners Mailing List - Discussion of primarily
> > beginner-level topics related to Haskell
> > <beginners at haskell.org> Subject: [Haskell-beginners] Is it possible
> > such Monad? Message-ID: <20171025135631.1f9913d2 at 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 at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >
> >
> > ------------------------------
> >
> > End of Beginners Digest, Vol 112, Issue 22
> > ******************************************
> >
More information about the Beginners
mailing list