on master help sign in
switch to megaparsec 5.2.0 and stack lts-8.0 for GHC 8.0.2

support for earlier stack LTS releases is hereby dropped references #25

commitc67c55f685566f8be6d2fbe3890aa4c1586ed19c authorAgentM <agentm@themactionfaction.com> dateTue 14 Feb 2017, 23:55 (10 years ago) parent4ed335e
4 files changed+23−16
project-m36.cabal+10−10 src/bin/TutorialD/Interpreter.hs+2−2 src/bin/TutorialD/Interpreter/Base.hs+6−3 stack.yaml+5−1
project-m36.cabal+10−10
@@ -13,7 +13,7 @@ Description: A relational algebra engine which can be used to persist and query
1313
1414Library
1515 Build-Depends: base>=4.8 && < 5.0
16− ,ghc >= 7.8 && <= 8.0.1
16+ ,ghc >= 7.8 && <= 8.1
1717 ,ghc-paths
1818 ,mtl
1919 ,containers
@@ -136,13 +136,14 @@ Library
136136
137137Executable tutd
138138 Build-Depends: base >=4.8 && <5.0,
139− ghc >= 7.8 && <= 8.0.1,
139+ ghc >= 7.8 && <= 8.1,
140140 ghc-paths,
141141 project-m36 == 0.1,
142142 containers,
143143 unordered-containers,
144144 hashable,
145145 transformers,
146+ semigroups,
146147 mtl,
147148 uuid,
148149 deepseq-generics,
@@ -163,8 +164,7 @@ Executable tutd
163164 directory,
164165 filepath,
165166 temporary,
166−--stack is still stuck on megaparsec 4, error-handling has changed in megaparsec 5
167− megaparsec >= 4.4.0 && < 5.0,
167+ megaparsec >= 5.2.0 && < 5.3,
168168 haskeline,
169169 random, MonadRandom,
170170 base64-bytestring,
@@ -209,7 +209,7 @@ Executable tutd
209209
210210Executable project-m36-server
211211 Build-Depends: base,
212− ghc >= 7.8 && <= 8.0.1,
212+ ghc >= 7.8 && <= 8.1,
213213 ghc-paths,
214214 project-m36 == 0.1,
215215 binary,
@@ -248,7 +248,7 @@ Executable project-m36-server
248248Executable bigrel
249249 Default-Language: Haskell2010
250250 Default-Extensions: OverloadedStrings
251− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, optparse-applicative, stm-containers, list-t, ghc, ghc-paths, transformers, project-m36 == 0.1, random, MonadRandom
251+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, optparse-applicative, stm-containers, list-t, ghc, ghc-paths, transformers, project-m36 == 0.1, random, MonadRandom, semigroups
252252 Other-Modules: TutorialD.Interpreter.Base,
253253 TutorialD.Interpreter.DatabaseContextExpr,
254254 TutorialD.Interpreter.RelationalExpr,
@@ -265,7 +265,7 @@ Test-Suite test-tutoriald
265265 type: exitcode-stdio-1.0
266266 main-is: test/TutorialD/Interpreter.hs
267267 Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, list-t, project-m36 == 0.1, random, MonadRandom
268− Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator
268+ Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.SchemaOperator
269269 GHC-Options: -Wall
270270 Hs-Source-Dirs: ./src/bin, ., test
271271 CPP-Options: -DPROJECTM36_VERSION="v0.1"
@@ -274,7 +274,7 @@ Test-Suite test-tutoriald-atomfunctionscript
274274 Default-Language: Haskell2010
275275 Default-Extensions: OverloadedStrings
276276 type: exitcode-stdio-1.0
277− Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types
277+ Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.SchemaOperator
278278 main-is: test/TutorialD/Interpreter/AtomFunctionScript.hs
279279 Build-Depends: base, HUnit, project-m36 == 0.1, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline, random, MonadRandom
280280 GHC-Options: -Wall
@@ -388,7 +388,7 @@ Test-Suite test-scripts
388388
389389Executable project-m36-websocket-server
390390 Default-Language: Haskell2010
391− Build-Depends: base, aeson, path-pieces, either, conduit, http-api-data, template-haskell, websockets, aeson, uuid-aeson, optparse-applicative, project-m36 == 0.1, containers, bytestring, text, vector, uuid, megaparsec, haskeline, mtl, directory, base64-bytestring, random, MonadRandom, time, network-transport-tcp
391+ Build-Depends: base, aeson, path-pieces, either, conduit, http-api-data, template-haskell, websockets, aeson, uuid-aeson, optparse-applicative, project-m36 == 0.1, containers, bytestring, text, vector, uuid, megaparsec, haskeline, mtl, directory, base64-bytestring, random, MonadRandom, time, network-transport-tcp, semigroups
392392 Main-Is: ProjectM36/Server/WebSocket/websocket-server.hs
393393 Other-Modules: ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.SchemaOperator
394394 GHC-Options: -Wall
@@ -401,7 +401,7 @@ Test-Suite test-websocket-server
401401 type: exitcode-stdio-1.0
402402 main-is: test/Server/WebSocket.hs
403403 Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, websockets, optparse-applicative, network, aeson, uuid-aeson, project-m36 == 0.1, random, MonadRandom, network-transport-tcp
404− Other-Modules: TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.TransactionGraphOperator, ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.TransGraphRelationalOperator
404+ Other-Modules: TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.TransactionGraphOperator, ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.SchemaOperator
405405 Default-Extensions: OverloadedStrings
406406 GHC-Options: -Wall
407407 Hs-Source-Dirs: ./src/bin, .
src/bin/TutorialD/Interpreter.hs+2−2
@@ -76,11 +76,11 @@ promptText mHeadName mSchemaName = "TutorialD (" <> transInfo <> "): "
7676 where
7777 transInfo = fromMaybe "<unknown>" mHeadName <> "/" <> fromMaybe "<no schema>" mSchemaName
7878
79−parseTutorialD :: T.Text -> Either ParseError ParsedOperation
79+parseTutorialD :: T.Text -> Either (ParseError Char Dec) ParsedOperation
8080parseTutorialD inputString = parse interpreterParserP "" inputString
8181
8282--only parse tutoriald which doesn't result in file I/O
83−safeParseTutorialD :: T.Text -> Either ParseError ParsedOperation
83+safeParseTutorialD :: T.Text -> Either (ParseError Char Dec) ParsedOperation
8484safeParseTutorialD inputString = parse safeInterpreterParserP "" inputString
8585
8686data SafeEvaluationFlag = SafeEvaluation | UnsafeEvaluation deriving (Eq)
src/bin/TutorialD/Interpreter/Base.hs+6−3
@@ -19,6 +19,7 @@ import Control.Monad (void)
1919import qualified Data.UUID as U
2020import ProjectM36.Relation
2121import Control.Monad.Random
22+import Data.List.NonEmpty as NE
2223
2324displayOpResult :: TutorialDOperatorResult -> IO ()
2425displayOpResult QuitResult = return ()
@@ -31,9 +32,11 @@ displayOpResult (DisplayRelationResult rel) = do
3132 gen <- newStdGen
3233 let randomlySortedRel = evalRand (randomizeTupleOrder rel) gen
3334 TIO.putStrLn (showRelation randomlySortedRel)
34−displayOpResult (DisplayParseErrorResult promptLength err) = TIO.putStrLn pointyString >> TIO.putStrLn ("ERR:" <> T.pack (show err))
35+displayOpResult (DisplayParseErrorResult promptLength err) = TIO.putStrLn pointyString >> TIO.putStr ("ERR:" <> errString)
3536 where
36− pointyString = T.justifyRight (promptLength + (sourceColumn (errorPos err))) '_' "^"
37+ errString = T.pack (parseErrorPretty err)
38+ errorIndent = unPos (sourceColumn (NE.head (errorPos err)))
39+ pointyString = T.justifyRight (promptLength + fromIntegral errorIndent) '_' "^"
3740
3841spaceConsumer :: Parser ()
3942spaceConsumer = Lex.space (void spaceChar) (Lex.skipLineComment "--") (Lex.skipBlockComment "{-" "-}")
@@ -117,7 +120,7 @@ data TutorialDOperatorResult = QuitResult |
117120 DisplayIOResult (IO ()) |
118121 DisplayRelationResult Relation |
119122 DisplayErrorResult StringType |
120− DisplayParseErrorResult Int ParseError | -- Int refers to length of prompt text
123+ DisplayParseErrorResult Int (ParseError Char Dec) | -- Int refers to length of prompt text
121124 QuietSuccessResult
122125 deriving (Generic)
123126
stack.yaml+5−1
@@ -2,7 +2,7 @@
22# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/
33
44# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
5−resolver: lts-6.27
5+resolver: lts-8.0
66
77# Local packages, usually specified by relative directory name
88packages:
@@ -15,6 +15,10 @@ extra-deps:
1515- gnuplot-0.5.4.1
1616- text-1.2.2.1
1717- uuid-aeson-0.1.0.0
18+- distributed-process-0.6.6
19+- distributed-process-async-0.2.3
20+- distributed-process-client-server-0.1.3.2
21+- distributed-process-extras-0.2.1.2
1822
1923# Override default flag values for local packages and extra-deps
2024flags: {}