Skip to content

Commit

Permalink
Simplify warnign flags
Browse files Browse the repository at this point in the history
  • Loading branch information
jrp2014 authored and Adam Wespiser committed Nov 5, 2021
1 parent 5d76827 commit 8fec666
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
17 changes: 2 additions & 15 deletions scheme.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,10 @@ common common-options
other-modules: Paths_scheme
autogen-modules: Paths_scheme
ghc-options:
-Wall -Wextra -Wcompat -Widentities -Wincomplete-uni-patterns
-Werror -Wall -Wextra -Wcompat -Widentities -Wincomplete-uni-patterns
-Wincomplete-record-updates -Wredundant-constraints
-Wnoncanonical-monad-instances

ghc-options:
-fno-warn-unused-do-bind -fno-warn-unused-binds
-fno-warn-type-defaults -fno-warn-type-defaults
-fno-warn-name-shadowing -fwarn-duplicate-exports
-fwarn-dodgy-exports -fwarn-dodgy-imports
-fwarn-incomplete-patterns -fwarn-incomplete-record-updates
-fwarn-missing-fields -fwarn-missing-methods -fwarn-orphans
-fwarn-overlapping-patterns -fwarn-unused-imports -fwarn-tabs
-fwarn-unrecognised-pragmas
-- -fno-warn-unused-matches

-- -Werror
if impl(ghc >=8.2)
ghc-options: -fhide-source-paths

Expand All @@ -48,8 +36,7 @@ common common-options

if impl(ghc >=8.8)
ghc-options: -fwrite-ide-info -hiedir=.hie

-- ghc-options: -Wmissing-deriving-strategies -fwrite-ide-info -hiedir=.hie
-- ghc-options: -Wmissing-deriving-strategies -fwrite-ide-info -hiedir=.hie

if impl(ghc >=8.10)
ghc-options: -Wunused-packages
Expand Down
4 changes: 2 additions & 2 deletions src/Eval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ eval (List ((:) (Atom "showSF") rest)) = return . String . T.pack . show $ List

eval (List [Atom "quote", val]) = return val

eval (List [Atom "if", pred, truExpr, flsExpr]) = do
ifRes <- eval pred
eval (List [Atom "if", predicate, truExpr, flsExpr]) = do
ifRes <- eval predicate
case ifRes of
(Bool True) -> eval truExpr
(Bool False) -> eval flsExpr
Expand Down
2 changes: 1 addition & 1 deletion src/Prim.hs
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,5 @@ cdr _ = throw $ ExpectedList "cdr"

quote :: [LispVal] -> Eval LispVal
quote [List xs] = return $ List $ Atom "quote" : xs
quote [exp] = return $ List $ Atom "quote" : [exp]
quote [expr] = return $ List $ Atom "quote" : [expr]
quote args = throw $ NumArgs 1 args
7 changes: 4 additions & 3 deletions src/Repl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module Repl (
mainLoop,
) where

import Eval ( safeExec, runParseTest, evalText )
import Eval ( safeExec, evalText )
--import Eval ( runParseTest )
import Data.Text as T ( pack )

import Control.Monad.Trans ( MonadIO(liftIO) )
Expand All @@ -29,5 +30,5 @@ process str = do
res <- safeExec $ evalText $ T.pack str
either putStrLn return res

processToAST :: String -> IO ()
processToAST str = print $ runParseTest $ T.pack str
--processToAST :: String -> IO ()
--processToAST str = print $ runParseTest $ T.pack str

0 comments on commit 8fec666

Please sign in to comment.