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

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

Reply via email to