This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE TemplateHaskell #-} | |
| module Printf (printf) where | |
| -- Импортируем инструментарий Template Haskell | |
| import Language.Haskell.TH | |
| -- | Шаблон для функции printf | |
| -- Пример использования: | |
| -- > putStrLn ( $(printf "Number %d is %s of %d.") 327 "square" (327^2) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE TemplateHaskell #-} | |
| import Language.Haskell.TH | |
| import Language.Haskell.TH.Lib hiding (rename) | |
| import Control.Monad (liftM) | |
| import Data.List (lookup) | |
| import Data.Generics.Aliases (mkT) | |
| import Data.Generics.Schemes (everywhere) | |
| ---------------------------------------------------------------- |
NewerOlder