DocsPlaygroundBlogCommunityPackages
  • Playground
  • Blog
  • Community
  • Packages
  • X
  • Bluesky
  • GitHub
  • Forum
Language ManualAPISyntax LookupReact
Overview
Stdlib
submodules
  • Array
  • ArrayBuffer
  • AsyncIterator
  • BigInt
  • BigInt64Array
    • Constants
    BigUint64Array
    • Constants
  • Bool
  • Console
  • DataView
  • Date
    • UTC
  • Dict
  • Error
    • URIError
    • TypeError
    • SyntaxError
    • ReferenceError
    • RangeError
    • EvalError
  • Exn
  • Float
    • Constants
    Float32Array
    • Constants
    Float64Array
    • Constants
    Int
    • Ref
      • t
        t
      • v
        increment
      • v
        decrement
    • Bitwise
    • Constants
    Int16Array
    • Constants
    Int32Array
    • Constants
    Int8Array
    • Constants
  • IntervalId
  • Intl
    • Segments
    • Segmenter
    • RelativeTimeFormat
    • PluralRules
    • NumberFormat
      • Grouping
    • Locale
    • ListFormat
    • DateTimeFormat
    • Collator
    • Common
  • Iterator
  • JSON
    • Decode
    • Encode
    • Classify
    JsError
    • URIError
    • TypeError
    • SyntaxError
    • ReferenceError
    • RangeError
    • EvalError
  • JsExn
  • Lazy
  • List
  • Map
  • Math
    • Int
    • Constants
  • Null
  • Nullable
  • Object
  • Option
  • Ordering
  • Pair
  • Promise
  • RegExp
    • Result
  • Result
  • Set
  • String
  • Symbol
  • TimeoutId
  • Type
    • Classify
  • TypedArray
  • Uint16Array
    • Constants
    Uint32Array
    • Constants
    Uint8Array
    • Constants
    Uint8ClampedArray
    • Constants
  • WeakMap
  • WeakSet
  • Docs / API / Stdlib / Int / Ref

    Ref

    t

    RESCRIPT
    type t = ref<int>

    increment

    RESCRIPT
    let increment: ref<int> => unit

    increment(intRef) increments the value of the provided reference by 1.

    Examples

    RESCRIPT
    let myRef = ref(4) Int.Ref.increment(myRef) myRef.contents == 5

    decrement

    RESCRIPT
    let decrement: ref<int> => unit

    decrement(intRef) decrements the value of the provided reference by 1.

    Examples

    RESCRIPT
    let myRef = ref(4) Int.Ref.decrement(myRef) myRef.contents == 3
    Types and values
    • t
      t
    • v
      increment
    • v
      decrement

    © 2025 The ReScript Project

    About
    • Community
    • ReScript Association
    Find us on