diff --git a/src/App/Fig.purs b/src/App/Fig.purs index 8cce1b272..24f5ba484 100644 --- a/src/App/Fig.purs +++ b/src/App/Fig.purs @@ -31,7 +31,7 @@ import Expr (Expr) import Foreign.Object (lookup) import Graph.GraphImpl (GraphImpl) import Lattice (𝔹, bot, botOf, erase, neg, topOf) -import Module (File(..), Folder(..), loadFile, open, openDatasetAs, openDefaultImports) +import Module (File(..), Folder(..), blah, defaultImports2, loadFile, open, openDatasetAs, openDefaultImports) import Partial.Unsafe (unsafePartial) import Pretty (prettyP) import Primitive (matrixRep) as P @@ -190,7 +190,7 @@ linkResult x γ0γ e1 e2 t1 _ v1 = do loadFig :: forall m. MonadAff m => MonadError Error m => FigSpec -> m Fig loadFig spec@{ file } = do - { progCxt: ProgCxtEval { γ } } :: GraphConfig GraphImpl <- openDefaultImports + { progCxt: ProgCxtEval { γ } } :: GraphConfig GraphImpl <- defaultImports2 >>= blah let γ0 = botOf <$> γ s' <- open file let s0 = botOf s' diff --git a/src/Module.purs b/src/Module.purs index cf4767396..5187c0fba 100644 --- a/src/Module.purs +++ b/src/Module.purs @@ -53,11 +53,11 @@ loadFile (Folder folder) (File file) = do parse :: forall a m. MonadError Error m => String -> SParser a -> m a parse src = liftEither <<< mapLeft (E.error <<< show) <<< runParser src -parseProgram :: forall m. MonadAff m => MonadError Error m => Folder -> File -> m (S.Expr Unit) +parseProgram :: forall m. MonadAff m => MonadError Error m => Folder -> File -> m (Raw S.Expr) parseProgram folder file = loadFile folder file >>= flip parse program -open :: forall m. MonadAff m => MonadError Error m => File -> m (S.Expr Unit) +open :: forall m. MonadAff m => MonadError Error m => File -> m (Raw S.Expr) open = parseProgram (Folder "fluid/example") loadModule :: forall m. MonadAff m => MonadWithGraphAlloc m => File -> ProgCxtEval Vertex -> m (ProgCxtEval Vertex) @@ -86,7 +86,7 @@ defaultImports2 = >>= loadModule2 (File "graphics") >>= loadModule2 (File "convolution") -loadDataset :: forall m. MonadAff m => MonadWithGraphAlloc m => File -> Raw ProgCxt -> m (ProgCxt Unit) +loadDataset :: forall m. MonadAff m => MonadWithGraphAlloc m => File -> Raw ProgCxt -> m (Raw ProgCxt) loadDataset file (ProgCxt r@{ datasets }) = do dataset <- parseProgram (Folder "fluid") file >>= desug pure $ ProgCxt r { datasets = dataset : datasets } @@ -116,7 +116,7 @@ eval_progCxt (ProgCxt { mods }) = do γ' <- eval_module γ mod empty pure $ γ <+> γ' -blah :: forall m g. Graph g => MonadError Error m => ProgCxt Unit -> m (GraphConfig g) +blah :: forall m g. Graph g => MonadError Error m => Raw ProgCxt -> m (GraphConfig g) blah progCxt = do (g × n) × progCxt' <- runWithGraphAllocT (G.empty × 0) do progCxt' <- alloc progCxt