Zipping SmallCheck series

10 views
Skip to first unread message

Danny Navarro

unread,
May 21, 2015, 9:42:17 AM5/21/15
to haskel...@googlegroups.com
I'm trying to write a function with the following type:

Monad m => Series m a -> Series m b -> Series (a,b)

Just like `(><)` [1] but with one-to-one zipping between the elements of both series instead of a combination of every element.

`(\/)` doesn't work for me because both series need to be the same type.

I guess there is some way to do this with `MonadLogic` but still don't see it.

--
Danny Navarro  |  http://dannynavarro.net

Roman Cheplyaka

unread,
May 22, 2015, 6:04:44 AM5/22/15
to Danny Navarro, haskel...@googlegroups.com
Hi Danny,

You are right, MonadLogic lets you do that.
See https://gist.github.com/32b1d925baa3bc0e6b89
signature.asc

Danny Navarro

unread,
May 25, 2015, 4:06:29 AM5/25/15
to Roman Cheplyaka, haskel...@googlegroups.com
Thanks Roman!

That's exactly what I was looking for.
Reply all
Reply to author
Forward
0 new messages