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

Add Ord to Enums #1848

Merged
merged 2 commits into from
Oct 20, 2023
Merged

Add Ord to Enums #1848

merged 2 commits into from
Oct 20, 2023

Conversation

amitaibu
Copy link
Collaborator

I'd like to have an associate list with an enum as key.

Assuming Foo is an Enum:

import qualified Data.Map as Map

let value = Map.lookup Foo treeJson

Without this PR we get error:

Could not deduce (Ord ProductItemType)
        arising from a use of ‘Map.lookup’

Test/SchemaCompilerSpec.hs Outdated Show resolved Hide resolved
Test/SchemaCompilerSpec.hs Outdated Show resolved Hide resolved
Test/SchemaCompilerSpec.hs Outdated Show resolved Hide resolved
@mpscholten mpscholten merged commit 7c55c8e into master Oct 20, 2023
2 checks passed
@mpscholten mpscholten deleted the enum-ord branch October 20, 2023 13:37
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

Successfully merging this pull request may close these issues.

2 participants