Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell: FIFO monad

Tags:

haskell

fifo

Is there a standard (or at least commonly used) package with a monad for FIFO queues? I read about this one in a paper a while ago, and I've used it a couple times, but I'd like to stop reimplementing wheels (it's fun, but unproductive).

like image 904
rampion Avatar asked Sep 21 '11 21:09

rampion


2 Answers

I don't think there is. I would use a State monad with a Seq container as state.

like image 122
Sjoerd Visscher Avatar answered Oct 17 '22 22:10

Sjoerd Visscher


There's a nifty version of corecursive queues on hackage: http://hackage.haskell.org/package/control-monad-queue

I wouldn't call it standard by any means, but it certainly reflects a fair amount of work and testing.

The linked monad reader article is a really good read too.

like image 32
sclv Avatar answered Oct 17 '22 22:10

sclv