"use strict";Object.defineProperty(exports, "__esModule", {value: true});


var _chunkKT2LSWBGjs = require('./chunk-KT2LSWBG.js');



var _chunkS2Z5L3RBjs = require('./chunk-S2Z5L3RB.js');


var _chunkH2RXSEUSjs = require('./chunk-H2RXSEUS.js');


var _chunkT4ZJ6CA2js = require('./chunk-T4ZJ6CA2.js');


var _chunk7K74W2G3js = require('./chunk-7K74W2G3.js');


var _chunkSQA7G4TEjs = require('./chunk-SQA7G4TE.js');


var _chunk6C3VEZWHjs = require('./chunk-6C3VEZWH.js');

// src/Filterable.ts
var Filterable_exports = {};
_chunk6C3VEZWHjs.__export.call(void 0, Filterable_exports, {
  filter: () => filter,
  filterMap: () => filterMap,
  getFilterableComposition: () => getFilterableComposition,
  partition: () => partition,
  partitionMap: () => partitionMap
});
function filter(F, G) {
  return (predicate) => (fga) => F.map(fga, (ga) => G.filter(ga, predicate));
}
function filterMap(F, G) {
  return (f) => (fga) => F.map(fga, (ga) => G.filterMap(ga, f));
}
function partition(F, G) {
  const _filter = filter(F, G);
  return (predicate) => {
    const left = _filter(_chunkH2RXSEUSjs.not.call(void 0, predicate));
    const right = _filter(predicate);
    return (fgb) => _chunkT4ZJ6CA2js.separated.call(void 0, left(fgb), right(fgb));
  };
}
function partitionMap(F, G) {
  const _filterMap = filterMap(F, G);
  return (f) => (fga) => _chunkT4ZJ6CA2js.separated.call(void 0, 
    _chunkSQA7G4TEjs.pipe.call(void 0, 
      fga,
      _filterMap((a) => _chunkS2Z5L3RBjs.getLeft.call(void 0, f(a)))
    ),
    _chunkSQA7G4TEjs.pipe.call(void 0, 
      fga,
      _filterMap((a) => _chunkS2Z5L3RBjs.getRight.call(void 0, f(a)))
    )
  );
}
function getFilterableComposition(F, G) {
  const map = _chunk7K74W2G3js.getFunctorComposition.call(void 0, F, G).map;
  const _compact = _chunkKT2LSWBGjs.compact.call(void 0, F, G);
  const _separate = _chunkKT2LSWBGjs.separate.call(void 0, F, G, G);
  const _filter = filter(F, G);
  const _filterMap = filterMap(F, G);
  const _partition = partition(F, G);
  const _partitionMap = partitionMap(F, G);
  return {
    map,
    compact: _compact,
    separate: _separate,
    filter: (fga, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fga, _filter(f)),
    filterMap: (fga, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fga, _filterMap(f)),
    partition: (fga, p) => _chunkSQA7G4TEjs.pipe.call(void 0, fga, _partition(p)),
    partitionMap: (fga, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fga, _partitionMap(f))
  };
}








exports.filter = filter; exports.filterMap = filterMap; exports.partition = partition; exports.partitionMap = partitionMap; exports.getFilterableComposition = getFilterableComposition; exports.Filterable_exports = Filterable_exports;
