草庐IT

EndoFunctor

全部标签

java - Java 中的仿函数

我正在尝试在Java中定义类似于Haskell的仿函数的类。特此,仿函数定义为:/***Programminglanguagesallowonly(justsimplyenough)endofunctor,thatarefunctorsfromandtothesamecategory.*Inthiscase,thecategoryistheoneofthedatatypes(inhereType,inordertomakeitmoreclear)*/publicinterfaceEndoFunctorextendsType{/***Thebasicimplementationforan