Skip to content

Commit

Permalink
Inline helper function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Grant Jeffries committed Nov 1, 2019
1 parent cb2c97b commit 6df4aea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
8 changes: 6 additions & 2 deletions bowtie/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ main = do
Config name <- args
appSource <- TIO.readFile name
libFiles <- Interpret.getLibFiles "example-lib"
untypedValue <- Interpret.interpretProgramIO libFiles (name, appSource)
TIO.putStrLn (show untypedValue)
case Interpret.interpretProgram libFiles (name, appSource) of
Left e ->
exitWithError (Interpret.prettyError e)

Right untypedValue ->
TIO.putStrLn (show untypedValue)

data Config = Config FilePath

Expand Down
9 changes: 0 additions & 9 deletions bowtie/src/Bowtie/Interpret.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ prettyError err =
TypeError e ->
"Type error: " <> show e

interpretProgramIO :: [(FilePath, Text)] -> (FilePath, Text) -> IO Untyped.Expr
interpretProgramIO libFiles appFile =
case interpretProgram libFiles appFile of
Left e -> do
exitWithError (prettyError e)

Right a ->
pure a

-- | NOTE: Environment is just the data types.
sourceToCore :: Text -> Either IError (Environment, Core.Expr)
sourceToCore src = do
Expand Down

0 comments on commit 6df4aea

Please sign in to comment.