This is the latest docs version
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
  • Twitter
  • GitHub
  • Forum
Belt Module
Overview
Belt
submodules
  • Array
  • Float
  • HashMap
    • String
    • Int
    HashSet
    • String
    • Int
      • t
        key
      • t
        t
      • v
        make
      • v
        clear
      • v
        isEmpty
      • v
        add
      • v
        copy
      • v
        has
      • v
        remove
      • v
        forEachU
      • v
        forEach
      • v
        reduceU
      • v
        reduce
      • v
        size
      • v
        logStats
      • v
        toArray
      • v
        fromArray
      • v
        mergeMany
      • v
        getBucketHistogram
    Id
    • MakeHashable
    • MakeHashableU
    • MakeComparable
    • MakeComparableU
  • Int
  • List
  • Map
    • Dict
    • String
    • Int
    MutableMap
    • String
    • Int
  • MutableQueue
  • MutableSet
    • String
    • Int
  • MutableStack
  • Option
  • Range
  • Result
  • Set
    • Dict
    • String
    • Int
    SortArray
    • String
    • Int
    API / Belt / Hashset / Int

    Int

    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)

    See Belt.HashSet

    key

    RESCRIPT
    type key = int

    t

    RESCRIPT
    type t

    make

    RESCRIPT
    let make: (~hintSize: int) => t

    clear

    RESCRIPT
    let clear: t => unit

    isEmpty

    RESCRIPT
    let isEmpty: t => bool

    add

    RESCRIPT
    let add: (t, key) => unit

    copy

    RESCRIPT
    let copy: t => t

    has

    RESCRIPT
    let has: (t, key) => bool

    remove

    RESCRIPT
    let remove: (t, key) => unit

    forEachU

    RESCRIPT
    let forEachU: (t, key => unit) => unit

    forEach

    RESCRIPT
    let forEach: (t, key => unit) => unit

    reduceU

    RESCRIPT
    let reduceU: (t, 'c, ('c, key) => 'c) => 'c

    reduce

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

    size

    RESCRIPT
    let size: t => int

    logStats

    RESCRIPT
    let logStats: t => unit

    toArray

    RESCRIPT
    let toArray: t => array<key>

    fromArray

    RESCRIPT
    let fromArray: array<key> => t

    mergeMany

    RESCRIPT
    let mergeMany: (t, array<key>) => unit

    getBucketHistogram

    RESCRIPT
    let getBucketHistogram: t => array<int>
    Types and values
    • t
      key
    • t
      t
    • v
      make
    • v
      clear
    • v
      isEmpty
    • v
      add
    • v
      copy
    • v
      has
    • v
      remove
    • v
      forEachU
    • v
      forEach
    • v
      reduceU
    • v
      reduce
    • v
      size
    • v
      logStats
    • v
      toArray
    • v
      fromArray
    • v
      mergeMany
    • v
      getBucketHistogram

    © 2024 The ReScript Project

    Software and assets distribution powered by KeyCDN.

    About
    • Community
    • ReScript Association
    Find us on