Skip to content

Commit

Permalink
fix constant references, closes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
KiaraGrouwstra committed Jan 26, 2020
1 parent 870db1e commit 5a586ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion library/Generation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ fillHoles maxHoles block_asts used_blocks expr_blocks expr = do
-- | filter building blocks to those matching a hole in the (let-in) expression, and get the results Exprs
fillHole :: HashMap String Expr -> Set String -> [(String, Expr)] -> Expr -> Interpreter ([(Expr, Set String, Expr)], [(Expr, Set String, Expr)])
fillHole block_asts used_blocks expr_blocks expr = do
-- TODO: for holed expressions the type-check fails
partial_ <- filterByCompile False partial
complete_ <- filterByCompile True complete
return (partial_, complete_)
Expand Down
4 changes: 2 additions & 2 deletions library/Program.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Control.Monad (forM_, forM)
import Hint (runInterpreterMain, say, genInputs, fnIoPairs, exprType)
import Ast (letRes, genBlockVariants, filterTypeSigIoFns)
import Generation (fnOutputs, genFns, instantiateTypes)
import Types (Tp, Expr, fnTypeIO, genTypes, tyCon, expTypeSig)
import Types (Tp, Expr, fnTypeIO, genTypes, tyCon, expTypeSig, parseExpr)
import Utility (groupByVal, flatten, pp, pickKeys, fromKeys, fromVals, mapTuple, randomSplit)
import Configs (nestLimit, maxInstances, numInputs, genMaxHoles, split)
import FindHoles (gtrExpr)
Expand All @@ -29,7 +29,7 @@ program :: Interpreter ()
program = do
say "\ngenerating task functions:"
block_fn_types :: HashMap String Tp <- mapM exprType fnAsts
let expr_blocks :: [(String, Expr)] = genBlockVariants block_fn_types ++ toList constants
let expr_blocks :: [(String, Expr)] = genBlockVariants block_fn_types ++ toList (fromKeys parseExpr $ keys constants)
programs :: [Expr] <- genFns genMaxHoles expr_blocks blockAsts
say $ "programs: " ++ show (pp <$> programs)
let task_fns = programs
Expand Down

0 comments on commit 5a586ce

Please sign in to comment.