Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.DS_Store
dist
dist*
cabal-dev
19 changes: 13 additions & 6 deletions cspmchecker/cspmchecker.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Source-repository this

Executable cspmchecker
Main-is: Main.hs
Other-modules: Monad
Other-modules:
Monad
Paths_cspmchecker

Extensions: DoAndIfThenElse

Expand All @@ -40,29 +42,34 @@ Executable cspmchecker

Executable cspmcheckeri
Main-is: Main.hs
Other-modules: Monad
Other-modules:
Monad
Paths_cspmchecker

Build-depends:
base >= 4 && < 5,
libcspm,
filepath >= 1.2,
mtl >= 2.0,
directory >= 1.0,
haskeline >= 0.7
haskeline >= 0.8,
exceptions >= 0.10

Hs-Source-Dirs: src/InteractiveChecker

Executable cspmexplorer
Main-is: Main.hs
Other-modules: Monad
Other-modules:
Paths_cspmchecker

Build-depends:
base >= 4 && < 5,
hashable >= 1.2 && < 1.3,
hashable >= 1.2 && < 1.4,
hashtables >= 1.1 && < 1.3,
libcspm,
filepath >= 1.2,
mtl >= 2.0,
directory >= 1.0
directory >= 1.0,
deepseq >= 1.4

Hs-Source-Dirs: src/Explorer
2 changes: 1 addition & 1 deletion cspmchecker/src/Explorer/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import System.FilePath
import System.Exit
import System.IO

import qualified Paths_cspmexplorer as C
import qualified Paths_cspmchecker as C
import Data.Version (showVersion)

import CSPM
Expand Down
1 change: 1 addition & 0 deletions cspmchecker/src/InteractiveChecker/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Main where

import Data.Char
import Control.Exception (AsyncException(..))
import Control.Monad.Catch
import Control.Monad.Trans
import Data.List
import Prelude hiding (catch)
Expand Down
19 changes: 19 additions & 0 deletions hie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cradle:
cabal:
- path: "src"
component: "lib:libcspm"

- path: "cspmchecker/src/Checker"
component: "exe:cspmchecker"

- path: "cspmchecker/src/Explorer"
component: "exe:cspmexplorer"

- path: "cspmchecker/src/InteractiveChecker"
component: "exe:cspmcheckeri"

- path: "profiler/src"
component: "exe:cspmprofiler"

- path: "tests"
component: "libcspm:test:libcspm_tests"
7 changes: 4 additions & 3 deletions libcspm.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ Library
array >= 0.4 && < 0.6,
base >= 4.7 && < 5,
bytestring >= 0.10 && < 0.11,
containers >= 0.5 && < 0.6,
containers >= 0.5 && < 0.7,
deepseq >= 1.3 && < 1.5,
directory >= 1.2 && < 1.4,
ghc-prim >= 0.3 && < 0.6,
ghc-prim >= 0.3 && < 0.7,
filepath >= 1.3 && < 1.5,
hashable >= 1.2 && < 1.3,
hashable >= 1.3 && < 1.4,
hashtables >= 1.1 && < 1.3,
mtl >= 2.1 && < 2.3,
pretty >= 1.1 && < 1.2,
Expand Down Expand Up @@ -80,6 +80,7 @@ Library
CSPM.Evaluator.PrefixExpr,
CSPM.Evaluator.Profiler,
CSPM.Evaluator.ProfilerThunks,
CSPM.Evaluator.ProfilerThunksTH,
CSPM.Evaluator.Values,
CSPM.Evaluator.ValueSet,
CSPM.Evaluator.ValuePrettyPrinter,
Expand Down
2 changes: 1 addition & 1 deletion profiler/profiler.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Executable cspmprofiler
filepath >= 1.2,
mtl >= 2.0,
directory >= 1.0,
process >= 1.2 && < 1.3,
process >= 1.2 && < 1.7,
temporary >= 1.2 && < 1.3

Hs-Source-Dirs: src
2 changes: 1 addition & 1 deletion src/CSPM/Evaluator/Exceptions.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module CSPM.Evaluator.Exceptions
where

import Prelude
import Prelude hiding ((<>))

import CSPM.Syntax.Names
import CSPM.Syntax.AST
Expand Down
2 changes: 0 additions & 2 deletions src/CSPM/Evaluator/Expr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import Util.Annotated
import Util.Exception
import Util.List

