[Haskell-cafe] Reader monad, implicit parameters, or something else altogether?

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Mon Aug 18 12:49:43 EDT 2008

On 2008 Aug 18, at 10:59, Bjorn Buckwalter wrote:
> I would like to know if there is any consensus on what is the best way
> to make such a data structure accessible in pure functions. Passing it
> explicitly would be a mess. It seems that two options are to use
> either a Reader monad or implicit parameters. Using a Reader monad is
> straight forward enough though it requires writing/converting code
> in/to monadic style and adds some clutter to the formulae. It seems
> implicit parameters could be cleaner but I've seen them referred to as
> everything from evil to "just what you need" and rendering the Reader
> monad obsolete...
> What do you people recommend?

Last time I ran into this, I needed a Reader for other reasons so just  
reused it.

brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH

More information about the Haskell-Cafe mailing list