Skip to content

Is View big enough? #35

@treeowl

Description

@treeowl

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions