import { Either , isLeft } from '../Either' ; import { Unpack } from './types' ; import { curry3 } from '@typed/functions' ; import { fromLeft } from '../Left' ; import { fromRight } from '../Right' ; name export const unpack = curry3 ( __unpack ) ; function __unpack < A , B , C > ( f , g , either ) { return isLeft ( either ) ? f ( fromLeft ( either ) ) : g ( fromRight ( either ) ) ; }