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 Functions
DependencyRunner DependencyRunner
SiteGenerator SiteGenerator
Precomputer
build-depends: build-depends:
base >=4.14 && <4.20 base >=4.14 && <4.20
, mtl , mtl
@ -49,7 +48,6 @@ library
, pandoc , pandoc
, JuicyPixels , JuicyPixels
, JuicyPixels-stbir , JuicyPixels-stbir
, template-haskell >=2.16 && <2.22
executable byg executable byg
import: common import: common
@ -57,3 +55,4 @@ executable byg
build-depends: build-depends:
base >=4.14 && <4.20 base >=4.14 && <4.20
, byg , byg
, text

View File

@ -1,17 +1,24 @@
{-# LANGUAGE TemplateHaskell #-}
module Main where 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 System.Environment (getArgs)
import qualified Data.Text.IO as T
dependencies :: [Dependency]
dependencies = evalDepGenM generateSite
main :: IO () main :: IO ()
main = do main = do
args <- getArgs args <- getArgs
case args of case args of
["run"] -> ["run"] ->
$$(Precomputer.runDeps) DR.runDepRunMIO $ DR.runDeps dependencies
["tree"] -> ["tree"] ->
$$(Precomputer.formatDependencyTrees) T.putStr $ D.formatDependencyTrees dependencies
_ -> _ ->
error "unexpected arguments" 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)) ||]