Start to play around with TH :)

This commit is contained in:
Rowan Torbitzky-Lane 2025-02-11 00:13:34 -06:00
parent 1155905be3
commit 76df52c554
3 changed files with 14 additions and 1 deletions

View File

@ -57,6 +57,7 @@ library
, HushGP.PushTests.IntTests , HushGP.PushTests.IntTests
, HushGP.PushTests.GenericTests , HushGP.PushTests.GenericTests
, HushGP.PushTests.UtilTests , HushGP.PushTests.UtilTests
, HushGP.TH
-- Modules included in this library but not exported. -- Modules included in this library but not exported.
-- other-modules: -- other-modules:

View File

@ -15,7 +15,7 @@
- [X] Standardize the pattern matching parameter names, such as c1 : cs - [X] Standardize the pattern matching parameter names, such as c1 : cs
- [ ] Write unit/quickcheck tests for all of the instructions - [ ] Write unit/quickcheck tests for all of the instructions
- [ ] Use template haskell to generate function lists - [ ] Use template haskell to generate function lists
- [ ] Move utility functions to their own file - [X] Move utility functions to their own file
## PushGP TODO ## PushGP TODO
- [ ] Implement a Plushy genome translator - [ ] Implement a Plushy genome translator

12
src/HushGP/TH.hs Normal file
View File

@ -0,0 +1,12 @@
{-# LANGUAGE TemplateHaskell #-}
module HushGP.TH where
import System.IO
thTest :: IO ()
thTest = do
handle <- openFile "src/HushGP/Instructions/IntInstructions.hs" ReadMode
let list = hGetContents handle
toPrint <- list
print toPrint
hClose handle