4 ms·
oo. I'd forgotten about fix. cycleM = fix . mplus gives a nice generic version that works on Lists & Sequences but falls afoul of the monomorphism restricti
by pja 13y ago
oo. I'd forgotten about fix.
cycleM = fix . mplus
gives a nice generic version that works on Lists & Sequences but falls afoul of the monomorphism restriction, so it needs a type:
cycleM :: (MonadPlus m) => m a -> m a
cycleM = fix . mplus