[Haskell-cafe] global, modifiable variable for debugging

Gregory Collins greg at gregorycollins.net
Mon Dec 27 11:04:52 CET 2010


We have some code to do exactly this:

https://github.com/snapframework/snap-core/blob/master/src/Snap/Internal/Debug.hs

You set a DEBUG environment variable to turn debugging output on. We
should probably split this code out into its own package.

G

On Sun, Dec 26, 2010 at 8:53 PM,  <briand at aracnet.com> wrote:
> Hi,
>
> I have a program with a debug flag in it (Strangely I've yet to be
> able to write bug-free code).  I'd like to change the state of the
> debug flag based on command line args.
>
> I looked at IOVar but that would cause all the pure procedures to get
> swallowed by the IO Monad.
>
> Is a better way to get this behavior ?
>
> Thanks,
>
> Brian
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



-- 
Gregory Collins <greg at gregorycollins.net>



More information about the Haskell-Cafe mailing list