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

Function pattern matching #608

Closed
mrkaspa opened this Issue May 17, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@mrkaspa

mrkaspa commented May 17, 2016

Why this is not possible?

square [] = 0
square (h::t) = h + square(t)
@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender May 17, 2016

Contributor

Because the language creator decided to not offer too many syntactic ways to do the same thing. What you want can already be achieved with case-expressions.

Contributor

jvoigtlaender commented May 17, 2016

Because the language creator decided to not offer too many syntactic ways to do the same thing. What you want can already be achieved with case-expressions.

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