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

UInt constructor export for pattern matching #16

Open
jamesdbrock opened this issue Jul 28, 2021 · 1 comment
Open

UInt constructor export for pattern matching #16

jamesdbrock opened this issue Jul 28, 2021 · 1 comment

Comments

@jamesdbrock
Copy link
Member

jamesdbrock commented Jul 28, 2021

It’s too bad we can’t pattern match on a literal UInt 2.

https://pursuit.purescript.org/packages/purescript-protobuf/2.1.1/docs/Protobuf.Internal.Runtime#t:FieldNumberInt

But if we did export the UInt constructor for pattern matching it wouldn't even make sense, because what happens when we pattern match on UInt (-2)? That’s right you know what happens.

@jamesdbrock
Copy link
Member Author

I'm inclined to export the constructor and then write stern documentation about using only literals as the constructor argument, not expressions.

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

No branches or pull requests

1 participant