about summary refs log tree commit diff
path: root/third_party/bazel/rules_haskell/tests/extra-source-files/FooTH.hs
blob: 24d663108355513bd1c942a96983831b3304efe8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
{-# LANGUAGE TemplateHaskell #-}

module FooTH (embedFile) where

import Language.Haskell.TH
import Language.Haskell.TH.Syntax

embedFile :: FilePath -> Q Exp
embedFile path = do
  str <- runIO (readFile path)
  addDependentFile path
  [| str |]