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

type signatures in interpreter #23

Closed
ghost opened this issue Apr 9, 2012 · 2 comments
Closed

type signatures in interpreter #23

ghost opened this issue Apr 9, 2012 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 9, 2012

Currently, type signatures are not allowed in the interpreter. Instead, they lead to an error like in this example:

Idris> let list = ["foo","bar"] : List String in list
"(input)" (line 1, column 12):
unexpected reserved operator ":"
expecting "[", "if", "![", "?", "refl", "proof", "tactics", "case", operator, "(|", "[|", ")", ",", "**", identifier, "instance", "Integer", "Int", "Char", "Float", "String", "Ptr", float, natural, literal string, character, "Set", "()", "_|_", "_", "record", "\\", "let", "(", "|", "{" or "do"

This e.g. makes it impossible to define a list in a let-in-expression because the interpreter can't distinguish it from a vector.

@edwinb
Copy link
Contributor

edwinb commented Apr 9, 2012

Try this instead:

Idris> let list : List String = ["foo", "bar"] in list

@edwinb edwinb closed this as completed Apr 9, 2012
@ghost
Copy link
Author

ghost commented Apr 9, 2012

Ah, nice. Thanks :)

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