Skip to content

Add declarations for val definitions #83

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

Closed
wants to merge 4 commits into from

Conversation

AlexKnauth
Copy link
Contributor

@AlexKnauth AlexKnauth commented Jun 27, 2018

This pull request adds the form, which behaves like the : form in Typed Racket, or like the declaration variant of the :: form in Haskell. A Program like

(⋮ x τ)
(def x e)

is like this Haskell program,

x :: τ
x = e

which defines x with type τ to be equal to the value produced by e. It typechecks e with τ as the expected type just like if you wrote (def x : τ e).

This is similar to #74, but uses a different name so that : can be the expression variant even in "ambiguous" positions such as the REPL.

@AlexKnauth
Copy link
Contributor Author

Closing in favor of #86.

@AlexKnauth AlexKnauth closed this Jul 2, 2018
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.

1 participant