Hacker Newsnew | past | comments | ask | show | jobs | submitlogin



While this is true, it should be noted that:

* Implicit parameters are a language extension, not part of standard Haskell (although extensions are so ubiquitously used that this does not matter much).

* Implicit parameters are rarely used[0]. I would not be surprised if most experienced Haskell programmers have never used them, and while they may know they exist, they might not even remember the syntax or semantics. I belong to that category myself. In Haskell, type classes tend to be used for what other languages might do with implicit parameters.

[0]: https://gist.github.com/atondwal/ee869b951b5cf9b6653f7deda0b...


In more orthodox Haskell, you can use eg the 'Reader Monad' with a suitable datastructure (or combination of Applicatives) where other languages would use dynamically scoped variables.


Nice! I was wondering if implicit parameters were equivalent to dynamic scoping. It seems to be the case.

more on the topic:

http://blog.ezyang.com/2020/08/dynamic-scoping-is-an-effect-...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: