Link Search Menu Expand Document

HasFromDigit overview

The class of types which can be constructed by fromDigit

import { Int, NonNegative, NonZero } from 'fp-ts-numerics'

const myInt: NonNegative<Int> = Int.fromDigit(0)
const myInt: NonZero<NonNegative<Int>> = Int.fromDigit(8)

Added in v1.0.0


Table of contents


utils

HasFromDigit (interface)

Signature

export interface HasFromDigit<A> {
  /** @internal */
  [HAS_FROM_DIGIT]: typeof HAS_FROM_DIGIT
  fromDigit<D extends Digit>(digit: D): D extends 0 ? NonNegative<A> : NonZero<NonNegative<A>>
}

Added in v1.0.0

instanceHasFromDigit

Signature

export declare function instanceHasFromDigit<A>(members: Methods<A>): HasFromDigit<A>

Added in v1.0.0