pseudomacros-0.0.1: cpp-style built-in macros using Template Haskell

Safe HaskellNone

PseudoMacros

Description

The pseudo-macros in this module are meant to be used via Template Haskell (see http://www.haskell.org/ghc/docs/latest/html/users_guide/template-haskell.html for more information).

Example:

 {-# LANGUAGE TemplateHaskell #-}
 import PseudoMacros

 main :: IO ()
 main = putStrLn ("Hello from " ++ $__FILE__ ++ ", line " ++ show $__LINE__ ++ "!")

That is, enable the TemplateHaskell extension and put a $ before each pseudo-macro.

Synopsis

Documentation

__FILE__ :: Q ExpSource

A string containing the current file name.

__LINE__ :: Q ExpSource

An integer containing the current line number.

__MODULE__ :: Q ExpSource

A string containing the current module name.

__PACKAGE__ :: Q ExpSource

A string containing the current package name.

__DATE__ :: Q ExpSource

A string containing the current date in the format YYYY-MM-DD.

__TIME__ :: Q ExpSource

A string containing the current time in the format HH:MM:SS.