import CSPM.Prelude

-- In order to keep lazy evaluation working properly only use pattern
-- matching when you HAVE to know the value. (Hence why we delay pattern
-- matching in BooleanBinaryOp And in case the first value is false.)
Expand Down
9 changes: 7 additions & 2 deletions src/CSPM/Evaluator/Monad.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE CPP #-}
module CSPM.Evaluator.Monad where

Expand All @@ -11,7 +13,10 @@ import Util.Annotated
import Util.Exception

type EvaluationState = Environment
type EvaluationMonad = Reader EvaluationState
newtype EvaluationMonad a = EvaluationMonad (Reader EvaluationState a)
deriving newtype (Functor, Applicative, Monad, MonadReader EvaluationState)
instance MonadFail EvaluationMonad where
fail = error

gets :: (EvaluationState -> a) -> EvaluationMonad a
gets = asks
Expand All @@ -20,7 +25,7 @@ modify :: (EvaluationState -> EvaluationState) -> EvaluationMonad a -> Evaluatio
modify = local

runEvaluator :: EvaluationState -> EvaluationMonad a -> a
runEvaluator st prog = runReader prog st
runEvaluator st (EvaluationMonad prog) = runReader prog st

getState :: EvaluationMonad EvaluationState
getState = gets id
Expand Down
2 changes: 2 additions & 0 deletions src/CSPM/Evaluator/Profiler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ module CSPM.Evaluator.Profiler (
profile, dumpProfilingData,
) where

import Prelude hiding ((<>))

import Control.Monad.Trans
import Data.Array.IArray
import Data.Array.IO
Expand Down
2 changes: 0 additions & 2 deletions src/CSPM/Evaluator/ProfilerThunks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ module CSPM.Evaluator.ProfilerThunks (
)
where

import CSPM.Evaluator.ProfilerThunksTH
import Data.Array
import Language.Haskell.TH

#ifndef CSPM_PROFILING

Expand Down
4 changes: 3 additions & 1 deletion src/CSPM/Evaluator/ValuePrettyPrinter.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE FlexibleContexts, FlexibleInstances, IncoherentInstances,
MultiParamTypeClasses, ScopedTypeVariables, TypeSynonymInstances,
UndecidableInstances #-}
Expand Down Expand Up @@ -523,7 +524,8 @@ maybeNull' s _ | null (F.toList s) = M.text "SKIP"
maybeNull' _ d = d

