Skip to content

Commit

Permalink
🧩 [refactor]: Remove one use of old openDefaultImports.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolyp committed Oct 4, 2023
1 parent b2dffff commit 54b429a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/App/Fig.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions src/Module.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 54b429a

Please sign in to comment.