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

Alternative interface and Seminearring annotations #2

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@tel
Owner

tel commented Mar 10, 2014

If you just have an applicative interface then you can annotate it by
folding a Monoid ann => Const ann over your applicative. If you have an
alternative interface, though, which is at least interesting for this use
case if not required, then you need more structure on your annotation.

In particular, here we can see annotation which is carried out by choosing
the alternative to be left-distributive and sequential (deterministic
choice, ordered choice) and then annotating the process with a
(left-distributive) semi-nearring.

The end result is basically perfect, but this feature is very complex. The
sequential nature does provide a simple API, however, though, as we can
write 'first' which simply ignores choice to provide a "preferred" entry.

We also might want to write 'flatten' which converts the seminearring to
disjunctive normal form, though it's unclear what exactly that is.

There's also the question of whether closure should make sense in a scenario
like this. Obviously this has some relation to 'some' and 'many' which,
themselves, don't make a whole lot of sense yet.

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