import { Index , List } from '../types' ; import { Maybe } from '@typed/maybe' ; import { curry2 } from '@typed/functions' ; import { equals } from '@typed/logic' ; import { findLastIndex } from '../findLastIndex' ; name export const lastIndexOf = curry2 ( __lastIndexOf ) ; export type LastIndexOf = { < A > ( value , list ) : Maybe < Index > ; < A > ( value ) : ( list : List < A > ) => Maybe < Index > ; } ; function __lastIndexOf < A > ( value , list ) { return findLastIndex ( equals ( value ) , list ) ; }