since import { Index , Optional } from '..' ; import { lookup , updateAt } from 'fp-ts/lib/Array' ; import { isNone } from 'fp-ts/lib/Option' ; category since export function indexArray < A = never > ( ) { return new Index ( ( i ) => new Optional ( ( as ) => lookup ( i , as ) , ( a ) => ( as ) => { const oas = updateAt ( i , a ) ( as ) ; if ( isNone ( oas ) ) { return as ; } else { return oas . value ; } } ) ) ; }