🚧 This repo has been moved to prescientmoon/steinerlang 🚧
Lang I'm making for fun
You first need to have purescript and spago installed locally.
- Clone the repo
- Run
spago run
This will start the steiner repl.
Note: the first time you try and run it will take a while since spago will have to install all the dependencies and stuff.
Command | Description |
---|---|
:ast expr | print the ast an expression parses to |
:t expr | Infer the type of an expression |
:check (expr) type | Check if an expression has a type |
:s type type | Check if a type is at least as polymorphic as another |
:u type type | See the result of unifying 2 types |
:q | Quit the repl |
:clear | Clear the console |
-
single line
-- something
-
multi line
{- Something -}
-
Constants:
Constants can start with any uppercase letter
Int String Bool ...
-
Variables:
Variables need to start with a lowercase letter
something otherVar ...
-
Lambdas
type -> type
-
Rank N Types
forall name. type -- this can reference name
-
Int literals
0
-
float literals
0.0
-
string literals
"something"
-
If expressions
if condition then expression else expression
-
Lambdas
\a -> expression -- this can reference a
-
Type annotations
expression :: type
-
Application
function argument
-
Let expressions
let name = expression in body -- this can reference name
-
Assumptions
assume name :: type in expression -- this can reference name