What does Haskell call the Hom Functor/Monad?

谁都会走 提交于 2019-12-07 11:05:07

问题


I'd like to use it in my code and would rather not duplicate it, but since it involves only massively generic words like "function" or "composition" I can't find it by searching.

To be completely specific, I'm looking for

instance Functor (x->) where
    fmap f p = f . p

回答1:


This is the basic reader (or environment) monad, usually referred to as ((->) e). (This is (e ->) written as a partially applied function instead of as a section; the latter syntax is problematic to parse.) You can get it by importing Control.Monad.Reader or Control.Monad.Instances.



来源:https://stackoverflow.com/questions/6702169/what-does-haskell-call-the-hom-functor-monad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!