diff --git a/.gitignore b/.gitignore index c78ec783..54132ef6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # generated code -src/Lex.hs -src/Parse.hs -src/dist-newstyle +src/Act/Lex.hs +src/Act/Parse.hs +dist-newstyle/ tests/**/*.out # build results @@ -9,8 +9,8 @@ bin/ result* # cabal -**/*.cabal.local -**/cabal.project.local* +*.cabal.local +cabal.project.local* src/dist/ # coq diff --git a/Makefile b/Makefile index d0b2ef7f..1a91a1dd 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,20 @@ .DEFAULT_GOAL := compiler .PHONY: parser compiler docs -parser: src/Lex.hs src/Parse.hs +parser: src/Act/Lex.hs src/Act/Parse.hs -src/Parse.hs: src/Parse.y src/Syntax/Untyped.hs - happy src/Parse.y +src/Act/Parse.hs: src/Act/Parse.y src/Act/Syntax/Untyped.hs + happy src/Act/Parse.y -src/Lex.hs: src/Lex.x - alex src/Lex.x +src/Act/Lex.hs: src/Act/Lex.x + alex src/Act/Lex.x # builds the rest of the haskell files (compiler) -bin/act: src/*.hs src/*/*.hs - cd src && cabal v2-install --installdir=../bin --overwrite-policy=always && cd .. +bin/act: src/CLI/*.hs src/Act/*.hs + cabal v2-install --installdir=bin --overwrite-policy=always -repl: src/Lex.hs src/Parse.hs - cd src && cabal v2-repl +repl: src/Act/Lex.hs src/Act/Parse.hs + cabal v2-repl compiler: bin/act diff --git a/act.cabal b/act.cabal index abb1a958..ca85fc1d 100644 --- a/act.cabal +++ b/act.cabal @@ -11,6 +11,8 @@ flag ci manual: True common deps + default-extensions: + ImportQualifiedPost build-depends: base >= 4.9 && < 5, aeson >= 1.0, containers >= 0.5, @@ -41,15 +43,33 @@ common deps library import: deps build-tool-depends: happy:happy, alex:alex - hs-source-dirs: . + hs-source-dirs: src default-language: Haskell2010 - exposed-modules: CLI Error Print SMT Syntax.Annotated Syntax.TimeAgnostic - other-modules: Lex Parse Coq Syntax Syntax.Untyped Syntax.Typed Syntax.Types Syntax.Timing Type Enrich Dev HEVM Consistency + exposed-modules: + Act.CLI + Act.Error + Act.Print + Act.SMT + Act.Syntax.Annotated + Act.Syntax.TimeAgnostic + Act.Lex + Act.Parse + Act.Coq + Act.Syntax + Act.Syntax.Untyped + Act.Syntax.Typed + Act.Syntax.Types + Act.Syntax.Timing + Act.Type + Act.Enrich + Act.Dev + Act.HEVM + Act.Consistency executable act import: deps main-is: Main.hs - hs-source-dirs: main + hs-source-dirs: src/CLI default-language: Haskell2010 build-depends: act if os(darwin) @@ -59,8 +79,8 @@ Test-Suite test import: deps type: exitcode-stdio-1.0 default-language: Haskell2010 - main-is: Test.hs - hs-source-dirs: test + main-is: Main.hs + hs-source-dirs: src/Test build-depends: act, pretty-simple >= 2.2, quickcheck-instances >= 0.3, diff --git a/src/Act/hie.yaml b/hie.yaml similarity index 59% rename from src/Act/hie.yaml rename to hie.yaml index 52ba6c24..4025d31a 100644 --- a/src/Act/hie.yaml +++ b/hie.yaml @@ -1,8 +1,8 @@ cradle: cabal: - - path: "." + - path: "src/Act" component: "lib:act" - - path: "./Main.hs" + - path: "src/CLI" component: "exe:act" - - path: "./test" + - path: "src/test" component: "test:test" diff --git a/src/Act/CLI.hs b/src/Act/CLI.hs index d4a56e9f..88e331d6 100644 --- a/src/Act/CLI.hs +++ b/src/Act/CLI.hs @@ -10,7 +10,7 @@ {-# LANGUAGE ApplicativeDo #-} {-# LANGUAGE OverloadedRecordDot #-} -module CLI (main, compile, proceed) where +module Act.CLI (main, compile, proceed) where import Data.Aeson hiding (Bool, Number, json) import GHC.Generics @@ -24,26 +24,27 @@ import qualified Data.Text as Text import qualified Data.Text.IO as TIO import Text.PrettyPrint.ANSI.Leijen hiding ((<$>)) import GHC.Natural +import Options.Generic import qualified Data.ByteString.Lazy.Char8 as B import qualified Data.ByteString as BS +import Data.ByteString (ByteString) import Control.Monad import Control.Lens.Getter -import Error -import Lex (lexer, AlexPosn(..)) -import Options.Generic -import Parse -import Syntax.Annotated -import Enrich -import SMT -import Type -import Coq hiding (indent) -import HEVM -import Consistency -import Print +import Act.Error +import Act.Lex (lexer, AlexPosn(..)) +import Act.Parse +import Act.Syntax.Annotated +import Act.Enrich +import Act.SMT as SMT +import Act.Type +import Act.Coq hiding (indent) +import Act.HEVM +import Act.Consistency +import Act.Print import EVM.SymExec import qualified EVM.Solvers as Solvers @@ -203,7 +204,7 @@ coq' :: FilePath -> Solvers.Solver -> Maybe Integer -> Bool -> IO () coq' f solver' smttimeout' debug' = do contents <- readFile f proceed contents (enrich <$> compile contents) $ \claims -> do - checkCases claims solver' smttimeout' debug' + checkCases claims solver' smttimeout' debug' TIO.putStr $ coq claims diff --git a/src/Act/Consistency.hs b/src/Act/Consistency.hs index 8670cc02..5c588af8 100644 --- a/src/Act/Consistency.hs +++ b/src/Act/Consistency.hs @@ -6,7 +6,7 @@ {-# LANGUAGE DataKinds #-} {-# Language RecordWildCards #-} -module Consistency ( +module Act.Consistency ( checkCases ) where @@ -18,11 +18,11 @@ import Text.PrettyPrint.ANSI.Leijen hiding ((<$>)) import System.Exit (exitFailure) import Data.Maybe -import Syntax -import Syntax.Annotated -import SMT -import Syntax.Untyped (makeIface) -import Print +import Act.Syntax +import Act.Syntax.Annotated +import Act.SMT as SMT +import Act.Syntax.Untyped (makeIface) +import Act.Print import qualified EVM.Solvers as Solvers diff --git a/src/Act/Coq.hs b/src/Act/Coq.hs index 42d7ae73..55fc528b 100644 --- a/src/Act/Coq.hs +++ b/src/Act/Coq.hs @@ -15,7 +15,7 @@ {-# Language DataKinds #-} -module Coq where +module Act.Coq where import Prelude hiding (GT, LT) @@ -27,8 +27,8 @@ import Data.List (groupBy) import Control.Monad.State import EVM.ABI -import Syntax -import Syntax.Annotated +import Act.Syntax +import Act.Syntax.Annotated type Fresh = State Int diff --git a/src/Act/Dev.hs b/src/Act/Dev.hs index 19019587..7f59496c 100644 --- a/src/Act/Dev.hs +++ b/src/Act/Dev.hs @@ -1,10 +1,10 @@ -module Dev where +module Act.Dev where -import CLI -import Coq (coq) -import Enrich -import Consistency +import Act.CLI +import Act.Coq (coq) +import Act.Enrich +import Act.Consistency import qualified EVM.Solvers as Solvers import qualified Data.Text as T diff --git a/src/Act/Enrich.hs b/src/Act/Enrich.hs index e0f48e00..7eba58ab 100644 --- a/src/Act/Enrich.hs +++ b/src/Act/Enrich.hs @@ -1,14 +1,14 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} -module Enrich (enrich, mkStorageBounds) where +module Act.Enrich (enrich, mkStorageBounds) where import Data.Maybe import Data.List (nub) -import Syntax -import Syntax.Annotated -import Type (defaultStore) +import Act.Syntax +import Act.Syntax.Annotated +import Act.Type (defaultStore) -- | Adds extra preconditions to non constructor behaviours based on the types of their variables enrich :: Act -> Act diff --git a/src/Act/Error.hs b/src/Act/Error.hs index ef004470..e0029d38 100644 --- a/src/Act/Error.hs +++ b/src/Act/Error.hs @@ -1,7 +1,4 @@ {-# LANGUAGE OverloadedLists #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE TypeApplications #-} -{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} @@ -16,16 +13,16 @@ and keep track of a 'Pn' for every error it logs. There is also some infrastruct around modified chaining/branching behaviours. -} -module Error (module Error) where +module Act.Error (module Act.Error) where import Data.List (find) import Data.List.NonEmpty as NE -import Data.Validation as Error +import Data.Validation as Act.Error -import Syntax.Untyped (Pn) +import Act.Syntax.Untyped (Pn) -- Reexport NonEmpty so that we can use `-XOverloadedLists` without thinking. -import Data.List.NonEmpty as Error (NonEmpty) +import Data.List.NonEmpty as Act.Error (NonEmpty) type Error e = Validation (NonEmpty (Pn,e)) @@ -37,7 +34,7 @@ assert err b = if b then pure () else throw err foldValidation :: (b -> a -> Error err b) -> b -> [a] -> Error err b foldValidation _ b [] = pure b -foldValidation f b (a:as) = f b a `bindValidation` \b' -> foldValidation f b' as +foldValidation f b (a:as) = f b a `bindValidation` \b' -> foldValidation f b' as infixr 1 <==<, >==> diff --git a/src/Act/HEVM.hs b/src/Act/HEVM.hs index 53965108..6855e62c 100644 --- a/src/Act/HEVM.hs +++ b/src/Act/HEVM.hs @@ -13,7 +13,7 @@ {-# LANGUAGE OverloadedRecordDot #-} -module HEVM where +module Act.HEVM where import qualified Data.Map as M import Data.List @@ -23,6 +23,7 @@ import qualified Data.Text.IO as TIO import qualified Data.Text.Lazy.IO as TL import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as B8 (pack) +import Data.ByteString (ByteString) import Data.Text.Encoding (encodeUtf8) import Control.Concurrent.Async import Control.Monad @@ -31,9 +32,9 @@ import Data.Maybe import System.Exit ( exitFailure ) import Control.Monad.ST (stToIO) -import Syntax.Annotated -import Syntax.Untyped (makeIface) -import Syntax +import Act.Syntax.Annotated as Act +import Act.Syntax.Untyped (makeIface) +import Act.Syntax import EVM.ABI (Sig(..)) import qualified EVM.Types as EVM hiding (Contract(..), FrameState(..)) @@ -265,10 +266,10 @@ toProp layout = \case (Or _ e1 e2) -> pop2 EVM.POr e1 e2 (Impl _ e1 e2) -> pop2 EVM.PImpl e1 e2 (Neg _ e1) -> EVM.PNeg (toProp layout e1) - (Syntax.Annotated.LT _ e1 e2) -> op2 EVM.PLT e1 e2 + (Act.LT _ e1 e2) -> op2 EVM.PLT e1 e2 (LEQ _ e1 e2) -> op2 EVM.PLEq e1 e2 (GEQ _ e1 e2) -> op2 EVM.PGEq e1 e2 - (Syntax.Annotated.GT _ e1 e2) -> op2 EVM.PGT e1 e2 + (Act.GT _ e1 e2) -> op2 EVM.PGT e1 e2 (LitBool _ b) -> EVM.PBool b (Eq _ SInteger e1 e2) -> op2 EVM.PEq e1 e2 (Eq _ SBoolean e1 e2) -> op2 EVM.PEq e1 e2 @@ -296,10 +297,10 @@ toExpr layout = \case (Or _ e1 e2) -> op2 EVM.Or e1 e2 (Impl _ e1 e2) -> op2 (\x y -> EVM.Or (EVM.Not x) y) e1 e2 (Neg _ e1) -> EVM.Not (toExpr layout e1) - (Syntax.Annotated.LT _ e1 e2) -> op2 EVM.LT e1 e2 + (Act.LT _ e1 e2) -> op2 EVM.LT e1 e2 (LEQ _ e1 e2) -> op2 EVM.LEq e1 e2 (GEQ _ e1 e2) -> op2 EVM.GEq e1 e2 - (Syntax.Annotated.GT _ e1 e2) -> op2 EVM.GT e1 e2 + (Act.GT _ e1 e2) -> op2 EVM.GT e1 e2 (LitBool _ b) -> EVM.Lit (fromIntegral $ fromEnum $ b) -- integers (Add _ e1 e2) -> op2 EVM.Add e1 e2 diff --git a/src/Act/Lex.x b/src/Act/Lex.x index 83e4fa41..7abcdc90 100644 --- a/src/Act/Lex.x +++ b/src/Act/Lex.x @@ -1,5 +1,5 @@ { -module Lex +module Act.Lex ( LEX (..) , Lexeme (..) , AlexPosn (..) @@ -98,9 +98,9 @@ tokens :- ")" { mk RPAREN } "[" { mk LBRACK } "]" { mk RBRACK } - "=" { mk Lex.EQ } - ">" { mk Lex.GT } - "<" { mk Lex.LT } + "=" { mk Act.Lex.EQ } + ">" { mk Act.Lex.GT } + "<" { mk Act.Lex.LT } ":" { mk COLON } "+" { mk PLUS } "-" { mk MINUS } diff --git a/src/Act/Parse.y b/src/Act/Parse.y index 07704390..34bacb1c 100644 --- a/src/Act/Parse.y +++ b/src/Act/Parse.y @@ -1,12 +1,12 @@ { -module Parse (module Parse, showposn) where +module Act.Parse (module Act.Parse, showposn) where import Prelude hiding (EQ, GT, LT) -import Lex +import Data.Validation import EVM.ABI import qualified Data.List.NonEmpty as NonEmpty -import Syntax.Untyped -import Error -import Data.Validation +import Act.Lex +import Act.Syntax.Untyped +import Act.Error } %name parse diff --git a/src/Act/Print.hs b/src/Act/Print.hs index e4dce6c7..08173bbb 100644 --- a/src/Act/Print.hs +++ b/src/Act/Print.hs @@ -1,7 +1,7 @@ {-# Language GADTs #-} {-# Language DataKinds #-} -module Print where +module Act.Print where import Prelude hiding (GT, LT) import Data.ByteString.UTF8 (toString) @@ -10,8 +10,8 @@ import System.IO (stdout) import Data.List -import Syntax -import Syntax.TimeAgnostic +import Act.Syntax +import Act.Syntax.TimeAgnostic prettyBehaviour :: Behaviour t -> String @@ -173,7 +173,7 @@ prettyInvPred = prettyExp . untime . fst Slice p a b c -> Slice p (untime a) (untime b) (untime c) TEntry p _ (Item t vt a) -> TEntry p Neither (Item t vt (untimeStorageRef a)) Var p t at a -> Var p t at a - + -- | prints a Doc, with wider output than the built in `putDoc` render :: Doc -> IO () render doc = displayIO stdout (renderPretty 0.9 120 doc) diff --git a/src/Act/SMT.hs b/src/Act/SMT.hs index bc7e7955..65259cb5 100644 --- a/src/Act/SMT.hs +++ b/src/Act/SMT.hs @@ -6,7 +6,7 @@ {-# LANGUAGE DataKinds #-} {-# Language RecordWildCards #-} -module SMT ( +module Act.SMT ( Solver(..), SMTConfig(..), Query(..), @@ -59,11 +59,11 @@ import Data.List import GHC.IO.Handle (Handle, hGetLine, hPutStr, hFlush) import Data.ByteString.UTF8 (fromString) -import Syntax -import Syntax.Annotated +import Act.Syntax +import Act.Syntax.Annotated -import Print -import Type (defaultStore) +import Act.Print +import Act.Type (defaultStore) import EVM.Solvers (Solver(..)) diff --git a/src/Act/Syntax.hs b/src/Act/Syntax.hs index 152c10ab..5f796f01 100644 --- a/src/Act/Syntax.hs +++ b/src/Act/Syntax.hs @@ -8,18 +8,18 @@ Module : Syntax Description : Functions for manipulating and collapsing all our different ASTs. -} -module Syntax where +module Act.Syntax where import Prelude hiding (LT, GT) import Data.List hiding (singleton) import Data.Map (Map,empty,insertWith,unionsWith,unionWith,singleton) -import Syntax.TimeAgnostic as Agnostic -import qualified Syntax.Annotated as Annotated -import qualified Syntax.Typed as Typed -import Syntax.Untyped hiding (Contract) -import qualified Syntax.Untyped as Untyped +import Act.Syntax.TimeAgnostic as Agnostic +import qualified Act.Syntax.Annotated as Annotated +import qualified Act.Syntax.Typed as Typed +import Act.Syntax.Untyped hiding (Contract) +import qualified Act.Syntax.Untyped as Untyped ----------------------------------------- -- * Extract from fully refined ASTs * -- diff --git a/src/Act/Syntax/Annotated.hs b/src/Act/Syntax/Annotated.hs index d32fc57e..2aa22812 100644 --- a/src/Act/Syntax/Annotated.hs +++ b/src/Act/Syntax/Annotated.hs @@ -7,14 +7,14 @@ Module : Syntax.Annotated Description : AST data types where all implicit timings have been made explicit. -} -module Syntax.Annotated (module Syntax.Annotated) where +module Act.Syntax.Annotated (module Act.Syntax.Annotated) where -import qualified Syntax.TimeAgnostic as Agnostic -import Syntax.TimeAgnostic (Timing(..),setPre,setPost) +import qualified Act.Syntax.TimeAgnostic as Agnostic +import Act.Syntax.TimeAgnostic (Timing(..),setPre,setPost) -- Reexports -import Syntax.TimeAgnostic as Syntax.Annotated hiding (Timing(..),Timable(..),Time,Neither,Act,Contract,Invariant,InvariantPred,Constructor,Behaviour,StorageUpdate,StorageLocation,TStorageItem,Exp,TypedExp,StorageRef) -import Syntax.TimeAgnostic as Syntax.Annotated (pattern Act, pattern Contract, pattern Invariant, pattern Constructor, pattern Behaviour, pattern Exp) +import Act.Syntax.TimeAgnostic as Act.Syntax.Annotated hiding (Timing(..),Timable(..),Time,Neither,Act,Contract,Invariant,InvariantPred,Constructor,Behaviour,StorageUpdate,StorageLocation,TStorageItem,Exp,TypedExp,StorageRef) +import Act.Syntax.TimeAgnostic as Act.Syntax.Annotated (pattern Act, pattern Contract, pattern Invariant, pattern Constructor, pattern Behaviour, pattern Exp) -- We shadow all timing-agnostic AST types with explicitly timed versions. diff --git a/src/Act/Syntax/TimeAgnostic.hs b/src/Act/Syntax/TimeAgnostic.hs index c5749bb6..d0ea1a77 100644 --- a/src/Act/Syntax/TimeAgnostic.hs +++ b/src/Act/Syntax/TimeAgnostic.hs @@ -2,7 +2,6 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeApplications #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MonadComprehensions #-} {-# LANGUAGE PolyKinds #-} @@ -10,7 +9,6 @@ {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE TypeOperators #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} @@ -28,13 +26,14 @@ Some terms in here are always 'Timed'. This indicates that their timing must (i.e. 'Untimed'), but will be made explicit (i.e. 'Timed') during refinement. -} -module Syntax.TimeAgnostic (module Syntax.TimeAgnostic) where +module Act.Syntax.TimeAgnostic (module Act.Syntax.TimeAgnostic) where import Control.Applicative (empty) import Prelude hiding (GT, LT) import Data.Aeson import Data.Aeson.Types +import Data.ByteString (ByteString) import qualified Data.ByteString as BS import Data.List (genericTake,genericDrop) import Data.Map.Strict (Map) @@ -46,10 +45,10 @@ import Data.Kind -- Reexports -import Parse as Syntax.TimeAgnostic (nowhere) -import Syntax.Types as Syntax.TimeAgnostic -import Syntax.Timing as Syntax.TimeAgnostic -import Syntax.Untyped as Syntax.TimeAgnostic (Id, Pn, Interface(..), EthEnv(..), Decl(..), SlotType(..), ValueType(..)) +import Act.Parse as Act.Syntax.TimeAgnostic (nowhere) +import Act.Syntax.Types as Act.Syntax.TimeAgnostic +import Act.Syntax.Timing as Act.Syntax.TimeAgnostic +import Act.Syntax.Untyped as Act.Syntax.TimeAgnostic (Id, Pn, Interface(..), EthEnv(..), Decl(..), SlotType(..), ValueType(..)) -- AST post typechecking data Act t = Act Store [Contract t] diff --git a/src/Act/Syntax/Timing.hs b/src/Act/Syntax/Timing.hs index 06716647..04fe572a 100644 --- a/src/Act/Syntax/Timing.hs +++ b/src/Act/Syntax/Timing.hs @@ -6,7 +6,7 @@ Module : Syntax.Timing Description : Stuff relating to explicit and implicit references to pre-/post-states. -} -module Syntax.Timing where +module Act.Syntax.Timing where import Data.Char (toLower) diff --git a/src/Act/Syntax/Typed.hs b/src/Act/Syntax/Typed.hs index f79d38aa..8a0f4f10 100644 --- a/src/Act/Syntax/Typed.hs +++ b/src/Act/Syntax/Typed.hs @@ -5,13 +5,13 @@ Module : Syntax.Typed Description : AST data types which have passed type checking but still contain implicit timings. -} -module Syntax.Typed (module Syntax.Typed) where +module Act.Syntax.Typed (module Act.Syntax.Typed) where -import qualified Syntax.TimeAgnostic as Agnostic +import qualified Act.Syntax.TimeAgnostic as Agnostic -- Reexports -import Syntax.TimeAgnostic as Syntax.Typed hiding (Act,Contract,Invariant,InvariantPred,Constructor,Behaviour,StorageUpdate,StorageLocation) -import Syntax.TimeAgnostic as Syntax.Typed (pattern Act, pattern Contract, pattern Invariant, pattern Constructor, pattern Behaviour) +import Act.Syntax.TimeAgnostic as Act.Syntax.Typed hiding (Act,Contract,Invariant,InvariantPred,Constructor,Behaviour,StorageUpdate,StorageLocation) +import Act.Syntax.TimeAgnostic as Act.Syntax.Typed (pattern Act, pattern Contract, pattern Invariant, pattern Constructor, pattern Behaviour) -- We shadow all timing-agnostic AST types with versions -- that need to have implicit timings where possible. diff --git a/src/Act/Syntax/Types.hs b/src/Act/Syntax/Types.hs index db920047..a67f5c32 100644 --- a/src/Act/Syntax/Types.hs +++ b/src/Act/Syntax/Types.hs @@ -17,14 +17,14 @@ Module : Syntax.Types Description : Types that represent Act types, and functions and patterns to go between them and Haskell's own types. -} -module Syntax.Types (module Syntax.Types) where +module Act.Syntax.Types (module Act.Syntax.Types) where import Data.Singletons -import Data.ByteString as Syntax.Types (ByteString) +import Data.ByteString import Data.Type.Equality (TestEquality(..), (:~:)(..)) -import EVM.ABI as Syntax.Types (AbiType(..)) +import EVM.ABI as Act.Syntax.Types (AbiType(..)) -import Syntax.Untyped (ValueType(..)) +import Act.Syntax.Untyped (ValueType(..)) -- | Types of Act expressions data ActType @@ -78,7 +78,7 @@ type family TypeOf a where TypeOf 'AInteger = Integer TypeOf 'ABoolean = Bool TypeOf 'AByteStr = ByteString - + fromAbiType :: AbiType -> ActType fromAbiType (AbiUIntType _) = AInteger diff --git a/src/Act/Syntax/Untyped.hs b/src/Act/Syntax/Untyped.hs index 436b7b9c..c7dc6261 100644 --- a/src/Act/Syntax/Untyped.hs +++ b/src/Act/Syntax/Untyped.hs @@ -3,15 +3,15 @@ -- It is also equipped with position information for extra debugging xp {-# LANGUAGE OverloadedStrings #-} -module Syntax.Untyped (module Syntax.Untyped) where +module Act.Syntax.Untyped (module Act.Syntax.Untyped) where import Data.Aeson import Data.List (intercalate) import Data.List.NonEmpty (NonEmpty) import Data.Text as T (pack) -import EVM.ABI (AbiType(..)) -import Lex +import EVM.ABI +import Act.Lex type Pn = AlexPosn diff --git a/src/Act/Type.hs b/src/Act/Type.hs index 778a6adc..b910f8a1 100644 --- a/src/Act/Type.hs +++ b/src/Act/Type.hs @@ -9,7 +9,7 @@ {-# LANGUAGE ApplicativeDo #-} {-# Language TupleSections #-} -module Type (typecheck, lookupVars, defaultStore, Err) where +module Act.Type (typecheck, lookupVars, defaultStore, Err) where import Prelude hiding (GT, LT) @@ -33,12 +33,12 @@ import qualified Data.Set as Set import Data.Map.Ordered (OMap) import qualified Data.Map.Ordered as OM -import Syntax -import Syntax.Timing -import qualified Syntax.Untyped as U -import Syntax.Typed -import Syntax.Untyped (makeIface) -import Error +import Act.Syntax +import Act.Syntax.Timing +import Act.Syntax.Untyped qualified as U +import Act.Syntax.Typed +import Act.Syntax.Untyped (makeIface) +import Act.Error import Data.Type.Equality (TestEquality(..)) diff --git a/src/Act/main/Main.hs b/src/CLI/Main.hs similarity index 60% rename from src/Act/main/Main.hs rename to src/CLI/Main.hs index 411417d7..0d1a646a 100644 --- a/src/Act/main/Main.hs +++ b/src/CLI/Main.hs @@ -1,6 +1,6 @@ module Main where -import qualified CLI +import Act.CLI qualified as CLI main :: IO () main = CLI.main