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

Safe HaskellNone
LanguageHaskell98

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 Exp Source

A string containing the current file name.

__LINE__ :: Q Exp Source

An integer containing the current line number.

__MODULE__ :: Q Exp Source

A string containing the current module name.

__PACKAGE__ :: Q Exp Source

A string containing the current package name.

__DATE__ :: Q Exp Source

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

__TIME__ :: Q Exp Source

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