Reason
  • Docs
  • Try
  • API
  • Community
  • Blog
  • Languages iconEnglish
    • 日本語
    • Deutsch
    • Español
    • Français
    • 한국어
    • Português (Brasil)
    • Русский
    • Українська
    • 中文
    • 繁體中文
    • Help Translate
  • GitHub

›Language Basics

Intro

  • What & Why

Setup

  • Installation
  • Editor Plugins
  • Extra Goodies

Language Basics

  • Overview
  • Let Binding
  • Type!
  • String & Char
  • Boolean
  • Integer & Float
  • Tuple
  • Record
  • Variant!
  • Null, Undefined & Option
  • List & Array
  • Function
  • If-Else
  • Pipe First
  • More on Type
  • Destructuring
  • Pattern Matching!
  • Mutation
  • Imperative Loops
  • JSX
  • External
  • Exception
  • Object
  • Module
  • Promise

JavaScript

  • Interop
  • Syntax Cheatsheet
  • Libraries
  • Converting from JS

Native

  • Native
  • Quickstart
  • Converting from OCaml

Extra

  • Frequently Asked Questions
  • Comparison to OCaml
  • Newcomer Examples
  • Project Structure
Edit

Overview

PrimitiveExample
Strings"Hello"
Characters'x'
Integers23, -23
Floats23.0, -23.0
Integer Addition23 + 1
Float Addition23.0 +. 1.0
Integer Division/Multiplication2 / 23 * 1
Float Division/Multiplication2.0 /. 23.0 *. 1.0
Float Exponentiation2.0 ** 2.0
String Concatenation"Hello " ++ "World"
Comparison>, <, >=, =<
Boolean operations!, &&, ||
Reference, Structural (deep) Equality===, ==
Immutable Lists[1, 2, 3]
Immutable Prepend[item1, item2, ...theRest]
Arrays[|1, 2, 3|]
Recordstype player = {score: int}; {score: 100}
Comments/* Comment here */
← PreviousNext →