Esc
Start typing to search...

Hello World

Let's write your first Keel program!

Using the REPL

The easiest way to try Keel is using the REPL (Read-Eval-Print Loop):

keel repl

Once in the REPL, type:

"Hello, World!"
Try it

You should see:

"Hello, World!"

Your First Function

Let's define a function that greets someone by name:

fn greet : String -> String
fn greet name = "Hello, " ++ name ++ "!"

greet "World"
Try it

This outputs:

"Hello, World!"

Breaking It Down

  1. fn greet : String -> String - This declares a function named greet that takes a String and returns a String
  2. fn greet name = ... - This defines the function body, where name is the parameter
  3. ++ - This is the string concatenation operator

Next Steps