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

Smart constructor for Symbol rather than requiring -XOverloadedLists #297

Open
ocramz opened this issue Aug 14, 2022 · 1 comment
Open

Comments

@ocramz
Copy link
Contributor

ocramz commented Aug 14, 2022

It took me a minute to realize coffeeTeaAutomaton only works when OverloadedLists is on. Requiring the extension runs the risk of breaking other code in a module (just happened to me), which is not ideal.

Feature request : Can we have smart constructors for Symbol ? e.g.

symbol :: a -> Label a
symbol = Symbol 

and

symbols :: Foldable t => t a -> Label a
symbols = foldr ((<>) . Symbol) Zero
@snowleopard
Copy link
Owner

Thanks for the PR! I'm hesitant to change the example in coffeeTeaAutomaton though since it would make it more cluttered. How about extending the corresponding comment, pointing out that the inner lists are overloaded?

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

2 participants