Basic Hello World
The simplest Elara program that prints output:What this does:
def main : IO ()declares the type signature formainas an IO action that returns unit (nothing)let main = print "Hello, World!"defines the main function that prints the string- The
printfunction comes from the standard library and outputs text
Every Elara program must have a
main function of type IO () as the entry point.String Concatenation
You can build more complex strings using the Expected Output:Key Concepts:
++ operator:- The
++operator concatenates strings - Local bindings use
letexpressions - The
Stringmodule provides string utilities
Next Steps
Now that you understand the basics, explore more advanced examples:- Recursion - Learn how to write recursive functions
- Higher-Order Functions - Functions that take other functions as arguments
- Data Types - Define custom algebraic data types