"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
exports.enforceContext =
  exports.enforceError =
  exports.enforceOutput =
  exports.hole =
  exports.unsafeCoerce =
  exports.untupled =
  exports.tupled =
  exports.tuple =
  exports.not =
  exports.literal =
  exports.identity =
  exports.flip =
  exports.constVoid =
  exports.constUndefined =
  exports.constTrue =
  exports.constNull =
  exports.constFalse =
  exports.constant =
  exports.absurd =
  exports.pipe =
  exports.flow =
    void 0
const flow_1 = require("./flow")
Object.defineProperty(exports, "flow", {
  enumerable: true,
  get: function () {
    return flow_1.flow
  }
})
const pipe_1 = require("./pipe")
Object.defineProperty(exports, "pipe", {
  enumerable: true,
  get: function () {
    return pipe_1.pipe
  }
})
/**
 * Will raise if called
 */
function absurd(_) {
  throw new Error("Called `absurd` function which should be uncallable")
}
exports.absurd = absurd
/**
 * A constant function that always return A
 */
function constant(a) {
  return () => a
}
exports.constant = constant
/**
 * A thunk that returns always `false`
 */
const constFalse = () => {
  return false
}
exports.constFalse = constFalse
/**
 * A thunk that returns always `null`
 */
const constNull = () => {
  return null
}
exports.constNull = constNull
/**
 * A thunk that returns always `true`
 */
const constTrue = () => {
  return true
}
exports.constTrue = constTrue
/**
 * A thunk that returns always `undefined`
 */
const constUndefined = () => {
  return
}
exports.constUndefined = constUndefined
/**
 * A thunk that returns always `void`
 */
const constVoid = () => {
  return
}
exports.constVoid = constVoid
/**
 * Flips the order of the arguments of a function of two arguments.
 */
function flip(f) {
  return (b, a) => f(a, b)
}
exports.flip = flip
/**
 * Identity function
 *
 * @optimize identity
 */
function identity(a) {
  return a
}
exports.identity = identity
/**
 * Force string to be literal
 *
 * @optimize identity
 */
function literal(k) {
  return k
}
exports.literal = literal
/**
 * Inverts a boolean predicate
 */
function not(predicate) {
  return (a) => !predicate(a)
}
exports.not = not
/**
 * Construct tuples
 */
function tuple(...t) {
  return t
}
exports.tuple = tuple
/**
 * Creates a tupled version of this function: instead of `n` arguments, it accepts a single tuple argument.
 *
 * @example
 * const add = tupled((x: number, y: number): number => x + y)
 *
 * assert.strictEqual(add([1, 2]), 3)
 */
function tupled(f) {
  return (a) => f(...a)
}
exports.tupled = tupled
/**
 * Inverse function of `tupled`
 */
function untupled(f) {
  return (...a) => f(a)
}
exports.untupled = untupled
/**
 * Performs unsafe coercion of types
 *
 * @optimize identity
 */
function unsafeCoerce(a) {
  return a
}
exports.unsafeCoerce = unsafeCoerce
/**
 * Type Hole, to be used while implementing functions where you need a placeholder
 */
function hole() {
  throw new Error("Hole should never be called")
}
exports.hole = hole
/**
 * Requires _A to be the one specified
 */
function enforceOutput() {
  return (
    /**
     * @optimize identity
     */
    (_) => _
  )
}
exports.enforceOutput = enforceOutput
/**
 * Requires _E to be the one specified
 */
function enforceError() {
  return (
    /**
     * @optimize identity
     */
    (_) => _
  )
}
exports.enforceError = enforceError
/**
 * Requires _R to be the one specified
 */
function enforceContext() {
  return (
    /**
     * @optimize identity
     */
    (_) => _
  )
}
exports.enforceContext = enforceContext
//# sourceMappingURL=core.js.map
