import { Generic , Parameter } from "../.." ; import { FunctorProps } from "./functor" ; interface MonadProps < T , Params extends ArrayLike < any > > extends FunctorProps < T , Params > { } export type GenericMonad < F , A = any > = Generic < F , [ A ] , MonadProps < F , [ A ] > > ; export type MonadParameter < F > = Parameter < F , 0 , MonadProps < F , [ any ] > > ; export interface InstanceMonad < F > { map < U > ( transform ) : GenericMonad < F , U > ; chain < U extends GenericMonad < F > > ( transform ) : GenericMonad < F , MonadParameter < U > > ; } export interface StaticMonad < G > { map < F extends GenericMonad < G > , U > ( transform , mappable ) : GenericMonad < F , U > ; chain < F extends GenericMonad < G > , U extends GenericMonad < G > > ( transform , mappable ) : GenericMonad < F , MonadParameter < U > > ; of < T > ( a ) : GenericMonad < G , T > ; }