project-m36 0.5 → 0.5.1
raw patch · 12 files changed
+101/−142 lines, 12 filesdep +quickcheck-instancesdep ~basedep ~ghc
Dependencies added: quickcheck-instances
Dependency ranges changed: base, ghc
Files
- Changelog.markdown +5/−0
- project-m36.cabal +41/−98
- src/lib/ProjectM36/Arbitrary.hs +2/−13
- src/lib/ProjectM36/IsomorphicSchema.hs +4/−6
- src/lib/ProjectM36/Relation.hs +4/−0
- src/lib/ProjectM36/RelationalExpression.hs +14/−9
- src/lib/ProjectM36/Sessions.hs +5/−3
- test/IsomorphicSchema.hs +6/−6
- test/Relation/Basic.hs +7/−1
- test/Server/Main.hs +2/−2
- test/TutorialD/Interpreter.hs +11/−2
- test/TutorialD/Interpreter/DatabaseContextFunctionScript.hs +0/−2
Changelog.markdown view
@@ -1,3 +1,8 @@+# 2018-10-03 (v0.5.1)++* fix atom function type validation+* add support for GHC 8.4 (now we support GHC 8.0, 8.2, and 8.4)+ # 2018-08-10 (v0.5) * fix critical type bug which allowed unresolved types to be used
project-m36.cabal view
@@ -1,5 +1,5 @@ Name: project-m36-Version: 0.5+Version: 0.5.1 License: PublicDomain Build-Type: Simple Homepage: https://github.com/agentm/project-m36@@ -22,73 +22,14 @@ Default: False Manual: True +--flag to allow stack to use its older, pinned packages+Flag stack+ Description: build with stack and stackage+ Manual: True+ Default: False+ Library- Build-Depends: base>=4.8 && < 6.0- ,ghc >= 7.8 && < 8.3- ,ghc-paths- ,mtl- ,containers- ,unordered-containers- ,hashable- ,haskeline- ,directory- ,MonadRandom- ,random-shuffle- --critical uuid bug in lesser versions https://www.reddit.com/r/haskell/comments/4myot5/psa_make_sure_to_use_uuid_1312/- ,uuid >= 1.3.12- ,cassava >= 0.4.5.1 && < 0.6- ,text- ,bytestring- ,deepseq- ,deepseq-generics- ,vector- ,parallel- ,monad-parallel- ,exceptions- ,transformers- ,gnuplot- ,binary- ,filepath- ,zlib- ,directory- ,vector-binary-instances- ,temporary- ,stm- ,time- ,hashable-time- ,old-locale- ,rset- --used for CSV parsing- ,attoparsec- ,either- ,base64-bytestring- ,data-interval- ,extended-reals- ,network-transport- -- aeson 1.1 and above includes instances for UUID types- ,aeson >= 1.1- ,path-pieces- ,conduit- ,resourcet- ,http-api-data- ,semigroups- -- used for arbitrary tuples- ,QuickCheck---needed for remote access- ,distributed-process-client-server >= 0.2.3- ,distributed-process >= 0.7.2- ,distributed-process-extras >= 0.3.2- ,distributed-process-async >= 0.2.4.1- ,network-transport-tcp >= 0.6.0- ,network-transport- ,list-t- ,stm-containers >= 0.2.15- ,foldl- ,deferred-folds- ,optparse-applicative- ,Glob---used for hashing the transaction graph file to check for differences- ,cryptohash-sha256+ Build-Depends: base>=4.8 && < 4.12, ghc >= 7.8 && < 8.5, ghc-paths, mtl, containers, unordered-containers, hashable, haskeline, directory, MonadRandom, random-shuffle, uuid >= 1.3.12, cassava >= 0.4.5.1 && < 0.6, text, bytestring, deepseq, deepseq-generics, vector, parallel, monad-parallel, exceptions, transformers, gnuplot, binary, filepath, zlib, directory, vector-binary-instances, temporary, stm, time, hashable-time, old-locale, rset, attoparsec, either, base64-bytestring, data-interval, extended-reals, network-transport, aeson >= 1.1, path-pieces, conduit, resourcet, http-api-data, semigroups, QuickCheck, quickcheck-instances, distributed-process-client-server >= 0.2.3, distributed-process >= 0.7.2, distributed-process-extras >= 0.3.2, distributed-process-async >= 0.2.4.1, network-transport-tcp >= 0.6.0, network-transport, list-t, stm-containers >= 0.2.15, foldl, optparse-applicative, Glob, cryptohash-sha256 Exposed-Modules: ProjectM36.Error, ProjectM36.Transaction, ProjectM36.TransactionGraph,@@ -160,7 +101,7 @@ ProjectM36.FileLock, ProjectM36.FSType, ProjectM36.Arbitrary- GHC-Options: -Wall -rdynamic+ GHC-Options: -Wall -rdynamic if os(windows) Build-Depends: Win32 >= 2.5.4.1 Other-Modules: ProjectM36.Win32Handle@@ -174,10 +115,12 @@ if impl(ghc>= 8) build-depends: ghc-boot, ghci+ if !flag(stack) + Build-Depends: deferred-folds Executable tutd Build-Depends: base >=4.8 && <5.0,- ghc >= 7.8 && < 8.3,+ ghc >= 7.8 && < 8.5, ghc-paths, project-m36, containers,@@ -233,14 +176,14 @@ TutorialD.Interpreter.SchemaOperator main-is: TutorialD/tutd.hs CC-Options: -fPIC- GHC-Options: -Wall -rdynamic+ GHC-Options: -Wall -rdynamic -threaded Hs-Source-Dirs: ./src/bin Default-Language: Haskell2010 Default-Extensions: OverloadedStrings Executable project-m36-server Build-Depends: base,- ghc >= 7.8 && < 8.3,+ ghc >= 7.8 && < 8.5, ghc-paths, project-m36, binary,@@ -270,7 +213,7 @@ list-t, base64-bytestring Main-Is: ./src/bin/ProjectM36/Server/project-m36-server.hs- GHC-Options: -Wall -threaded -rtsopts+ GHC-Options: -Wall -threaded -rtsopts if flag(profiler) GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall Default-Language: Haskell2010@@ -308,7 +251,7 @@ main-is: test/TutorialD/Interpreter.hs 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, random, MonadRandom, semigroups 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- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ./src/bin, ., test Test-Suite test-tutoriald-atomfunctionscript@@ -318,7 +261,7 @@ 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 main-is: test/TutorialD/Interpreter/AtomFunctionScript.hs Build-Depends: base, HUnit, project-m36, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline, random, MonadRandom, semigroups, time- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ./src/bin, ./test, . Test-Suite test-tutoriald-databasecontextfunctionscript@@ -328,7 +271,7 @@ 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 main-is: test/TutorialD/Interpreter/DatabaseContextFunctionScript.hs Build-Depends: base, HUnit, project-m36, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline, random, MonadRandom, semigroups, time- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ./src/bin, ./test, . Test-Suite test-relation@@ -337,7 +280,7 @@ type: exitcode-stdio-1.0 main-is: test/Relation/Basic.hs 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, project-m36, transformers- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Test-Suite test-static-optimizer Default-Language: Haskell2010@@ -345,7 +288,7 @@ type: exitcode-stdio-1.0 main-is: test/Relation/StaticOptimizer.hs 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, project-m36, transformers- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Test-Suite test-transactiongraph-persist Default-Language: Haskell2010@@ -355,7 +298,7 @@ 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, project-m36, random, MonadRandom, semigroups Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.BasicExamples Hs-Source-Dirs: ., ./src/bin- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Test-Suite test-relation-import-csv Default-Language: Haskell2010@@ -363,7 +306,7 @@ type: exitcode-stdio-1.0 main-is: test/Relation/Import/CSV.hs 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, project-m36- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Test-Suite test-tutoriald-import-tutoriald Default-Language: Haskell2010@@ -372,7 +315,7 @@ main-is: test/TutorialD/Interpreter/Import/TutorialD.hs 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, project-m36, random, MonadRandom, semigroups Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.BasicExamples- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ., ./src/bin Test-Suite test-relation-export-csv@@ -381,7 +324,7 @@ type: exitcode-stdio-1.0 main-is: test/Relation/Export/CSV.hs 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, project-m36- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Test-Suite test-transactiongraph-merge Default-Language: Haskell2010@@ -389,7 +332,7 @@ type: exitcode-stdio-1.0 main-is: test/TransactionGraph/Merge.hs 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, template-haskell, transformers, aeson, conduit, either, path-pieces, http-api-data, stm-containers, list-t, project-m36- GHC-Options: -Wall+ GHC-Options: -Wall -threaded benchmark bench Default-Language: Haskell2010@@ -397,7 +340,7 @@ type: exitcode-stdio-1.0 main-is: benchmark/Relation.hs 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, criterion, stm-containers, project-m36- GHC-Options: -Wall -rtsopts+ GHC-Options: -Wall -rtsopts -threaded Hs-Source-Dirs: ./src/bin Test-Suite test-server@@ -407,28 +350,28 @@ main-is: test/Server/Main.hs Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, 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, project-m36, network-transport, semigroups HS-Source-Dirs: ., ./src/bin- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Executable Example-SimpleClient Default-Language: Haskell2010 Default-Extensions: OverloadedStrings 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, ghc, ghc-paths, project-m36, random, MonadRandom Main-Is: examples/SimpleClient.hs- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Executable Example-OutOfTheTarpit Default-Language: Haskell2010 Default-Extensions: OverloadedStrings 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, aeson, path-pieces, either, conduit, http-api-data, template-haskell, ghc, ghc-paths, project-m36 Main-Is: examples/out_of_the_tarpit.hs- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Executable Example-Blog Default-Language: Haskell2010 Default-Extensions: OverloadedStrings 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, aeson, path-pieces, either, conduit, http-api-data, template-haskell, ghc, ghc-paths, project-m36, scotty, blaze-html, http-types Main-Is: examples/blog.hs- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Executable Example-Hair@@ -436,14 +379,14 @@ Default-Extensions: OverloadedStrings 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, aeson, path-pieces, either, conduit, http-api-data, template-haskell, ghc, ghc-paths, project-m36 Main-Is: examples/hair.hs- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Executable Example-CustomTupleable Default-Language: Haskell2010 Default-Extensions: OverloadedStrings 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, aeson, path-pieces, either, conduit, http-api-data, template-haskell, ghc, ghc-paths, project-m36 Main-Is: examples/CustomTupleable.hs- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Test-Suite test-scripts Default-Language: Haskell2010@@ -452,7 +395,7 @@ main-is: test/scripts.hs Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, 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, project-m36, random, MonadRandom, semigroups Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.Import.BasicExamples- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ., ./src/bin Executable project-m36-websocket-server@@ -460,7 +403,7 @@ Build-Depends: base, aeson, path-pieces, either, conduit, http-api-data, template-haskell, websockets, aeson, optparse-applicative, project-m36, containers, bytestring, text, vector, uuid, megaparsec, haskeline, mtl, directory, base64-bytestring, random, MonadRandom, time, network-transport-tcp, semigroups, attoparsec Main-Is: ProjectM36/Server/WebSocket/websocket-server.hs 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- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ./src/bin Default-Extensions: OverloadedStrings @@ -471,7 +414,7 @@ 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, project-m36, random, MonadRandom, network-transport-tcp, semigroups 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 Default-Extensions: OverloadedStrings- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ./src/bin, . Test-Suite test-isomorphic-schemas@@ -480,7 +423,7 @@ main-is: test/IsomorphicSchema.hs 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, project-m36 Default-Extensions: OverloadedStrings- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ./src/bin, . Test-Suite test-atomable@@ -490,7 +433,7 @@ 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, project-m36, random, MonadRandom, semigroups 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.SchemaOperator, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types Default-Extensions: OverloadedStrings- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ./src/bin, ., test/ Test-Suite test-multiprocess-access@@ -499,7 +442,7 @@ main-is: test/MultiProcessDatabaseAccess.hs 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, project-m36, random, MonadRandom Default-Extensions: OverloadedStrings- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ./src/bin, ., test/ Test-Suite test-transactiongraph-automerge@@ -509,7 +452,7 @@ 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, project-m36, random, MonadRandom, semigroups 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.SchemaOperator, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types Default-Extensions: OverloadedStrings- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ./src/bin, ., test/ Test-Suite test-tupleable@@ -518,7 +461,7 @@ main-is: test/Relation/Tupleable.hs 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, project-m36, random, MonadRandom, semigroups Default-Extensions: OverloadedStrings- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ./src/bin, ., test/ Test-Suite test-client-simple@@ -527,7 +470,7 @@ type: exitcode-stdio-1.0 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, project-m36, random, MonadRandom, semigroups Default-Extensions: OverloadedStrings- GHC-Options: -Wall+ GHC-Options: -Wall -threaded Hs-Source-Dirs: ./src/bin, ., test/ -- test for file handle leaks
src/lib/ProjectM36/Arbitrary.hs view
@@ -10,8 +10,9 @@ import ProjectM36.DataConstructorDef as DCD import ProjectM36.DataTypes.Interval import qualified Data.Vector as V-import Data.Text (Text,pack)+import Data.Text (Text) import Test.QuickCheck+import Test.QuickCheck.Instances () import qualified Data.ByteString.Char8 as B import Data.Time import Control.Monad.Reader@@ -74,18 +75,6 @@ maybeToRight :: b -> Maybe a -> Either b a maybeToRight _ (Just x) = Right x maybeToRight y Nothing = Left y--instance Arbitrary Text where- arbitrary = pack <$> elements (map (replicate 3) ['A'..'Z'])--instance Arbitrary Day where- arbitrary = ModifiedJulianDay <$> (arbitrary :: Gen Integer)--instance Arbitrary UTCTime where- arbitrary = UTCTime <$> arbitrary <*> (secondsToDiffTime <$> choose(0,86400))--instance Arbitrary B.ByteString where- arbitrary = B.pack <$> (arbitrary :: Gen String) arbitraryRelationTuple :: Attributes -> WithTCMap Gen (Either RelationalError RelationTuple) arbitraryRelationTuple attris = do
src/lib/ProjectM36/IsomorphicSchema.hs view
@@ -14,9 +14,7 @@ import qualified Data.Map as M import qualified Data.Set as S import qualified Data.List as L-import qualified Data.Text as T import Data.Monoid---import Debug.Trace -- isomorphic schemas offer bi-directional functors between two schemas --TODO: note that renaming a relvar should alter any stored isomorphisms as well@@ -304,11 +302,11 @@ -- | Create inclusion dependencies mainly for IsoRestrict because the predicate should hold in the base schema. createIncDepsForIsomorph :: SchemaName -> SchemaIsomorph -> InclusionDependencies-createIncDepsForIsomorph sname (IsoRestrict _ predi (rvTrue, rvFalse)) = let +createIncDepsForIsomorph sname (IsoRestrict origRv predi (rvTrue, rvFalse)) = let newIncDep predicate rv = InclusionDependency (Project AN.empty (Restrict predicate (RelationVariable rv ()))) (ExistingRelation relationTrue)- incDepName b = "schema" <> "_" <> sname <> "_" <> T.pack (show b) in- M.fromList [(incDepName True, newIncDep predi rvTrue),- (incDepName False, newIncDep (NotPredicate predi) rvFalse)]+ incDepName b = "schema" <> "_" <> sname <> "_" <> b in+ M.fromList [(incDepName (origRv <> "_true"), newIncDep predi rvTrue),+ (incDepName (origRv <> "_false"), newIncDep (NotPredicate predi) rvFalse)] createIncDepsForIsomorph _ _ = M.empty -- in the case of IsoRestrict, the database context should be updated with the restriction so that if the restriction does not hold, then the schema cannot be created
src/lib/ProjectM36/Relation.hs view
@@ -64,6 +64,10 @@ mkRelationDeferVerify attrs tupleSet = return $ Relation attrs (RelationTupleSet (filter tupleFilter (asList tupleSet))) where tupleFilter tuple = isRight (verifyTuple attrs tuple)+ +--return a relation of the same type except without any tuples+relationWithEmptyTupleSet :: Relation -> Relation +relationWithEmptyTupleSet (Relation attrs _) = emptyRelationWithAttrs attrs mkRelationFromTuples :: Attributes -> [RelationTuple] -> Either RelationalError Relation mkRelationFromTuples attrs tupleSetList = do
src/lib/ProjectM36/RelationalExpression.hs view
@@ -663,7 +663,10 @@ --replace the relationVariables context element with a cloned set of relation devoid of tuples let context' = contextWithEmptyTupleSets context rstate' = setStateElemsContext rstate context'- pure (runReader (evalRelationalExpr expr) rstate')+ --evalRelationalExpr could still return an existing relation with tuples, so strip them+ pure $ case runReader (evalRelationalExpr expr) rstate' of+ Left err -> Left err+ Right typeRel -> Right (relationWithEmptyTupleSet typeRel) --returns a database context with all tuples removed --this is useful for type checking and optimization@@ -750,18 +753,18 @@ --merge attrs into the state attributes rstate <- ask runExceptT $ do- aType <- liftE (typeFromAtomExpr attrs atomExpr)+ aType <- liftE (typeFromAtomExpr attrs atomExpr) if aType /= BoolAtomType then throwE (AtomTypeMismatchError aType BoolAtomType) else pure (\tupleIn ->- pure $ case runReader (evalAtomExpr tupleIn atomExpr) rstate of- Left _ -> False- Right boolAtomValue -> boolAtomValue == BoolAtom True)+ case runReader (evalAtomExpr tupleIn atomExpr) rstate of+ Left err -> Left err+ Right boolAtomValue -> pure (boolAtomValue == BoolAtom True)) tupleExprCheckNewAttrName :: AttributeName -> Relation -> Either RelationalError Relation tupleExprCheckNewAttrName attrName rel = if isRight (attributeForName attrName rel) then- Left (error "SPAMMIT" $ AttributeNameInUseError attrName)+ Left (AttributeNameInUseError attrName) else Right rel @@ -800,13 +803,15 @@ func <- either throwE pure (atomFunctionForName funcName functions) let expectedArgCount = length (atomFuncType func) - 1 actualArgCount = length argTypes- safeInit [_] = [] safeInit [] = [] -- different behavior from normal init- safeInit (_:xs) = safeInit xs+ safeInit xs = init xs if expectedArgCount /= actualArgCount then throwE (FunctionArgumentCountMismatchError expectedArgCount actualArgCount) else do- mapM_ (\(expType, actType) -> either throwE pure (atomTypeVerify expType actType)) (safeInit (zip (atomFuncType func) argTypes))+ let zippedArgs = zip (safeInit (atomFuncType func)) argTypes+ mapM_ (\(expType, eActType) -> do+ actType <- either throwE pure eActType+ either throwE pure (atomTypeVerify expType actType)) zippedArgs evaldArgs <- mapM (liftE . evalAtomExpr tupIn) arguments case evalAtomFunction func evaldArgs of Left err -> throwE (AtomFunctionUserError err)
src/lib/ProjectM36/Sessions.hs view
@@ -16,21 +16,23 @@ import ProjectM36.Error import qualified Data.UUID as U import qualified Control.Foldl as Foldl-import qualified DeferredFolds.UnfoldM as UnfoldM+#if MIN_VERSION_stm_containers(1,0,0)+import qualified DeferredFolds.UnfoldlM as UF+#endif type Sessions = StmMap.Map SessionId Session --from https://github.com/nikita-volkov/stm-containers/blob/master/test/Main/MapTests.hs stmMapToList :: StmMap.Map k v -> STM [(k, v)] #if MIN_VERSION_stm_containers(1,0,0)-stmMapToList = UnfoldM.foldM (Foldl.generalize Foldl.list) . StmMap.unfoldM+stmMapToList = UF.foldM (Foldl.generalize Foldl.list) . StmMap.unfoldlM #else stmMapToList = ListT.fold (\l -> return . (:l)) [] . StmMap.stream #endif stmSetToList :: StmSet.Set v -> STM [v] #if MIN_VERSION_stm_containers(1,0,0)-stmSetToList = UnfoldM.foldM (Foldl.generalize Foldl.list) . StmSet.unfoldM+stmSetToList = UF.foldM (Foldl.generalize Foldl.list) . StmSet.unfoldlM #else stmSetToList = ListT.fold (\l -> return . (:l)) [] . StmSet.stream #endif
test/IsomorphicSchema.hs view
@@ -105,15 +105,15 @@ --create motors relation which is split into low-power (<50 horsepower) and high-power (>=50 horsepower) motors --the schema is contains the split relvars motorsRel <- assertEither $ mkRelationFromList (A.attributesFromList [Attribute "name" TextAtomType,- Attribute "power" IntAtomType]) - [[TextAtom "Puny", IntAtom 10],- [TextAtom "Scooter", IntAtom 49],- [TextAtom "Auto", IntAtom 200],- [TextAtom "Tractor", IntAtom 500]]+ Attribute "power" IntegerAtomType]) + [[TextAtom "Puny", IntegerAtom 10],+ [TextAtom "Scooter", IntegerAtom 49],+ [TextAtom "Auto", IntegerAtom 200],+ [TextAtom "Tractor", IntegerAtom 500]] let baseSchema = mkRelationalExprState DBC.basicDatabaseContext { relationVariables = M.singleton "motor" motorsRel }- splitPredicate = AtomExprPredicate (FunctionAtomExpr "lt" [AttributeAtomExpr "power", NakedAtomExpr (IntAtom 50)] ())+ splitPredicate = AtomExprPredicate (FunctionAtomExpr "lt" [AttributeAtomExpr "power", NakedAtomExpr (IntegerAtom 50)] ()) splitIsomorphs = [IsoUnion ("lowpower", "highpower") splitPredicate "motor", IsoRename "true" "true", IsoRename "false" "false"]
test/Relation/Basic.hs view
@@ -25,7 +25,8 @@ testRelation "products" productsRel, testRelation "supplierProducts" supplierProductsRel, testMkRelationFromExprsBadAttrs,- testDuplicateAttributes+ testDuplicateAttributes,+ testExistingRelationType ] main :: IO () @@ -104,3 +105,8 @@ let eRel = mkRelation attrs emptyTupleSet attrs = attributesFromList [Attribute "a" IntAtomType, Attribute "a" TextAtomType] assertEqual "duplicate attribute names" (Left (DuplicateAttributeNamesError (S.singleton "a"))) eRel+ +testExistingRelationType :: Test+testExistingRelationType = TestCase $ do+ let typeResult = runReader (typeForRelationalExpr (ExistingRelation relationTrue)) (RelationalExprStateElems DBC.empty)+ assertEqual "ExistingRelation with tuples type" (Right relationFalse) typeResult
test/Server/Main.hs view
@@ -222,12 +222,12 @@ #if defined(linux_HOST_OS) --validate that creating a server, connecting a client, and then disconnecting doesn't leak file descriptors testFileDescriptorCount = TestCase $ do- (serverAddress, serverTid) <- launchTestServer 1000+ (serverAddress, serverTid) <- launchTestServer 0 unusedMVar <- newEmptyMVar startCount <- fdCount Right (sess, testConn) <- testConnection serverAddress unusedMVar --add a test commit to trigger the fsync machinery- executeDatabaseContextExpr sess testConn (Assign "x" (ExistingRelation relationFalse)) >>= eitherFail + executeDatabaseContextExpr sess testConn (Assign "x" (ExistingRelation relationFalse)) >>= eitherFail commit sess testConn >>= eitherFail close testConn endCount <- fdCount
test/TutorialD/Interpreter.hs view
@@ -72,7 +72,8 @@ testArbitraryRelation, testNonEmptyListType, testUnresolvedAtomTypes,- testWithClause+ testWithClause,+ testAtomFunctionArgumentMismatch ] simpleRelTests = [("x:=true", Right relationTrue), ("x:=false", Right relationFalse),@@ -631,4 +632,12 @@ expectTutorialDErr sessionId dbconn (T.isPrefixOf err1) "x:=with (s as sp) s" - +testAtomFunctionArgumentMismatch :: Test+testAtomFunctionArgumentMismatch = TestCase $ do+ (sessionId, dbconn) <- dateExamplesConnection emptyNotificationCallback+ let err1 = "AtomTypeMismatchError"+ --atom function type mismatch+ expectTutorialDErr sessionId dbconn (T.isPrefixOf err1) "x:=relation{tuple{a 5}} where ^gt(@a,1.5)"+ --wrong argument count+ let err2 = "FunctionArgumentCountMismatchError"+ expectTutorialDErr sessionId dbconn (T.isPrefixOf err2) "x:=relation{tuple{a 5}} where ^gt(@a,1,3)"
test/TutorialD/Interpreter/DatabaseContextFunctionScript.hs view
@@ -19,9 +19,7 @@ (sess, conn) <- dateExamplesConnection emptyNotificationCallback let addfunc = "adddatabasecontextfunction \"addTrue2\" DatabaseContext -> Either DatabaseContextFunctionError DatabaseContext \"\"\"(\\[] ctx -> executeDatabaseContextExpr (Assign \"true2\" (ExistingRelation relationTrue)) ctx) :: [Atom] -> DatabaseContext -> Either DatabaseContextFunctionError DatabaseContext\"\"\"" executeTutorialD sess conn addfunc- putStrLn "spam1" executeTutorialD sess conn "execute addTrue2()"- putStrLn "spam2" {- let true2Expr = RelationVariable "true2" () result <- executeRelationalExpr sess conn true2Expr