Quick Links
  • -Overview
  • -Language Features
  • -JS Interop
  • -Build System
Documentation
Language Manual
Reference for all language features
ReScript & React
First class bindings for ReactJS
GenType
Seamless TypeScript integration
Reanalyze
Dead Code & Termination analysis
Exploration
Packages
Explore third party libraries and bindings
Syntax Lookup
Discover all syntax constructs
APIPlaygroundBlogCommunity
  • Playground
  • Blog
  • X
  • BlueSky
  • GitHub
  • Forum
Belt Stdlib
Overview
  • Introduction
Basics
  • Array
  • List
  • Float
  • Int
  • Range
  • Id
  • Option
  • Result
Set
  • HashSet
  • HashSetInt
  • HashSetString
    • t
    • add
    • clear
    • copy
    • forEach
    • forEachU
    • fromArray
    • getBucketHistogram
    • has
    • isEmpty
    • key
    • logStats
    • make
    • mergeMany
    • reduce
    • reduceU
    • remove
    • size
    • toArray
  • Set
  • SetDict
  • SetInt
  • SetString
Map
  • HashMap
  • HashMapInt
  • HashMapString
  • Map
  • MapDict
  • MapInt
  • MapString
Mutable Collections
  • MutableMap
  • MutableMapInt
  • MutableMapString
  • MutableQueue
  • MutableSet
  • MutableSetInt
  • MutableSetString
  • MutableStack
Sort Collections
  • SortArray
  • SortArrayInt
  • SortArrayString
Utilities
  • Debug
API / Belt / HashSetString

You are currently looking at the v6.0 - v8.2 docs (Reason v3.6 syntax edition). You can find the latest API docs here.

(These docs cover all versions between v3 to v8 and are equivalent to the old BuckleScript docs before the rebrand)

HashSetString

This module is Belt.HashSet specialized with key type to be a primitive type.

It is more efficient in general, the API is the same with Belt.HashSet except its key type is fixed, and identity is not needed(using the built-in one).

key

RE
type key = string;

t

RE
type t;

make

RE
let make: (~hintSize: int) => t;

clear

RE
let clear: t => unit;

isEmpty

RE
let isEmpty: t => bool;

add

RE
let add: (t, key) => unit;

copy

RE
let copy: t => t;

has

RE
let has: (t, key) => bool;

remove

RE
let remove: (t, key) => unit;

forEachU

RE
let forEachU: (t, [@bs] (key => unit)) => unit;

forEach

RE
let forEach: (t, key => unit) => unit;

reduceU

RE
let reduceU: (t, 'c, [@bs] (('c, key) => 'c)) => 'c;

reduce

RE
let reduce: (t, 'c, ('c, key) => 'c) => 'c;

size

RE
let size: t => int;

logStats

RE
let logStats: t => unit;

toArray

RE
let toArray: t => array(key);

fromArray

RE
let fromArray: array(key) => t;

mergeMany

RE
let mergeMany: (t, array(key)) => unit;

getBucketHistogram

RE
let getBucketHistogram: t => array(int);

© 2024 The ReScript Project

Software and assets distribution powered by KeyCDN.

About
  • Community
  • ReScript Association
Find us on