Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
At this point in my learning journey, I simply accepted that this function is called pure (both in Haskell and in PureScript), but it would have helped a lot if I had known the reasoning behind thi...
#1: Initial revision
Where does the name of the `pure` function in the `Applicative` type class come from?
At this point in my learning journey, I simply accepted that this function is called `pure` (both [in Haskell][1] and [in PureScript][2]), but it would have helped a lot if I had known the reasoning behind this name. Both the Haskell reference and the PureScript docs use the word "_lift_", > <sup>[Haskell][1]</sup> Lift a value into the Structure. > > --- > > <sup>[PureScript][2]</sup> `pure` can be seen as the function which lifts functions of zero arguments but `lift` is already in use (e.g., for monad transformers<sup>[Haskell][3], [Purescript][4]</sup>). The [PureScript reference for `pure`][2] also uses the word "_wrap_", but I understand now why the functor explanations along the lines of "_wrap value in a box_" can be misleading or miss the point entirely. For these reasons, I do like the name `pure` as it has no "baggage" and I can focus on understanding the topic without preconceptions. Books and tutorials using the word "_context_" helped me understand the more abstract constructs, so I sometimes wondered if using "_embed_" would make sense here, but then I let it go. --- Anyway, I still research from time to time to figure out `pure`'s etymology, but did not get any closer yet. [1]: https://hackage.haskell.org/package/base-4.20.0.1/docs/Prelude.html#v:pure [2]: https://pursuit.purescript.org/packages/purescript-prelude/6.0.1/docs/Control.Applicative#t:Applicative [3]: https://hackage.haskell.org/package/transformers-0.6.1.1/docs/Control-Monad-Trans-Class.html#v:lift [4]: https://pursuit.purescript.org/packages/purescript-transformers/6.0.0/docs/Control.Monad.Trans.Class#v:lift