text: 'use strict'
  
  const generic = require('@nodeguy/generic')
  const _ = generic._
  const is = require('@nodeguy/type').is
  
  const findIndex = generic.function({name: 'findIndex', curry: true})
  
  // https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.findindex
  findIndex.method([_, is(Array)],
    (predicate, array) =>
      array.findIndex(predicate)
  )
  
  // https://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%.prototype.findindex
  findIndex.method([_, is(Int8Array)],
    (predicate, int8Array) =>
      int8Array.findIndex(predicate)
  )
  
  // https://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%.prototype.findindex
  findIndex.method([_, is(Uint8Array)],
    (predicate, uint8Array) =>
      uint8Array.findIndex(predicate)
  )
  
  // https://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%.prototype.findindex
  findIndex.method([_, is(Uint8ClampedArray)],
    (predicate, uint8ClampedArray) =>
      uint8ClampedArray.findIndex(predicate)
  )
  
  // https://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%.prototype.findindex
  findIndex.method([_, is(Int16Array)],
    (predicate, int16Array) =>
      int16Array.findIndex(predicate)
  )
  
  // https://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%.prototype.findindex
  findIndex.method([_, is(Uint16Array)],
    (predicate, uint16Array) =>
      uint16Array.findIndex(predicate)
  )
  
  // https://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%.prototype.findindex
  findIndex.method([_, is(Int32Array)],
    (predicate, int32Array) =>
      int32Array.findIndex(predicate)
  )
  
  // https://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%.prototype.findindex
  findIndex.method([_, is(Uint32Array)],
    (predicate, uint32Array) =>
      uint32Array.findIndex(predicate)
  )
  
  // https://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%.prototype.findindex
  findIndex.method([_, is(Float32Array)],
    (predicate, float32Array) =>
      float32Array.findIndex(predicate)
  )
  
  // https://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%.prototype.findindex
  findIndex.method([_, is(Float64Array)],
    (predicate, float64Array) =>
      float64Array.findIndex(predicate)
  )
  
  module.exports = findIndex
  