Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

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

71%
+3 −0
Q&A 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 and in PureScript), but it would have helped a lot if I had known the reasoning behind thi...

1 answer  ·  posted 7mo ago by toraritte‭  ·  last activity 7mo ago by Derek Elkins‭

#1: Initial revision by user avatar toraritte‭ · 2024-06-01T12:06:04Z (7 months ago)
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