Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fun/mod.ts>optics.filter

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function optics.filter
import { optics } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { filter } = optics;

Given an Optic focused on A, filter out or refine that A.

Type Parameters

A
B extends A

Parameters

r: Refinement<A, B>

Returns

<U extends Tag, S>(first: Optic<U, S, A>) => Optic<Align<U, AffineTag>, S, B>

Parameters

r: Predicate<A>

Returns

<U extends Tag, S>(first: Optic<U, S, A>) => Optic<Align<U, AffineTag>, S, A>