On 20 January 2011 14:33, Bas van Dijk <[email protected]> wrote: > On 20 January 2011 10:48, Evan Laforge <[email protected]> wrote: >> I still like the pragma... > > Maybe Template Haskell can help: > > > module Location where > > import Language.Haskell.TH > import Data.Functor ((<$>)) > > loc :: Q Exp > loc = LitE . StringL . show . loc_start <$> location > > > {-# LANGUAGE TemplateHaskell #-} > > module Main where > > import Location > main = do > putStrLn $loc > putStrLn $loc > putStrLn $loc > > > *Main> main > (7,12) > (8,12) > (9,12) > > Regards, > > Bas >
You should also take a look at the control-monad-exception package which provides, among other things, support for exception call traces (with source locations). Take a look at the description to see an example: http://hackage.haskell.org/package/control-monad-exception Regards, Bas _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
