Jason Dagit wrote:
> Could you use haskell-src from TH and then unsafePerformIO to get the
> reading to work during compile time?  I've done something like this in
> the past with Language.Haskell and TH.  I described it here:
> http://blog.codersbase.com/2006/09/01/simple-unit-testing-in-haskell/
> 
> Maybe someone who has studied more TH knows a way to remove the 
> unsafePerformIO.


Replace

  tests :: [String]
  tests = unsafePerformIO $

by

  tests :: Q [String]
  tests = runIO $

and

  $(mkChecks tests)

by

  $(mkChecks =<< tests)

(The Q monad should really have an MonadIO instance.)

HTH,

Bertram
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to