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

Better version of Interpolation.list #144

Open
gampleman opened this issue Jul 24, 2023 · 0 comments
Open

Better version of Interpolation.list #144

gampleman opened this issue Jul 24, 2023 · 0 comments

Comments

@gampleman
Copy link
Owner

We could make add and delete options to be a -> Interpolator (Maybe a), with Nothing indicating their absence in the resulting list.

We should also make the list ordered by default where order would be interpolated properly.

ListCombiner is kind of dumb, we should just accept a List (Interpolator a) -> Interpolator (List a) function

Finally, we could make all the options (except id) actually optional, since

{ add = \v -> Interpolation.step Nothing [ Just v ]
, remove = \v -> Interpolation.step (Just v) Nothing
, change = \a b -> Interpolation.step a [ b ]
, combine = Interpolation.inParallel
}

would be pretty decent defaults.

Potentially we could make id optional as well and just treat everything as additions and removals without it, but that sort of seems fairly suboptimal. Or have a way to use == to figure out reorder-ing at least...

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