Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does Haskell call the Hom Functor/Monad?

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
like image 301
Owen Avatar asked Dec 09 '22 07:12

Owen


1 Answers

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.

like image 185
geekosaur Avatar answered Dec 24 '22 12:12

geekosaur