What does Haskell call the Hom Functor/Monad?

2019-05-07 00:39发布

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条回答
不美不萌又怎样
2楼-- · 2019-05-07 01:27

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.

查看更多
登录 后发表回答