Get rid of old template haskell experiments
This commit is contained in:
parent
6f7389a18a
commit
c17da86e02
|
@ -37,7 +37,6 @@ library
|
|||
Functions
|
||||
DependencyRunner
|
||||
SiteGenerator
|
||||
Precomputer
|
||||
build-depends:
|
||||
base >=4.14 && <4.20
|
||||
, mtl
|
||||
|
@ -49,7 +48,6 @@ library
|
|||
, pandoc
|
||||
, JuicyPixels
|
||||
, JuicyPixels-stbir
|
||||
, template-haskell >=2.16 && <2.22
|
||||
|
||||
executable byg
|
||||
import: common
|
||||
|
@ -57,3 +55,4 @@ executable byg
|
|||
build-depends:
|
||||
base >=4.14 && <4.20
|
||||
, byg
|
||||
, text
|
||||
|
|
|
@ -1,17 +1,24 @@
|
|||
{-# LANGUAGE TemplateHaskell #-}
|
||||
module Main where
|
||||
|
||||
import qualified Precomputer
|
||||
import Types (Dependency)
|
||||
import qualified DependencyRunner as DR
|
||||
import qualified Types.Dependency as D
|
||||
import SiteGenerator (generateSite)
|
||||
import DependencyGenerator (evalDepGenM)
|
||||
|
||||
import System.Environment (getArgs)
|
||||
import qualified Data.Text.IO as T
|
||||
|
||||
dependencies :: [Dependency]
|
||||
dependencies = evalDepGenM generateSite
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
args <- getArgs
|
||||
case args of
|
||||
["run"] ->
|
||||
$$(Precomputer.runDeps)
|
||||
DR.runDepRunMIO $ DR.runDeps dependencies
|
||||
["tree"] ->
|
||||
$$(Precomputer.formatDependencyTrees)
|
||||
T.putStr $ D.formatDependencyTrees dependencies
|
||||
_ ->
|
||||
error "unexpected arguments"
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
{-# LANGUAGE TemplateHaskell #-}
|
||||
module Precomputer
|
||||
( runDeps
|
||||
, formatDependencyTrees
|
||||
) where
|
||||
|
||||
import qualified DependencyRunner as DR
|
||||
import qualified Types.Dependency as D
|
||||
import SiteGenerator (generateSite)
|
||||
import DependencyGenerator (evalDepGenM)
|
||||
|
||||
import qualified Data.Text.IO as T
|
||||
import Language.Haskell.TH.Syntax
|
||||
|
||||
runDeps :: Code Q (IO ())
|
||||
runDeps = [|| DR.runDepRunMIO (DR.runDeps (evalDepGenM generateSite)) ||]
|
||||
|
||||
formatDependencyTrees :: Code Q (IO ())
|
||||
formatDependencyTrees = [|| T.putStr (D.formatDependencyTrees (evalDepGenM generateSite)) ||]
|
Loading…
Reference in New Issue