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