module import compose from '../../compose' ; import identity from '../../identity' ; import maybe , { Maybe } from '../maybe' ; import type { Map } from '../../types/map' ; import permutation2 from '../../permutation/permutation-2' ; import fold from './fold' ; import { isJust } from './guards' ; import ternary from '../../ternary' ; /**
 * Maps the value of the provided `monad` through the `transition` function
 * and returns a new `Maybe` of the mapped value.
 */ export default function fmap < Value , NextValue = Value > ( transition ) ; /**
 * Maps the value of the provided `monad` through the `transition` function
 * and returns a new `Maybe` of the mapped value.
 */ export default function fmap < Value , NextValue = Value > ( monad , transition ) ; export default function fmap ( ... args ) { return permutation2 ( < Value , NextValue > ( monad , transition ) : Maybe < NextValue > => { return ternary ( isJust , compose ( maybe , transition , fold ) as ( monad : Maybe < Value > ) => Maybe < NextValue > , identity ) ( monad ) ; } ) ( ... args ) ; }