Partitioning an array

Useful for deduplicating filtering logic:

import { partition } from 'fp-ts/Array'  
  
const isEven = (n: number) => n % 2 === 0  
const separated = partition(isEven)([1,2,3])  
// even on the right, others on the left  
console.log(separated.right) // prints [2]  
console.log(separated.left) // prints [1,3]  

Would you like to connect? Subscribe via email or RSS , or follow me on Twitter!