We have
data View m a
= Pure a
| a :< SeqT m a
We could use an internal version of View with another constructor:
data View' m a
= Pure' a
| a :<< SeqT m a
| a :<<< m (View' m a)
This would allow us to try to use RULES to turn lift m <|> lift n into something like
fromView' $ m >>= \a -> pure (a :<<< (n >>= single'))
Smashing enough lifted values (or pure ones) into one element of the queue should improve optimization and keep the queue shorter. On the negative side, we'd have more cases to deal with.
We have
We could use an internal version of
Viewwith another constructor:This would allow us to try to use
RULESto turnlift m <|> lift ninto something likeSmashing enough lifted values (or pure ones) into one element of the queue should improve optimization and keep the queue shorter. On the negative side, we'd have more cases to deal with.