Skip to main content

module Prelude

Usage

import Prelude;

Synopsis

All basic utility functions in one handy module to import

Description

Unlike the module name suggests the Prelude module is not automatically imported when Rascal is started. All it is, is a handy combination of extended modules that will provide the utility functions most Rascal programmers need in the rascal shell or when scripting a module.

Prelude combines the following modules:

Examples

rascal>import Prelude;
ok
rascal>println("Hello World"); // from IO
Hello World
ok
rascal>size([1,2,3]) // from List
int: 3
rascal>size({1,2,1}) // from Set
int: 2

Benefits

  • Prelude uses the module extend mechanism to make all the feature of the extended modules transitively available to an importing module.

Pitfalls

  • Prelude combines many many function names and so the namespace of modules that import it is a bit crowded.