Haskell称之为Hom Functor / Monad是什么? [英] What does Haskell call the Hom Functor/Monad?
问题描述
我想在我的代码中使用它,并且不想复制它,但由于它只涉及大量通用的单词,如function或composition,所以我无法通过搜索找到它。
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
推荐答案
这是基本的读者(或环境)monad ,通常被称为(( - >)e)
。 (这是(e - >)
写成部分应用的函数,而不是作为一个部分;后面的语法有问题需要解析。)你可以通过导入 Control.Monad.Reader
或 Control.Monad.Instances
。
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
.
这篇关于Haskell称之为Hom Functor / Monad是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!