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

Multisets #13

Open
ivanperez-keera opened this issue Mar 11, 2018 · 0 comments
Open

Multisets #13

ivanperez-keera opened this issue Mar 11, 2018 · 0 comments

Comments

@ivanperez-keera
Copy link

I'm interested in representing multisets.

In particular, instead of plain lists, like:

'[A, B, A, C]

or perhaps sets with repeated elements:

Set '[A, B, A, C]

I'm looking for something like:

Set '[ (A, 2), (B, 1), (C, 1) ]

Now, I can achieve something like this with Maps:

Map '[ A :-> Int, B :-> Int, C :-> Int ]

But those Ints would be given a value during runtime. What I want to resolve the values of those Ints during compile time:

Map '[ A :-> 2, B :-> 1, C :-> 1 ]

It tried the obvious way, but it complains that:

    • Expected kind ‘[Mapping Symbol *]’,
        but ‘'[A ':-> 1]’ has kind ‘[Mapping * Nat]’

Any advice?

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

No branches or pull requests

1 participant