Re:Printf(“%s %s”, dependency, injection)
by Athas on Tuesday October 19, 2021 @05:41AM
(#28916398)
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.
Re:Printf(“%s %s”, dependency, injection)
by eru on Wednesday October 20, 2021 @01:30AM
(#28927099)
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.
* 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...