Why is the function for lifting a value into a functor named pure
in Control.Applicative?
相关问题
- Understanding do notation for simple Reader monad:
- Making Custom Instances of PersistBackend
- Haskell: What is the differrence between `Num [a]
- applying a list to an entered function to check fo
- Haskell split a list into two by a pivot value
相关文章
- Is it possible to write pattern-matched functions
- Haskell underscore vs. explicit variable
- Top-level expression evaluation at compile time
- Stuck in the State Monad
- foldr vs foldr1 usage in Haskell
- List of checkboxes with digestive-functors
- How does this list comprehension over the inits of
- Replacing => in place of -> in function type signa
It's a little like
fromInteger
. Its argument is always a pure value or function that will be lifted into the functor. Perhaps it should have beenfromPure
but you know how Haskell people love to shorten names (e.g.fst
andsnd
instead offirst
andsecond
...).Think of
pure
as an adjective.foo <*> pure 4
=foo
applied on a pure value4
.(As for the exact reason why it's called
pure
, probably only McBride and Paterson will know.)