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

›Extra

Intro

  • What & Why
  • Getting started

Setup

  • Installation
  • Editor Plugins
  • Format (refmt)

Language Basics

  • Overview
  • Let Bindings
  • Primitives
  • Basic Structures
  • Types
  • Records
  • Variants
  • Options and nullability
  • Functions
  • Recursion
  • Destructuring
  • Pattern Matching
  • Mutable Bindings
  • Loops
  • Modules

Advanced Features

  • JSX
  • External
  • Exception
  • Object

JavaScript

  • Melange
  • Interop
  • Syntax Cheatsheet
  • Pipe First
  • Promise
  • Libraries
  • Converting from JS

Extra

  • Frequently Asked Questions
  • Extra Goodies
  • REPL (rtop)
Edit

REPL (rtop)

rtop is a REPL (Read, Evaluate, Print, and Loop) to interact with Reason.

Comes from the rtop package in the opam repository.

Inspired by utop

Installation

opam install rtop

Usage

rtop
─────────────┬─────────────────────────────────────────────────────────────┬──────────────
             │ Welcome to utop version 2.13.1 (using OCaml version 5.0.0)! │
             └─────────────────────────────────────────────────────────────┘

                   ___  _______   ________  _  __
                  / _ \/ __/ _ | / __/ __ \/ |/ /
                 / , _/ _// __ |_\ \/ /_/ /    /
                /_/|_/___/_/ |_/___/\____/_/|_/

  Execute statements/let bindings. Hit <enter> after the semicolon. Ctrl-d to quit.

        >   let myVar = "Hello Reason!";
        >   let myList: list(string) = ["first", "second"];
        >   #use "./src/myFile.re"; /* loads the file into here */

Type #utop_help for help about using utop.

Reason #
┌──────────────┬──────────────┬───────────────┬─────┬────┬───┬──────────┬─────┬──────────┐
│Afl_instrument│Alias_analysis│Allocated_const│Annot│Arch│Arg│Arg_helper│Array│ArrayLabel│
└──────────────┴──────────────┴───────────────┴─────┴────┴───┴──────────┴─────┴──────────┘
← Extra Goodies
  • Installation
  • Usage