Remove none options from an array

Useful to preserve types when removing nullables from a list.

import { compact } from "fp-ts/lib/Array"  
import { some, none } from "fp-ts/lib/Option"  
const numsOptions = [none, some(1), none, some(2)]  
const nums = A.compact(numsOptions) // => [1, 2] 🎉  

More info: https://github.com/gcanti/fp-ts/issues/34.


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