import { Applicative , applicative , AbstractApplicative } from "./applicative" ; import Endo from "./monoids/endo" ; export class ConstEndo < M , N > extends AbstractApplicative < N > { constructor ( private m ) { super ( ) ; } map < A , B > ( f ) { return < any > this ; } static of < B > ( b ) { return new ConstEndo ( Endo . identity ( ) ) ; } of < B > ( b ) { return new ConstEndo ( Endo . identity ( ) ) ; } ap < B > ( a ) { return new ConstEndo ( a . m . combine ( this . m ) ) ; } get ( ) { return this . m ; } }