instance
(M.MonadicPrettyPrintable m EventSet,
(Monad m,
M.MonadicPrettyPrintable m EventSet,
M.MonadicPrettyPrintable m ValueSet) =>
M.MonadicPrettyPrintable m Proc
where
Expand Down
3 changes: 1 addition & 2 deletions src/CSPM/Evaluator/Values.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import Prelude hiding (lookup)

import CSPM.Evaluator.AnalyserMonad
import CSPM.Evaluator.Monad
import CSPM.Evaluator.Environment
import {-# SOURCE #-} qualified CSPM.Evaluator.ValueSet as S
import {-# SOURCE #-} CSPM.Evaluator.ValuePrettyPrinter
import CSPM.Syntax.Names
Expand Down Expand Up @@ -153,7 +152,7 @@ noSave :: EvaluationMonad Value -> EvaluationMonad Value
noSave prog = do
--pn <- getParentScopeIdentifier
return $ VThunk prog
-- $ modify
-- $ modify
--(\ st -> st {
--CSPM.Evaluator.Monad.parentScopeIdentifier = pn
-- }) prog
Expand Down
2 changes: 2 additions & 0 deletions src/CSPM/Parser/Exceptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ module CSPM.Parser.Exceptions (
)
where

import Prelude hiding ((<>))

import CSPM.Syntax.Names
import CSPM.Syntax.AST
import CSPM.Parser.Tokens
Expand Down
1 change: 0 additions & 1 deletion src/CSPM/Parser/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import Control.Exception
import Control.Monad.State
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as M
import Data.Maybe (isNothing)
#if __GLASGOW_HASKELL__ < 705
import Prelude hiding (catch)
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/CSPM/Parser/Tokens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module CSPM.Parser.Tokens (
)
where

import Prelude hiding ((<>))

import qualified Data.ByteString as B

import CSPM.Syntax.AST (Model(..))
Expand Down
2 changes: 2 additions & 0 deletions src/CSPM/PrettyPrinter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module CSPM.PrettyPrinter (
)
where

import Prelude hiding ((<>))

import CSPM.Syntax.AST
import Util.Annotated
import Util.PrettyPrint
Expand Down
2 changes: 2 additions & 0 deletions src/CSPM/Renamer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ module CSPM.Renamer (
getBoundNames,
) where

import Prelude hiding ((<>))

import Control.Monad.State
import qualified Data.ByteString.Char8 as B
import Data.List
Expand Down
2 changes: 2 additions & 0 deletions src/CSPM/Syntax/Names.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ module CSPM.Syntax.Names (
isNameDataConstructor,
) where

import Prelude hiding ((<>))

import Control.Monad.Trans
import qualified Data.ByteString.Char8 as B
import Data.Hashable
Expand Down
2 changes: 2 additions & 0 deletions src/CSPM/TypeChecker/Decl.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{-# LANGUAGE FlexibleContexts, MultiParamTypeClasses, FlexibleInstances, TypeSynonymInstances #-}
module CSPM.TypeChecker.Decl (typeCheckDecls) where

import Prelude hiding ((<>))

import Control.Monad
import Data.List (sort)
import Data.Graph.Wrapper
Expand Down
2 changes: 1 addition & 1 deletion src/CSPM/TypeChecker/Exceptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module CSPM.TypeChecker.Exceptions (
)
where

import Prelude
import Prelude hiding ((<>))
import Data.Maybe

import Data.List (intersect, nub, sort)
Expand Down
2 changes: 2 additions & 0 deletions src/CSPM/TypeChecker/Expr.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{-# LANGUAGE FlexibleContexts, MultiParamTypeClasses, FlexibleInstances, TypeSynonymInstances #-}
module CSPM.TypeChecker.Expr () where

import Prelude hiding ((<>))

import Control.Monad
import Data.List

Expand Down
2 changes: 1 addition & 1 deletion src/CSPM/TypeChecker/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Control.Monad.State
import Data.List ((\\))
import qualified Data.Map as M
import qualified Data.Set as S
import Prelude hiding (lookup)
import Prelude hiding ((<>), lookup)

import CSPM.Syntax.Names
import CSPM.Syntax.Types
Expand Down
2 changes: 2 additions & 0 deletions src/CSPM/TypeChecker/Pat.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, TypeSynonymInstances #-}
module CSPM.TypeChecker.Pat () where

import Prelude hiding ((<>))

import CSPM.Syntax.FreeVars
import CSPM.Syntax.Names
import CSPM.Syntax.AST hiding (getType)
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Annotated.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Util.Annotated where
import qualified Data.ByteString as B
import Data.Hashable
import GHC.Generics (Generic)
import Prelude
import Prelude hiding ((<>))
import Util.Exception
import Util.Prelude
import Util.PrettyPrint
Expand Down
3 changes: 3 additions & 0 deletions src/Util/Exception.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE ConstrainedClassMethods #-}
{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleInstances, ScopedTypeVariables,
TypeSynonymInstances #-}
module Util.Exception (
Expand All @@ -19,6 +20,8 @@ import Data.List

#if __GLASGOW_HASKELL__ < 705
import Prelude hiding (catch)
#else
import Prelude hiding ((<>))
#endif

import {-# SOURCE #-} Util.Annotated
Expand Down
2 changes: 2 additions & 0 deletions src/Util/MonadicPrettyPrint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module Util.MonadicPrettyPrint(
bytestring,
) where

import Prelude hiding ((<>))

import qualified Data.ByteString.Char8 as B
import Numeric
import Util.MonadicPrettyPrintInternal
Expand Down
2 changes: 2 additions & 0 deletions src/Util/MonadicPrettyPrintInternal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ module Util.MonadicPrettyPrintInternal(
fullRender,
) where

import Prelude hiding ((<>))

import qualified Text.PrettyPrint.HughesPJ as P

--------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions src/Util/PrettyPrint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module Util.PrettyPrint (
)
where

import Prelude hiding ((<>))

import qualified Data.ByteString.Char8 as B

import Numeric
Expand Down