remove template haskell file

This commit is contained in:
Rowan Torbitzky-Lane 2025-02-11 16:30:55 -06:00
parent 2f2b19e3d0
commit 0dcc8b6b85

View File

@ -1,36 +0,0 @@
{-# LANGUAGE TemplateHaskell #-}
module HushGP.TH where
import System.IO
import Text.Regex.TDFA
import Data.List
import HushGP.State
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
-- listFields :: Name -> Q [Dec]
-- listFields name = do
-- TyConI (DataD _ _ _ [RecC _ fields] _ ) <- reify name
strHead :: [String] -> String
strHead strxs =
case uncons strxs of
Just (str, _) -> str
_ -> []
instructionRegex :: String
instructionRegex = "instruction[a-zA-Z0-9]* ::"
testRegex :: String -> Bool
testRegex str = str =~ instructionRegex :: Bool
thTest :: IO ()
thTest = do
handle <- openFile "src/HushGP/Instructions/IntInstructions.hs" ReadMode
let list = hGetContents handle
toPrint <- list
let funcs = map (strHead . words) (filter testRegex (lines toPrint))
let names = map (newName :: (String -> IO Name)) funcs
hClose handle
print "hello"
-- let instruction = "instructionIntAdd"