6

Odù Domains

The 16 standard library modules

What Are Domains?

In Ifá-Lang, the standard library is organized into 16 domains, each named after an Odù (sacred pattern) from the Ifá divination system. Each domain handles a specific category of functionality.

Domain Mappings
Irosu
Console I/O
Irete
Cryptography
Osa
Parallel/Async
Ogbe
System/Types
Oyeku
Exit/Sleep
Iwori
Time/Date
Odi
File I/O
Owonrin
Random
Obara
Math (Add/Mul)
Oturupon
Math (Sub/Div)
Ogunda
Lists/Arrays
Ika
Strings
Okanran
Errors
Otura
Network/HTTP
Ose
Terminal UI
Ofun
Permissions

Calling Domain Methods

Use the domain name (or alias) followed by a dot and the method:

Domain Calls
// Pattern: Domain.method(arguments)

Irosu.fo("Hello!");           // Console output
Ogunda.len([1, 2, 3]);        // List length → 3
Ika.uppercase("hello");       // String → "HELLO"
Owonrin.pese(1, 100);         // Random 1-100
Iwori.now();                  // Current timestamp
// Pattern: Alias.method(arguments)

Fmt.println("Hello!");        // Console output
List.len([1, 2, 3]);          // List length → 3
String.uppercase("hello");    // String → "HELLO"
Rand.gen(1, 100);             // Random 1-100
Time.now();                   // Current timestamp

Commonly Used Domains

Irosu / Fmt — Console I/O

Console I/O
Irosu.fo("Print with newline");
Irosu.so("Print without newline");
ayanmo input = Irosu.ka("Enter name: ");
Irosu.kigbe("Error message to stderr");
Fmt.println("Print with newline");
Fmt.print("Print without newline");
let input = Fmt.read("Enter name: ");
Fmt.error("Error message to stderr");

Ogunda / List — Lists

Lists
ayanmo list = [1, 2, 3];
Irosu.fo(Ogunda.len(list));        // 3
Irosu.fo(Ogunda.first(list));      // 1
Irosu.fo(Ogunda.last(list));       // 3
ayanmo bigger = Ogunda.push(list, 4);  // [1,2,3,4]
let list = [1, 2, 3];
Fmt.println(List.len(list));       // 3
Fmt.println(List.first(list));     // 1
Fmt.println(List.last(list));      // 3
let bigger = List.push(list, 4);   // [1,2,3,4]

Ika / String — Strings

Strings
ayanmo s = "Hello World";
Irosu.fo(Ika.len(s));              // 11
Irosu.fo(Ika.uppercase(s));        // "HELLO WORLD"
Irosu.fo(Ika.split(s, " "));       // ["Hello", "World"]
Irosu.fo(Ika.contains(s, "World")); // otito
let s = "Hello World";
Fmt.println(String.len(s));         // 11
Fmt.println(String.uppercase(s));   // "HELLO WORLD"
Fmt.println(String.split(s, " "));  // ["Hello", "World"]
Fmt.println(String.contains(s, "World")); // true

Owonrin / Rand — Random

Random
ayanmo dice = Owonrin.pese(1, 6);     // 1-6
ayanmo coin = Owonrin.yan([0, 1]);    // Pick one
ayanmo shuffled = Owonrin.ru([1,2,3,4]); // Shuffle
let dice = Rand.gen(1, 6);         // 1-6
let coin = Rand.pick([0, 1]);      // Pick one
let shuffled = Rand.shuffle([1,2,3,4]); // Shuffle

Ogbe / Sys — System/Types

System
ayanmo t = Ogbe.type(42);             // "number"
ayanmo n = Ogbe.parse_int("123");     // 123
ayanmo args = Ogbe.args();            // CLI arguments
let t = Sys.type(42);                 // "number"
let n = Sys.parse_int("123");         // 123
let args = Sys.args();                // CLI arguments

Chaining Calls

Chaining
// Process a string through multiple operations
ayanmo result = Ika.trim("  hello  ");
ayanmo result = Ika.uppercase(result);
Irosu.fo(result);  // "HELLO"

// With list operations
ayanmo nums = [5, 2, 8, 1];
ayanmo sorted = Osa.sort(nums);
ayanmo first = Ogunda.first(sorted);
Irosu.fo(first);  // 1
// Process a string through multiple operations
let result = String.trim("  hello  ");
let result = String.uppercase(result);
Fmt.println(result);  // "HELLO"

// With list operations
let nums = [5, 2, 8, 1];
let sorted = Async.sort(nums); // Note: sort is often in Osa
let first = List.first(sorted);
Fmt.println(first);  // 1

Quick Reference

See the API Reference for complete method listings for each domain.