Package: effect
Module: Order
Creates a Reducer for combining Order instances, useful for aggregating orders in collections.
When to use
Use when you need a reducer that combines orders.
Details
Returns a reducer that combines orders using combine, uses alwaysEqual as
the identity element for empty collections, and uses combineAll for
combining collections of orders. The reducer can be used with fold operations
on collections.
Example (Creating a Reducer)
import { Order } from "effect"
const reducer = Order.makeReducer<number>()
const orders = [Order.Number, Order.flip(Order.Number)]
const combined = reducer.combineAll(orders)
console.log(combined(1, 2)) // -1 (uses first order)
See
combine to combine two orderscombineAll to combine multiple ordersReducer for reducing orders as a collection operationSignature
declare const makeReducer: <A>() => Reducer.Reducer<Order<A>>
Since v4.0.0