Get rid of old template haskell experiments

This commit is contained in:
Niels G. W. Serup 2024-10-30 21:53:57 +01:00
parent 6f7389a18a
commit c17da86e02
No known key found for this signature in database
GPG Key ID: 38EEEBCE67324F19
3 changed files with 12 additions and 25 deletions

View File

@ -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

View File

@ -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"

View File

@ -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)) ||]