git.iko.soy/typeable/gitrev
on master help sign in
typeable/gitrev/Example.hs
17 lines 559 B history raw
1{-# LANGUAGE NoImplicitPrelude #-}
2{-# LANGUAGE TemplateHaskell #-}
3module Example where
4import Prelude (String, concat, error, otherwise)
5import Development.GitRev
7panic :: String -> a
8panic msg = error panicMsg
9 where panicMsg =
10 concat [ "[panic ", $(gitBranch), "@", $(gitHash)
11 , " (", $(gitCommitDate), ")"
12 , " (", $(gitCommitCount), " commits in HEAD)"
13 , dirty, "] ", msg ]
14 dirty | $(gitDirty) = " (uncommitted files present)"
15 | otherwise = ""
17main = panic "oh no!"