[Haskell-cafe] monad-coroutine alternatives

16 views
Skip to first unread message

Alex

unread,
Dec 2, 2016, 2:29:19 PM12/2/16
to haskel...@haskell.org
Hello,

Are there any data structures isomorphic to Coroutine[0] available on
Hackage?

--
Alex


[0] https://hackage.haskell.org/package/monad-coroutine-0.9.0.3/docs/Control-Monad-Coroutine.html
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

Mario Blažević

unread,
Dec 2, 2016, 3:42:02 PM12/2/16
to haskel...@haskell.org
On 2016-12-02 02:29 PM, Alex wrote:
> Hello,
>
> Are there any data structures isomorphic to Coroutine[0] available on
> Hackage?

I believe the top recommendation is FreeT:

http://hackage.haskell.org/package/free-4.12.4/docs/Control-Monad-Trans-Free.html#t:FreeT

Note, if the reason you need the coroutines is to implement streaming,
you may want to proceed straight to Pipes or Conduit.

Alex

unread,
Dec 2, 2016, 3:51:23 PM12/2/16
to Mario Blažević, haskel...@haskell.org
On Fri, 2 Dec 2016 15:41:54 -0500
Mario Blažević <mbla...@stilo.com> wrote:

> On 2016-12-02 02:29 PM, Alex wrote:
> > Hello,
> >
> > Are there any data structures isomorphic to Coroutine[0] available
> > on Hackage?
>
> I believe the top recommendation is FreeT:
>
> http://hackage.haskell.org/package/free-4.12.4/docs/Control-Monad-Trans-Free.html#t:FreeT
>
> Note, if the reason you need the coroutines is to implement
> streaming, you may want to proceed straight to Pipes or Conduit.
>

Thanks! I am implementing a network protocol, so I need to suspend the
computation while I wait for Alice/Bob to send a response. The protocol
is specified as a series of tokens to form a DSL.

--
Alex

Reply all
Reply to author
Forward
0 new messages