UNPKG

moy-fp

Version:
15 lines (12 loc) 308 B
import curry from '../Function/curry' import nthList from '../List/nthList' import update from '../List/update' import lens from './lens' /** * Number -> Lens s a * Lens s a = Functor f => (a -> f a) -> s -> f s */ const lensIndex = curry( n => lens(nthList(n))(update(n)) ) export default lensIndex