Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is View big enough? #35

Open
treeowl opened this issue Jul 29, 2021 · 0 comments
Open

Is View big enough? #35

treeowl opened this issue Jul 29, 2021 · 0 comments

Comments

@treeowl
Copy link
Collaborator

treeowl commented Jul 29, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant