code: function lastToMaybe(last) {
    if(isFunction(last)) {
      return function(x) {
        const m = last(x)
  
        if(!isSameType(Last, m)) {
          throw new TypeError('lastToMaybe: Last returning function required')
        }
  
        return applyTransform(m)
      }
    }
  
    if(isSameType(Last, last)) {
      return applyTransform(last)
    }
  
    throw new TypeError('lastToMaybe: Last or Last returning function required')
  }
docs: lastToMaybe : Last a -> Maybe a lastToMaybe : (a -> Last b) -> a -> Maybe b