since import { HKT , Kind , Kind2 , Kind3 , Kind4 , URIS , URIS2 , URIS3 , URIS4 } from 'fp-ts/lib/HKT' ; import { Applicative , Applicative1 , Applicative2 , Applicative3 , Applicative4 , Applicative2C } from 'fp-ts/lib/Applicative' ; import * as A from 'fp-ts/lib/Array' ; import * as O from 'fp-ts/lib/Option' ; example since export function filterA < F extends URIS4 > ( F ) ; export function filterA < F extends URIS3 > ( F ) ; export function filterA < F extends URIS2 > ( F ) ; export function filterA < F extends URIS2 , E > ( F ) ; export function filterA < F extends URIS > ( F ) ; export function filterA < F > ( F ) ; export function filterA < F > ( F ) { const wither = A . array . wither ( F ) ; return ( p ) => ( as ) => wither ( as , ( a ) => F . map ( p ( a ) , ( b ) => ( b ? O . some ( a ) : O . none ) ) ) ; }