Cheddar Documentation
  • Introduction
  • Syntax
  • Literals
    • Comment
    • String
    • Number
    • Array
    • Boolean
  • Mathematics
    • Addition
    • Subtraction
    • Multiplication
    • Division
    • Exponentiation
    • Remainder
    • Negation
    • Sign
    • Root
    • Bitwise AND
    • Bitwise OR
    • Bitwise XOR
    • Bitwise NOT
    • Bitwise Left Shift
    • Bitwise Right Shift
  • Variables
  • Functions
    • Defining
      • Lambda
      • Functionized Operators
      • Functionized Properties
    • Operations
      • Functional Bonding
      • Functional Composition
  • Default Operators
    • What Is
    • Instance-of
    • Actually Is
  • Control Flow
    • Conditional
    • Loops
      • For Loops
      • While Loops
  • Standard Library
    • String
      • Bytes
      • Count
      • Length
      • Match
      • Slice
      • Tail
      • Chars
      • Head
      • Lines
      • Ord
      • Split
      • Test
      • Chunk
      • Index
      • Lower
      • Reverse
      • Substitute
      • Upper
  • Developing
    • Structure
    • Primitive Objects
      • Scope
      • Class
      • Variable
      • Namespace
    • Getting Started
    • API
      • Primitives
        • string
        • number
        • array
        • bool
        • func
        • nil
Powered by GitBook
On this page
  • Syntax
  • Explanation
  • Examples

Was this helpful?

  1. Functions
  2. Operations

Functional Bonding

Syntax

f & a
a & f

Explanation

Depending on the side of the operand to bond, it will be binded to side it is on to the function.

f & a == *args -> f(*(args + [a]))
a & f == *args -> f(*([a] + args))

Examples

The following are examples utilizing functional operators:

let mod10 = (%) & 10;
mod(15) == 5
let reciprocal = 1 & (/);
reciprocal(1 / 3) == 3
PreviousOperationsNextFunctional Composition

Last updated 4 years ago

Was this helpful?