Examples
Here are some small examples of ways to do various things in Roc.
You can find the source code for all of these at github.com/roc-lang/examples
- Hello, World!
- FizzBuzz
- Basic Dict Usage
- Tuples
- Pattern Matching on Lists
- Results & Error Handling
- Tasks & Error Handling
- Import Files
- Import from Directory
- Import Package from Module
- Multiple Roc Files
- JSON
- Hello, Webserver!
- Random Numbers
- CLI Args Simple
- CLI Args File
- Safe Math
- Graph Traversal
- Parser
- Arithmetic
- Looping Tasks
- Record Builder
- Encoding & Decoding Abilities
- Desugaring !
- Desugaring ?
- Custom Inspect
- Least Squares
- Towers of Hanoi
- Multi-line Comments
- Go Platform
- .NET Platform
- Elm Web App