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
      • t
        key
      • t
        t
      • v
        make
      • v
        clear
      • v
        isEmpty
      • v
        set
      • v
        copy
      • v
        get
      • v
        has
      • v
        remove
      • v
        forEachU
      • v
        forEach
      • v
        reduceU
      • v
        reduce
      • v
        keepMapInPlaceU
      • v
        keepMapInPlace
      • v
        size
      • v
        toArray
      • v
        keysToArray
      • v
        valuesToArray
      • v
        fromArray
      • v
        mergeMany
      • v
        getBucketHistogram
      • v
        logStats
    • Int
    HashSet
    • String
    • Int
    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 / Hashmap / String

    String

    Specalized when key type is string, more efficient than the generic type

    key

    RESCRIPT
    type key = string

    t

    RESCRIPT
    type t<'b>

    make

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

    clear

    RESCRIPT
    let clear: t<'b> => unit

    isEmpty

    RESCRIPT
    let isEmpty: t<'a> => bool

    set

    RESCRIPT
    let set: (t<'a>, key, 'a) => unit

    setDone(tbl, k, v) if k does not exist, add the binding k,v, otherwise, update the old value with the new v

    copy

    RESCRIPT
    let copy: t<'a> => t<'a>

    get

    RESCRIPT
    let get: (t<'a>, key) => option<'a>

    has

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

    remove

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

    forEachU

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

    forEach

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

    reduceU

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

    reduce

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

    keepMapInPlaceU

    RESCRIPT
    let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit

    keepMapInPlace

    RESCRIPT
    let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit

    size

    RESCRIPT
    let size: t<'a> => int

    toArray

    RESCRIPT
    let toArray: t<'a> => array<(key, 'a)>

    keysToArray

    RESCRIPT
    let keysToArray: t<'a> => array<key>

    valuesToArray

    RESCRIPT
    let valuesToArray: t<'a> => array<'a>

    fromArray

    RESCRIPT
    let fromArray: array<(key, 'a)> => t<'a>

    mergeMany

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

    getBucketHistogram

    RESCRIPT
    let getBucketHistogram: t<'a> => array<int>

    logStats

    RESCRIPT
    let logStats: t<'a> => unit
    Types and values
    • t
      key
    • t
      t
    • v
      make
    • v
      clear
    • v
      isEmpty
    • v
      set
    • v
      copy
    • v
      get
    • v
      has
    • v
      remove
    • v
      forEachU
    • v
      forEach
    • v
      reduceU
    • v
      reduce
    • v
      keepMapInPlaceU
    • v
      keepMapInPlace
    • v
      size
    • v
      toArray
    • v
      keysToArray
    • v
      valuesToArray
    • v
      fromArray
    • v
      mergeMany
    • v
      getBucketHistogram
    • v
      logStats

    © 2024 The ReScript Project

    Software and assets distribution powered by KeyCDN.

    About
    • Community
    • ReScript Association
    Find us on