on master help sign in
WIP library compilation checkpoint

TODO: local connections' notification callback

commitdf6060808fa035db978673d8629c28edc4e5bd99 authorAgentM <agentm@themactionfaction.com> dateSat 26 Dec 2020, 00:02 (6 years ago) parent652414b
13 files changed+247−179
cabal.project+1−1 examples/DerivingCustomTupleable.hs+3−2 examples/hair.hs+1−2 project-m36.cabal+32−27 release.nix+7−43 src/bin/ProjectM36/Server/WebSocket.hs+1−1 src/bin/TutorialD/Interpreter.hs+1−1 src/bin/TutorialD/tutd.hs+5−18 src/lib/ProjectM36/Client.hs+20−27 src/lib/ProjectM36/Server.hs+146−40 src/lib/ProjectM36/Server/ParseArgs.hs+1−1 src/lib/ProjectM36/Server/Types.hs+1−1 test/Relation/Atomable.hs+28−15
cabal.project+1−1
@@ -11,7 +11,7 @@ source-repository-package
1111source-repository-package
1212 type: git
1313 location: https://github.com/agentm/curryer.git
14− tag: f67c45d1bfcb753d32ed3fe51b8e07b4c021c9bb
14+ tag: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
1515
1616source-repository-package
1717 type: git
examples/DerivingCustomTupleable.hs+3−2
@@ -3,16 +3,15 @@
33import ProjectM36.Tupleable.Deriving
44import ProjectM36.Atomable (Atomable)
55import Control.DeepSeq (NFData)
6−import Data.Binary (Binary)
76import Data.Text (Text)
87import GHC.Generics (Generic)
98
109newtype BlogId = BlogId { getBlogId :: Int }
1110 deriving stock (Eq, Ord, Show, Generic)
1211 deriving newtype (Num)
12+ deriving Serialise via WineryRecord BlogId
1313
1414instance NFData BlogId
15−instance Binary BlogId
1615instance Atomable BlogId
1716
1817data Blog = Blog
@@ -23,6 +22,7 @@ data Blog = Blog
2322 deriving stock (Show, Generic)
2423 deriving (Tupleable)
2524 via Codec (Field (DropPrefix "blog" >>> CamelCase)) Blog
25+ deriving Serialise via WineryRecord Blog
2626
2727data Comment = Comment
2828 { commentAuthorName :: Text
@@ -32,6 +32,7 @@ data Comment = Comment
3232 deriving stock (Show, Generic)
3333 deriving (Tupleable)
3434 via Codec (Field (DropPrefix "comment" >>> CamelCase)) Comment
35+ deriving Serialise via WineryRecord Comment
3536
3637main :: IO ()
3738main = do
examples/hair.hs+1−2
@@ -3,14 +3,13 @@ import ProjectM36.Client
33import ProjectM36.Relation.Show.Term
44import GHC.Generics
55import Data.Text
6−import Data.Binary
76import Control.DeepSeq
87import qualified Data.Map as M
98import qualified Data.Text.IO as TIO
109import Data.Proxy
1110
1211data Hair = Bald | Brown | Blond | OtherColor Text
13− deriving (Generic, Show, Eq, Binary, NFData, Atomable)
12+ deriving (Generic, Show, Eq, NFData, Atomable)
1413
1514main :: IO ()
1615main = do
project-m36.cabal+32−27
@@ -112,6 +112,11 @@ Library
112112 ProjectM36.Server.EntryPoints,
113113 ProjectM36.Server.ParseArgs,
114114 ProjectM36.Server.RemoteCallTypes,
115+ ProjectM36.Serialise.AtomFunctionError,
116+ ProjectM36.Serialise.DataFrame,
117+ ProjectM36.Serialise.DatabaseContextFunctionError,
118+ ProjectM36.Serialise.IsomorphicSchema,
119+ ProjectM36.Server.Types,
115120 ProjectM36.Session,
116121 ProjectM36.Sessions,
117122 ProjectM36.Transaction.Persist,
@@ -245,7 +250,7 @@ Executable project-m36-server
245250Executable bigrel
246251 Default-Language: Haskell2010
247252 Default-Extensions: OverloadedStrings
248− 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, random, MonadRandom, semigroups, parser-combinators
253+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, 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, random, MonadRandom, semigroups, parser-combinators
249254 Other-Modules: TutorialD.Interpreter.Base,
250255 TutorialD.Interpreter.DatabaseContextExpr,
251256 TutorialD.Interpreter.RelationalExpr,
@@ -272,7 +277,7 @@ Test-Suite test-tutoriald
272277 Default-Extensions: OverloadedStrings
273278 type: exitcode-stdio-1.0
274279 main-is: test/TutorialD/Interpreter.hs
275− 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, parser-combinators
280+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, list-t, project-m36, random, MonadRandom, semigroups, parser-combinators
276281 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
277282 GHC-Options: -Wall -threaded
278283 Hs-Source-Dirs: ./src/bin, ., test
@@ -302,7 +307,7 @@ Test-Suite test-relation
302307 Default-Extensions: OverloadedStrings
303308 type: exitcode-stdio-1.0
304309 main-is: test/Relation/Basic.hs
305− 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
310+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, project-m36, transformers
306311 GHC-Options: -Wall -threaded
307312
308313Test-Suite test-static-optimizer
@@ -310,7 +315,7 @@ Test-Suite test-static-optimizer
310315 Default-Extensions: OverloadedStrings
311316 type: exitcode-stdio-1.0
312317 main-is: test/Relation/StaticOptimizer.hs
313− 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
318+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, project-m36, transformers
314319 GHC-Options: -Wall -threaded
315320
316321Test-Suite test-transactiongraph-persist
@@ -318,7 +323,7 @@ Test-Suite test-transactiongraph-persist
318323 Default-Extensions: OverloadedStrings
319324 type: exitcode-stdio-1.0
320325 main-is: test/TransactionGraph/Persist.hs
321− 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, parser-combinators
326+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, project-m36, random, MonadRandom, semigroups, parser-combinators
322327 Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.BasicExamples
323328 Hs-Source-Dirs: ., ./src/bin
324329 GHC-Options: -Wall -threaded
@@ -328,7 +333,7 @@ Test-Suite test-relation-import-csv
328333 Default-Extensions: OverloadedStrings
329334 type: exitcode-stdio-1.0
330335 main-is: test/Relation/Import/CSV.hs
331− 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
336+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, project-m36
332337 GHC-Options: -Wall -threaded
333338
334339Test-Suite test-tutoriald-import-tutoriald
@@ -336,7 +341,7 @@ Test-Suite test-tutoriald-import-tutoriald
336341 Default-Extensions: OverloadedStrings
337342 type: exitcode-stdio-1.0
338343 main-is: test/TutorialD/Interpreter/Import/TutorialD.hs
339− 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, parser-combinators
344+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, project-m36, random, MonadRandom, semigroups, parser-combinators
340345 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
341346 GHC-Options: -Wall -threaded
342347 Hs-Source-Dirs: ., ./src/bin
@@ -346,7 +351,7 @@ Test-Suite test-relation-export-csv
346351 Default-Extensions: OverloadedStrings
347352 type: exitcode-stdio-1.0
348353 main-is: test/Relation/Export/CSV.hs
349− 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
354+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, project-m36
350355 GHC-Options: -Wall -threaded
351356
352357Test-Suite test-transactiongraph-merge
@@ -354,7 +359,7 @@ Test-Suite test-transactiongraph-merge
354359 Default-Extensions: OverloadedStrings
355360 type: exitcode-stdio-1.0
356361 main-is: test/TransactionGraph/Merge.hs
357− 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
362+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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
358363 GHC-Options: -Wall -threaded
359364
360365benchmark bench
@@ -362,7 +367,7 @@ benchmark bench
362367 Default-Extensions: OverloadedStrings
363368 type: exitcode-stdio-1.0
364369 main-is: benchmark/Relation.hs
365− 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
370+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, criterion, stm-containers, project-m36
366371 GHC-Options: -Wall -rtsopts -threaded
367372 Hs-Source-Dirs: ./src/bin
368373
@@ -371,28 +376,28 @@ Test-Suite test-server
371376 Default-Extensions: OverloadedStrings
372377 type: exitcode-stdio-1.0
373378 main-is: test/Server/Main.hs
374− 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
379+ 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,parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, project-m36, network-transport, semigroups
375380 HS-Source-Dirs: ., ./src/bin
376381 GHC-Options: -Wall -threaded
377382
378383Executable Example-SimpleClient
379384 Default-Language: Haskell2010
380385 Default-Extensions: OverloadedStrings
381− 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
386+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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
382387 Main-Is: examples/SimpleClient.hs
383388 GHC-Options: -Wall -threaded
384389
385390Executable Example-OutOfTheTarpit
386391 Default-Language: Haskell2010
387392 Default-Extensions: OverloadedStrings
388− 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
393+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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
389394 Main-Is: examples/out_of_the_tarpit.hs
390395 GHC-Options: -Wall -threaded
391396
392397Executable Example-Blog
393398 Default-Language: Haskell2010
394399 Default-Extensions: OverloadedStrings
395− 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
400+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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
396401 Main-Is: examples/blog.hs
397402 GHC-Options: -Wall -threaded
398403
@@ -400,14 +405,14 @@ Executable Example-Blog
400405Executable Example-Hair
401406 Default-Language: Haskell2010
402407 Default-Extensions: OverloadedStrings
403− 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
408+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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
404409 Main-Is: examples/hair.hs
405410 GHC-Options: -Wall -threaded
406411
407412Executable Example-CustomTupleable
408413 Default-Language: Haskell2010
409414 Default-Extensions: OverloadedStrings
410− 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
415+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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
411416 Main-Is: examples/CustomTupleable.hs
412417 GHC-Options: -Wall -threaded
413418
@@ -417,7 +422,7 @@ Executable Example-DerivingCustomTupleable
417422 else
418423 Buildable: False
419424 Default-Language: Haskell2010
420− Build-Depends: base, text, deepseq, binary, project-m36
425+ Build-Depends: base, text, deepseq,project-m36
421426 Main-Is: examples/DerivingCustomTupleable.hs
422427 GHC-Options: -Wall -threaded
423428
@@ -426,7 +431,7 @@ Test-Suite test-scripts
426431 Default-Extensions: OverloadedStrings
427432 type: exitcode-stdio-1.0
428433 main-is: test/scripts.hs
429− 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, parser-combinators
434+ 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,parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, project-m36, random, MonadRandom, semigroups, parser-combinators
430435 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
431436 GHC-Options: -Wall -threaded
432437 Hs-Source-Dirs: ., ./src/bin
@@ -444,7 +449,7 @@ Test-Suite test-websocket-server
444449 Default-Language: Haskell2010
445450 type: exitcode-stdio-1.0
446451 main-is: test/Server/WebSocket.hs
447− 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, parser-combinators
452+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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, parser-combinators
448453 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
449454 Default-Extensions: OverloadedStrings
450455 GHC-Options: -Wall -threaded
@@ -454,7 +459,7 @@ Test-Suite test-isomorphic-schemas
454459 Default-Language: Haskell2010
455460 type: exitcode-stdio-1.0
456461 main-is: test/IsomorphicSchema.hs
457− 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
462+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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
458463 Default-Extensions: OverloadedStrings
459464 GHC-Options: -Wall -threaded
460465 Hs-Source-Dirs: ./src/bin, .
@@ -463,7 +468,7 @@ Test-Suite test-atomable
463468 Default-Language: Haskell2010
464469 type: exitcode-stdio-1.0
465470 main-is: test/Relation/Atomable.hs
466− 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, parser-combinators
471+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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, parser-combinators, winery
467472 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
468473 Default-Extensions: OverloadedStrings
469474 GHC-Options: -Wall -threaded
@@ -473,7 +478,7 @@ Test-Suite test-multiprocess-access
473478 Default-Language: Haskell2010
474479 type: exitcode-stdio-1.0
475480 main-is: test/MultiProcessDatabaseAccess.hs
476− 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
481+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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
477482 Default-Extensions: OverloadedStrings
478483 GHC-Options: -Wall -threaded
479484 Hs-Source-Dirs: ./src/bin, ., test/
@@ -482,7 +487,7 @@ Test-Suite test-transactiongraph-automerge
482487 Default-Language: Haskell2010
483488 type: exitcode-stdio-1.0
484489 main-is: test/TransactionGraph/Automerge.hs
485− 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, parser-combinators
490+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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, parser-combinators
486491 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
487492 Default-Extensions: OverloadedStrings
488493 GHC-Options: -Wall -threaded
@@ -492,7 +497,7 @@ Test-Suite test-tupleable
492497 Default-Language: Haskell2010
493498 type: exitcode-stdio-1.0
494499 main-is: test/Relation/Tupleable.hs
495− 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
500+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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
496501 Default-Extensions: OverloadedStrings
497502 GHC-Options: -Wall -threaded
498503 Hs-Source-Dirs: ./src/bin, ., test/
@@ -501,7 +506,7 @@ Test-Suite test-client-simple
501506 Default-Language: Haskell2010
502507 Main-Is: test/Client/Simple.hs
503508 type: exitcode-stdio-1.0
504− 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
509+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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
505510 Default-Extensions: OverloadedStrings
506511 GHC-Options: -Wall -threaded
507512 Hs-Source-Dirs: ./src/bin, ., test/
@@ -510,7 +515,7 @@ Test-Suite test-client-simple
510515Executable handles
511516 Default-Language: Haskell2010
512517 Default-Extensions: OverloadedStrings
513− 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, random, MonadRandom, semigroups, parser-combinators
518+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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, random, MonadRandom, semigroups, parser-combinators
514519 main-is: benchmark/Handles.hs
515520 Other-Modules: TutorialD.Interpreter,
516521 TutorialD.Interpreter.Base,
@@ -539,7 +544,7 @@ Test-Suite test-dataframe
539544 Main-Is: test/DataFrame.hs
540545 type: exitcode-stdio-1.0
541546 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
542− 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, parser-combinators
547+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,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, parser-combinators
543548 Default-Extensions: OverloadedStrings
544549 GHC-Options: -Wall -threaded
545550 Hs-Source-Dirs: ./src/bin, ., test/
release.nix+7−43
@@ -8,7 +8,6 @@ let
88 doJailbreak = pkgs.haskell.lib.doJailbreak;
99 dontHaddock = pkgs.haskell.lib.dontHaddock;
1010 dontCheck = pkgs.haskell.lib.dontCheck;
11− #distributed-process packages are no longer maintained- until we replace it entirely, add some hacks to build on newer GHC and packages
1211 distProcessPkg = pkg : dontHaddock (doJailbreak (dontCheck pkg));
1312 callHackageDirectWithOptions = {pkg,ver, sha256, options}:
1413 let pkgver = "${pkg}-${ver}";
@@ -20,41 +19,6 @@ let
2019
2120 haskellPackages = pkgs.haskell.packages.${compiler}.override {
2221 overrides = self: super: {
23− distributed-process-extras =
24− distProcessPkg (self.callHackageDirect {
25− pkg = "distributed-process-extras";
26− ver = "0.3.5";
27− sha256 = "13clq3alymcvknp7q8gz0i1hzx8im855lzmyrfffl8gglnlbi2w9";
28− }{});
29−
30− distributed-process-client-server =
31− distProcessPkg (self.callHackageDirect {
32− pkg = "distributed-process-client-server";
33− ver = "0.2.5.1";
34− sha256 = "0gkd8awapq7vy14vpnzawnwb67jvvcjaqg7imm0bp1wb6rw6x5x4";
35− }{});
36−
37− distributed-process-async =
38− distProcessPkg (callHackageDirectWithOptions {
39− pkg = "distributed-process-async";
40− ver = "0.2.6";
41− sha256 = "15wyfq115r6xjaz1h00sjh1v0fv498kkxr3xx6w84d8wdp2gxbn1";
42− options = "--no-check";
43− }{});
44−
45− distributed-process =
46− dontHaddock (self.callCabal2nix "distributed-process" (pkgs.fetchFromGitHub {
47− owner = "agentm";
48− repo = "distributed-process";
49− rev = "f352e097fbe494ad648b4e09249f865893ae90a3";
50− sha256 = "0xa2v77c9idmi89bky2wq1fykrn8grpk4rk7gcd5bkicxvdbcrym";}){});
51−
52− distributed-static =
53− self.callHackageDirect {
54− pkg = "distributed-static";
55− ver = "0.3.9";
56− sha256 = "0hibpzqwklnq335m7fwgk1bghz0lgxnd7ym10pbvxlcf7ly3nr6v";
57−}{};
5822 rank1dynamic =
5923 distProcessPkg (self.callHackageDirect {
6024 pkg = "rank1dynamic";
@@ -75,19 +39,19 @@ let
7539 sha256 = "0h9z6lawdm44minx9spvdb7sp645l36ri5cnxvhrcxwzr64s7qb5";
7640 }{};
7741
78− network-transport-tcp =
79− dontCheck (self.callHackageDirect {
80− pkg = "network-transport-tcp";
81− ver = "0.7.0";
82− sha256 = "0kfzrcynf34xsxx4rccg4qfy7jvinwqd8baian8ifqad9lfcapsb";
83− }{});
84−
8542 data-interval =
8643 self.callHackageDirect {
8744 pkg = "data-interval";
8845 ver = "2.0.1";
8946 sha256 = "085j4yjr8wimxampxqdrg47p577whwg2mjxgfdl44yfck52fb6an";
9047 }{};
48+
49+ curryer =
50+ self.callHackageDirect {
51+ pkg = "curryer";
52+ ver = "0.1";
53+ sha256 = "085j4yjr8wimxampxqdrg47p577whwg2mjxgfdl44yfck52fb6ac";
54+ }{};
9155
9256 project-m36 = dontCheck (self.callCabal2nixWithOptions "project-m36" ./. "-f-haskell-scripting" { });
9357
src/bin/ProjectM36/Server/WebSocket.hs+1−1
@@ -85,7 +85,7 @@ notificationCallback conn notifName evaldNotif = WS.sendTextData conn (encode (o
8585
8686--this creates a new database for each connection- perhaps not what we want (?)
8787createConnection :: WS.Connection -> DatabaseName -> Port -> Hostname -> IO (Either ConnectionError Connection)
88−createConnection wsconn dbname port host = connectProjectM36 (RemoteProcessConnectionInfo dbname (createNodeId host port) (notificationCallback wsconn))
88+createConnection wsconn dbname port host = connectProjectM36 (RemoteConnectionInfo dbname host port (notificationCallback wsconn))
8989
9090sendError :: (ToJSON a) => WS.Connection -> a -> IO ()
9191sendError conn err = WS.sendTextData conn (encode (object ["displayerror" .= err]))
src/bin/TutorialD/Interpreter.hs+1−1
@@ -227,7 +227,7 @@ type TutorialDExec = String
227227type CheckFS = Bool
228228
229229data InterpreterConfig = LocalInterpreterConfig PersistenceStrategy HeadName (Maybe TutorialDExec) [GhcPkgPath] CheckFS |
230− RemoteInterpreterConfig C.NodeId C.DatabaseName HeadName (Maybe TutorialDExec) CheckFS
230+ RemoteInterpreterConfig C.Hostname C.Port C.DatabaseName HeadName (Maybe TutorialDExec) CheckFS
231231
232232outputNotificationCallback :: C.NotificationCallback
233233outputNotificationCallback notName evaldNot = hPutStrLn stderr $ "Notification received " ++ show notName ++ ":\n" ++ "\n" ++ prettyEvaluatedNotification evaldNot
src/bin/TutorialD/tutd.hs+5−18
@@ -22,7 +22,7 @@ import qualified Data.Text as T
2222
2323parseArgs :: Parser InterpreterConfig
2424parseArgs = LocalInterpreterConfig <$> parsePersistenceStrategy <*> parseHeadName <*> parseTutDExec <*> many parseGhcPkgPath <*> parseCheckFS <|>
25− RemoteInterpreterConfig <$> parseNodeId <*> parseDatabaseName <*> parseHeadName <*> parseTutDExec <*> parseCheckFS
25+ RemoteInterpreterConfig <$> parseHostname "127.0.0.1" <*> parsePort defaultServerPort <*> parseDatabaseName <*> parseHeadName <*> parseTutDExec <*> parseCheckFS
2626
2727parseHeadName :: Parser HeadName
2828parseHeadName = option auto (long "head" <>
@@ -31,19 +31,6 @@ parseHeadName = option auto (long "head" <>
3131 value "master"
3232 )
3333
34−parseNodeId :: Parser NodeId
35−parseNodeId = createNodeId <$>
36− strOption (long "host" <>
37− short 'h' <>
38− help "Remote host name" <>
39− metavar "HOSTNAME" <>
40− value "127.0.0.1") <*>
41− option auto (long "port" <>
42− metavar "PORT NUMBER" <>
43− short 'p' <>
44− help "Remote port" <>
45− value defaultServerPort)
46−
4734--just execute some tutd and exit
4835parseTutDExec :: Parser (Maybe TutorialDExec)
4936parseTutDExec = optional $ strOption (long "exec-tutd" <>
@@ -57,19 +44,19 @@ opts = info (parseArgs <**> helpOption) idm
5744
5845connectionInfoForConfig :: InterpreterConfig -> ConnectionInfo
5946connectionInfoForConfig (LocalInterpreterConfig pStrategy _ _ ghcPkgPaths _) = InProcessConnectionInfo pStrategy outputNotificationCallback ghcPkgPaths
60−connectionInfoForConfig (RemoteInterpreterConfig remoteNodeId remoteDBName _ _ _) = RemoteProcessConnectionInfo remoteDBName remoteNodeId outputNotificationCallback
47+connectionInfoForConfig (RemoteInterpreterConfig remoteHost remotePort remoteDBName _ _ _) = RemoteConnectionInfo remoteDBName remoteHost (show remotePort) outputNotificationCallback
6148
6249headNameForConfig :: InterpreterConfig -> HeadName
6350headNameForConfig (LocalInterpreterConfig _ headn _ _ _) = headn
64−headNameForConfig (RemoteInterpreterConfig _ _ headn _ _) = headn
51+headNameForConfig (RemoteInterpreterConfig _ _ _ headn _ _) = headn
6552
6653execTutDForConfig :: InterpreterConfig -> Maybe String
6754execTutDForConfig (LocalInterpreterConfig _ _ t _ _) = t
68−execTutDForConfig (RemoteInterpreterConfig _ _ _ t _) = t
55+execTutDForConfig (RemoteInterpreterConfig _ _ _ _ t _) = t
6956
7057checkFSForConfig :: InterpreterConfig -> Bool
7158checkFSForConfig (LocalInterpreterConfig _ _ _ _ c) = c
72−checkFSForConfig (RemoteInterpreterConfig _ _ _ _ c) = c
59+checkFSForConfig (RemoteInterpreterConfig _ _ _ _ _ c) = c
7360
7461persistenceStrategyForConfig :: InterpreterConfig -> Maybe PersistenceStrategy
7562persistenceStrategyForConfig (LocalInterpreterConfig strat _ _ _ _) = Just strat
src/lib/ProjectM36/Client.hs+20−27
@@ -1,4 +1,4 @@
1−{-# LANGUAGE DeriveAnyClass, DeriveGeneric, ScopedTypeVariables, MonoLocalBinds, DerivingVia, GeneralizedNewtypeDeriving #-}
1+{-# LANGUAGE DeriveAnyClass, DeriveGeneric, ScopedTypeVariables, MonoLocalBinds, DerivingVia, GeneralizedNewtypeDeriving, PackageImports #-}
22{-|
33Module: ProjectM36.Client
44
@@ -9,6 +9,7 @@ module ProjectM36.Client
99 Connection(..),
1010 Port,
1111 Hostname,
12+ ServiceName,
1213 DatabaseName,
1314 ConnectionError(..),
1415 connectProjectM36,
@@ -141,7 +142,7 @@ import Data.UUID.V4 (nextRandom)
141142import Data.Word
142143import Control.Exception (IOException, handle, AsyncException, throwIO, fromException, Exception)
143144import Control.Concurrent.MVar
144−import Codec.Winery hiding (Schema)
145+import Codec.Winery hiding (Schema, schema)
145146import qualified Data.Map as M
146147#if MIN_VERSION_stm_containers(1,0,0)
147148import qualified StmContainers.Map as StmMap
@@ -191,7 +192,7 @@ data ConnectionInfo = InProcessConnectionInfo PersistenceStrategy NotificationCa
191192type EvaluatedNotifications = M.Map NotificationName EvaluatedNotification
192193
193194-- | Used for callbacks from the server when monitored changes have been made.
194−newtype NotificationMessage = NotificationMessage EvaluatedNotifications
195+data NotificationMessage = NotificationMessage EvaluatedNotifications
195196 deriving (Eq, Show, Generic)
196197 deriving Serialise via WineryVariant NotificationMessage
197198
@@ -206,8 +207,8 @@ data EvaluatedNotification = EvaluatedNotification {
206207
207208
208209-- | Use this for connecting to remote servers on the default port.
209−defaultServerPort :: ServiceName
210−defaultServerPort = "6543"
210+defaultServerPort :: Port
211+defaultServerPort = 6543
211212
212213-- | Use this for connecting to remote servers with the default database name.
213214defaultDatabaseName :: DatabaseName
@@ -220,7 +221,7 @@ defaultHeadName = "master"
220221-- | Create a connection configuration which connects to the localhost on the default server port and default server database name. The configured notification callback is set to ignore all events.
221222defaultRemoteConnectionInfo :: ConnectionInfo
222223defaultRemoteConnectionInfo =
223− RemoteConnectionInfo defaultDatabaseName defaultServerHostname defaultServerPort emptyNotificationCallback
224+ RemoteConnectionInfo defaultDatabaseName defaultServerHostname (show defaultServerPort) emptyNotificationCallback
224225
225226defaultServerHostname :: Hostname
226227defaultServerHostname = "localhost"
@@ -286,8 +287,14 @@ connectProjectM36 (RemoteConnectionInfo dbName hostName servicePort notification
286287 addrInfo:_ -> do
287288 --supports IPv4 only for now
288289 let (SockAddrInet port addr) = addrAddress addrInfo
290+ notificationHandlers =
291+ [RPC.ClientAsyncRequestHandler $
292+ \(NotificationMessage notifications') ->
293+ forM_ (M.toList notifications') (\(notName, notInfo) ->
294+ notificationCallback notName notInfo)
295+ ]
289296-- TODO missing async callback
290− conn <- RPC.connect [] (hostAddressToTuple addr) port
297+ conn <- RPC.connect notificationHandlers (hostAddressToTuple addr) port
291298 eRet <- RPC.call conn (Login dbName)
292299-- TODO handle connection errors
293300 case eRet of
@@ -296,18 +303,6 @@ connectProjectM36 (RemoteConnectionInfo dbName hostName servicePort notification
296303 Right True ->
297304 --TODO handle connection errors!
298305 pure (Right (RemoteConnection (RemoteConnectionConf conn)))
299− {-
300− mServerProcessId <- whereisRemote serverNodeId dbName
301− case mServerProcessId of
302− Nothing -> liftIO $ putMVar connStatus $ Left (NoSuchDatabaseByNameError databaseName)
303− Just serverProcessId -> do
304− loginConfirmation <- safeLogin (Login notificationListenerPid) serverProcessId
305− if not loginConfirmation then
306− liftIO $ putMVar connStatus (Left LoginError)
307− else
308− liftIO $ putMVar connStatus (Right $ RemoteProcessConnection RemoteProcessConnectionConf {rConn = )
309− takeMVar connStatus
310−-}
311306
312307addClientNode :: DatabaseName ->Connection -> RPC.Locking Socket -> IO ()
313308addClientNode _ (RemoteConnection _) _ = error "addClientNode called on remote connection"
@@ -771,13 +766,11 @@ commit :: SessionId -> Connection -> IO (Either RelationalError ())
771766commit sessionId conn@(InProcessConnection _) = executeGraphExpr sessionId conn Commit
772767commit sessionId conn@(RemoteConnection _) = remoteCall conn (ExecuteGraphExpr sessionId Commit)
773768
774−{-
775−sendNotifications :: EvaluatedNotifications -> IO ()
776−sendNotifications nots = mapM_ sendNots pids
777− where
778− sendNots remoteClientPid =
779− unless (M.null nots) $ runProcess localNode $ send remoteClientPid (NotificationMessage nots)
780− -}
769+sendNotifications :: [ClientInfo] -> EvaluatedNotifications -> IO ()
770+sendNotifications clients notifs =
771+ unless (M.null notifs) $
772+ forM_ (map clientSocket clients) $ \sock -> RPC.sendMessage sock (NotificationMessage notifs)
773+
781774-- | Discard any changes made in the current 'Session' and 'DatabaseContext'. This resets the disconnected transaction to reference the original database context of the parent transaction and is a very cheap operation.
782775rollback :: SessionId -> Connection -> IO (Either RelationalError ())
783776rollback sessionId conn@(InProcessConnection _) = executeGraphExpr sessionId conn Rollback
@@ -1076,7 +1069,7 @@ commitLock_ sessionId conf stmBlock = do
10761069 Right (notsToFire, nodesToNotify, newGraph, transactionIdsToPersist) -> do
10771070 --update filesystem database, if necessary
10781071 processTransactionGraphPersistence strat transactionIdsToPersist newGraph
1079− --sendNotifications nodesToNotify (ipLocalNode conf) notsToFire
1072+ sendNotifications nodesToNotify notsToFire
10801073 pure (Right ())
10811074{-
10821075writeDisconAndGraph_ :: TVar TransactionGraph -> SessionId -> Session -> Sessions -> DisconnectedTransaction -> TransactionGraph -> STM ()
src/lib/ProjectM36/Server.hs+146−40
@@ -6,56 +6,121 @@ import ProjectM36.Server.EntryPoints
66import ProjectM36.Server.RemoteCallTypes
77import ProjectM36.Server.Config (ServerConfig(..))
88import ProjectM36.FSType
9−import ProjectM36.Server.Types
109
11−import Control.Monad.IO.Class (liftIO)
12−import Control.Concurrent.MVar (putMVar, MVar)
10+import Control.Concurrent.MVar (MVar)
1311import System.IO (stderr, hPutStrLn)
1412import System.FilePath (takeDirectory)
1513import System.Directory (doesDirectoryExist)
1614import Network.RPC.Curryer.Server
1715import Network.Socket
1816import qualified StmContainers.Map as StmMap
17+import Control.Concurrent.STM
1918
2019-- the state should be a mapping of remote connection to the disconnected transaction- the graph should be the same, so discon must be removed from the stm tuple
2120--trying to refactor this for less repetition is very challenging because the return type cannot be polymorphic or the distributed-process call gets confused and drops messages
2221type TestMode = Bool
2322
2423requestHandlers :: TestMode -> Maybe Timeout -> RequestHandlers ServerState
25−requestHandlers testBool ti =
24+requestHandlers testFlag ti =
2625 [
27− RequestHandler $ \conn (ExecuteHeadName sessionId) -> handleExecuteHeadName ti sessionId conn,
28− RequestHandler (\conn (ExecuteRelationalExpr sessionId expr) -> handleExecuteRelationalExpr ti sessionId conn expr),
29− RequestHandler (\conn (ExecuteDataFrameExpr sessionId expr) -> handleExecuteDataFrameExpr ti sessionId conn expr),
30− RequestHandler (\conn (ExecuteDatabaseContextExpr sessionId expr) -> handleExecuteDatabaseContextExpr ti sessionId conn expr),
31− RequestHandler (\conn (ExecuteDatabaseContextIOExpr sessionId expr) -> handleExecuteDatabaseContextIOExpr ti sessionId conn expr),
32− RequestHandler (\conn (ExecuteGraphExpr sessionId expr) -> handleExecuteGraphExpr ti sessionId conn expr),
33− RequestHandler (\conn (ExecuteTransGraphRelationalExpr sessionId expr) -> handleExecuteTransGraphRelationalExpr ti sessionId conn expr),
34− RequestHandler (\conn (ExecuteTypeForRelationalExpr sessionId expr) -> handleExecuteTypeForRelationalExpr ti sessionId conn expr),
35− RequestHandler (\conn (RetrieveInclusionDependencies sessionId) -> handleRetrieveInclusionDependencies ti sessionId conn),
36− RequestHandler (\conn (RetrievePlanForDatabaseContextExpr sessionId dbExpr) -> handleRetrievePlanForDatabaseContextExpr ti sessionId conn dbExpr),
37− RequestHandler (\conn (RetrieveHeadTransactionId sessionId) -> handleRetrieveHeadTransactionId ti sessionId conn),
38− RequestHandler (\conn (RetrieveTransactionGraph sessionId) -> handleRetrieveTransactionGraph ti sessionId conn),
39− RequestHandler (\conn (Login dbName) -> handleLogin dbName ti conn),
40− RequestHandler (\conn (CreateSessionAtHead headn) -> handleCreateSessionAtHead ti conn headn),
41− RequestHandler (\conn (CreateSessionAtCommit commitId) -> handleCreateSessionAtCommit ti conn commitId),
42− RequestHandler (\conn (CloseSession sessionId) -> handleCloseSession ti sessionId conn),
43− RequestHandler (\conn (RetrieveAtomTypesAsRelation sessionId) -> handleRetrieveAtomTypesAsRelation ti sessionId conn),
44− RequestHandler (\conn (RetrieveRelationVariableSummary sessionId) -> handleRetrieveRelationVariableSummary ti sessionId conn),
45− RequestHandler (\conn (RetrieveAtomFunctionSummary sessionId) -> handleRetrieveAtomFunctionSummary ti sessionId conn),
46− RequestHandler (\conn (RetrieveDatabaseContextFunctionSummary sessionId) -> handleRetrieveDatabaseContextFunctionSummary ti sessionId conn),
47− RequestHandler (\conn (RetrieveCurrentSchemaName sessionId) -> handleRetrieveCurrentSchemaName ti sessionId conn),
48− RequestHandler (\conn (ExecuteSchemaExpr sessionId schemaExpr) -> handleExecuteSchemaExpr ti sessionId conn schemaExpr),
49− RequestHandler (\conn (RetrieveSessionIsDirty sessionId) -> handleRetrieveSessionIsDirty ti sessionId conn),
50− RequestHandler (\conn (ExecuteAutoMergeToHead sessionId strat headName') -> handleExecuteAutoMergeToHead ti sessionId conn strat headName'),
51− RequestHandler (\conn (RetrieveTypeConstructorMapping sessionId) -> handleRetrieveTypeConstructorMapping ti sessionId conn),
52− RequestHandler (\conn (ExecuteValidateMerkleHashes sessionId) -> handleValidateMerkleHashes ti sessionId conn),
53− RequestHandler (\conn Logout -> handleLogout ti conn)
54− ] ++ if testMode then testModeHandlers else []
55−
26+ RequestHandler (\sState (Login dbName) -> do
27+ addClientLogin dbName sState
28+ conn <- getConn sState
29+ handleLogin dbName conn (connectionSocket sState)),
30+ RequestHandler (\sState Logout -> do
31+ conn <- getConn sState
32+ handleLogout ti conn),
33+ RequestHandler $ \sState (ExecuteHeadName sessionId) -> do
34+ --socket -> dbname --maybe create a socket->client state mapping in the server state, too
35+ conn <- getConn sState
36+ handleExecuteHeadName ti sessionId conn,
37+ RequestHandler (\sState (ExecuteRelationalExpr sessionId expr) -> do
38+ conn <- getConn sState
39+ handleExecuteRelationalExpr ti sessionId conn expr),
40+ RequestHandler (\sState (ExecuteDataFrameExpr sessionId expr) -> do
41+ conn <- getConn sState
42+ handleExecuteDataFrameExpr ti sessionId conn expr),
43+ RequestHandler (\sState (ExecuteDatabaseContextExpr sessionId expr) -> do
44+ conn <- getConn sState
45+ handleExecuteDatabaseContextExpr ti sessionId conn expr),
46+ RequestHandler (\sState (ExecuteDatabaseContextIOExpr sessionId expr) -> do
47+ conn <- getConn sState
48+ handleExecuteDatabaseContextIOExpr ti sessionId conn expr),
49+ RequestHandler (\sState (ExecuteGraphExpr sessionId expr) -> do
50+ conn <- getConn sState
51+ handleExecuteGraphExpr ti sessionId conn expr),
52+ RequestHandler (\sState (ExecuteTransGraphRelationalExpr sessionId expr) -> do
53+ conn <- getConn sState
54+ handleExecuteTransGraphRelationalExpr ti sessionId conn expr),
55+ RequestHandler (\sState (ExecuteTypeForRelationalExpr sessionId expr) -> do
56+ conn <- getConn sState
57+ handleExecuteTypeForRelationalExpr ti sessionId conn expr),
58+ RequestHandler (\sState (RetrieveInclusionDependencies sessionId) -> do
59+ conn <- getConn sState
60+ handleRetrieveInclusionDependencies ti sessionId conn),
61+ RequestHandler (\sState (RetrievePlanForDatabaseContextExpr sessionId dbExpr) -> do
62+ conn <- getConn sState
63+ handleRetrievePlanForDatabaseContextExpr ti sessionId conn dbExpr),
64+ RequestHandler (\sState (RetrieveHeadTransactionId sessionId) -> do
65+ conn <- getConn sState
66+ handleRetrieveHeadTransactionId ti sessionId conn),
67+ RequestHandler (\sState (RetrieveTransactionGraph sessionId) -> do
68+ conn <- getConn sState
69+ handleRetrieveTransactionGraph ti sessionId conn),
70+ RequestHandler (\sState (CreateSessionAtHead headn) -> do
71+ conn <- getConn sState
72+ handleCreateSessionAtHead ti conn headn),
73+ RequestHandler (\sState (CreateSessionAtCommit commitId) -> do
74+ conn <- getConn sState
75+ handleCreateSessionAtCommit ti conn commitId),
76+ RequestHandler (\sState (CloseSession sessionId) -> do
77+ conn <- getConn sState
78+ handleCloseSession sessionId conn),
79+ RequestHandler (\sState (RetrieveAtomTypesAsRelation sessionId) -> do
80+ conn <- getConn sState
81+ handleRetrieveAtomTypesAsRelation ti sessionId conn),
82+ RequestHandler (\sState (RetrieveRelationVariableSummary sessionId) -> do
83+ conn <- getConn sState
84+ handleRetrieveRelationVariableSummary ti sessionId conn),
85+ RequestHandler (\sState (RetrieveAtomFunctionSummary sessionId) -> do
86+ conn <- getConn sState
87+ handleRetrieveAtomFunctionSummary ti sessionId conn),
88+ RequestHandler (\sState (RetrieveDatabaseContextFunctionSummary sessionId) -> do
89+ conn <- getConn sState
90+ handleRetrieveDatabaseContextFunctionSummary ti sessionId conn), RequestHandler (\sState (RetrieveCurrentSchemaName sessionId) -> do
91+ conn <- getConn sState
92+ handleRetrieveCurrentSchemaName ti sessionId conn),
93+ RequestHandler (\sState (ExecuteSchemaExpr sessionId schemaExpr) -> do
94+ conn <- getConn sState
95+ handleExecuteSchemaExpr ti sessionId conn schemaExpr),
96+ RequestHandler (\sState (RetrieveSessionIsDirty sessionId) -> do
97+ conn <- getConn sState
98+ handleRetrieveSessionIsDirty ti sessionId conn),
99+ RequestHandler (\sState (ExecuteAutoMergeToHead sessionId strat headName') -> do
100+ conn <- getConn sState
101+ handleExecuteAutoMergeToHead ti sessionId conn strat headName'),
102+ RequestHandler (\sState (RetrieveTypeConstructorMapping sessionId) -> do
103+ conn <- getConn sState
104+ handleRetrieveTypeConstructorMapping ti sessionId conn),
105+ RequestHandler (\sState (ExecuteValidateMerkleHashes sessionId) -> do
106+ conn <- getConn sState
107+ handleValidateMerkleHashes ti sessionId conn)
108+ ] ++ if testFlag then testModeHandlers ti else []
109+
110+getConn :: ConnectionState ServerState -> IO Connection
111+getConn connState = do
112+ let sock = lockless (connectionSocket connState)
113+ sState = connectionServerState connState
114+ mConn <- connectionForClient sock sState
115+ case mConn of
116+ Nothing -> error "failed to find socket in client map"
117+ Just conn -> pure conn
118+
56119testModeHandlers :: Maybe Timeout -> RequestHandlers ServerState
57−testModeHandlers ti = [RequestHandler (\conn (TestTimeout sessionId) -> handleTestTimeout ti sessionId conn)]
58−
120+testModeHandlers ti = [RequestHandler (\sState (TestTimeout sessionId) -> do
121+ conn <- getConn sState
122+ handleTestTimeout ti sessionId conn)]
123+
59124
60125-- | A notification callback which logs the notification to stderr and does nothing else.
61126loggingNotificationCallback :: NotificationCallback
@@ -81,8 +146,44 @@ checkFSType performCheck strat =
81146checkFSErrorMsg :: String
82147checkFSErrorMsg = "The filesystem does not support journaling so writes may not be crash-safe. Use --disable-fscheck to disable this fatal error."
83148
84−type ServerState = StmMap.Map DatabaseName InProcessConnectionConf
149+-- Sockets do not implement hashable, so we just use their string values as keys
150+type SocketString = String
151+
152+data ServerState =
153+ ServerState {
154+ --map available databases to local database configurations
155+ stateDBMap :: StmMap.Map DatabaseName Connection,
156+ --map clients to database names- after logging in, clients are afixed to specific database names
157+ stateClientMap :: StmMap.Map SocketString DatabaseName
158+ }
85159
160+-- add a client socket to the database mapping
161+addClientLogin :: DatabaseName -> ConnectionState ServerState -> IO ()
162+addClientLogin dbName cState = do
163+ let clientMap = stateClientMap (connectionServerState cState)
164+ sock = lockless (connectionSocket cState)
165+ atomically $ do
166+ mVal <- StmMap.lookup (show sock) clientMap
167+ case mVal of
168+ Nothing -> StmMap.insert dbName (show sock) clientMap
169+ Just _ -> pure () --TODO: throw exception- user already logged in
170+
171+connectionForClient :: Socket -> ServerState -> IO (Maybe Connection)
172+connectionForClient sock sState =
173+ atomically $ do
174+ mdbname <- StmMap.lookup (show sock) (stateClientMap sState)
175+ case mdbname of
176+ Nothing -> pure Nothing
177+ Just dbname ->
178+ StmMap.lookup dbname (stateDBMap sState)
179+
180+initialServerState :: DatabaseName -> Connection -> IO ServerState
181+initialServerState dbName conn =
182+ atomically $ do
183+ dbmap <- StmMap.new
184+ clientMap <- StmMap.new
185+ StmMap.insert conn dbName dbmap
186+ pure (ServerState { stateDBMap = dbmap, stateClientMap = clientMap })
86187-- | A synchronous function to start the project-m36 daemon given an appropriate 'ServerConfig'. Note that this function only returns if the server exits. Returns False if the daemon exited due to an error. If the second argument is not Nothing, the port is put after the server is ready to service the port.
87188launchServer :: ServerConfig -> Maybe (MVar SockAddr) -> IO Bool
88189launchServer daemonConfig mAddr = do
@@ -98,7 +199,8 @@ launchServer daemonConfig mAddr = do
98199 pure False
99200 Right conn -> do
100201 let hostname = bindHost daemonConfig
101− port = bindPort daemonConfig
202+ port = fromIntegral (bindPort daemonConfig)
203+
102204
103205 --curryer only supports IPv4 for now
104206 let addrHints = defaultHints { addrSocketType = Stream, addrFamily = AF_INET }
@@ -107,7 +209,11 @@ launchServer daemonConfig mAddr = do
107209 [] -> hPutStrLn stderr ("Failed to resolve: " <> hostname) >> pure False
108210 (AddrInfo _ _ _ _ (SockAddrInet _ addr32) _):_ -> do
109211 let hostAddr = hostAddressToTuple addr32
110− initialServerState <- StmMap.newIO @DatabaseName @InProcessConnectionConf
111− serve requestHandlers initialServerState hostAddr port mAddr
112−
212+ mTimeout = fromIntegral <$> case perRequestTimeout daemonConfig of
213+ 0 -> Nothing
214+ v -> Just v
215+
216+ sState <- initialServerState (databaseName daemonConfig) conn
217+ serve (requestHandlers (testMode daemonConfig) mTimeout) sState hostAddr port mAddr
218+ _ -> error "unsupported socket addressing mode (IPv4 only currently)"
113219
src/lib/ProjectM36/Server/ParseArgs.hs+1−1
@@ -50,7 +50,7 @@ parseHostname defHostname = strOption (short 'h' <>
5050 metavar "HOST_NAME" <>
5151 value defHostname)
5252
53−parsePort :: Port -> Parser Port
53+parsePort :: Port -> Parser Port
5454parsePort defPort = option auto (short 'p' <>
5555 long "port" <>
5656 metavar "PORT_NUMBER" <>
src/lib/ProjectM36/Server/Types.hs+1−1
@@ -28,7 +28,7 @@ data InProcessConnectionConf = InProcessConnectionConf {
2828 }
2929
3030-- clients may connect associate one socket with one database
31−data ClientInfo = ClientInfo { databaseName :: DatabaseName,
31+data ClientInfo = ClientInfo { clientDatabaseName :: DatabaseName,
3232 clientSocket :: RPC.Locking Socket }
3333
3434instance Eq ClientInfo where
test/Relation/Atomable.hs+28−15
@@ -1,8 +1,7 @@
11--Test Atomable typeclass which allows users to use existing Haskell datatypes to marshal them to and from the database as ConstructedAtoms.
2−{-# LANGUAGE DeriveGeneric, DeriveAnyClass, OverloadedStrings, TypeApplications #-}
2+{-# LANGUAGE DeriveGeneric, DeriveAnyClass, OverloadedStrings, TypeApplications, DerivingVia #-}
33import Test.HUnit
44import ProjectM36.Client
5−import Data.Binary
65import Control.DeepSeq
76import System.Exit
87import TutorialD.Interpreter.TestBase
@@ -13,52 +12,65 @@ import Data.Time.Calendar (fromGregorian)
1312import Data.Text
1413import qualified Data.Map as M
1514import Data.Proxy
15+import Codec.Winery
1616
1717{-# ANN module ("Hlint: ignore Use newtype instead of data" :: String) #-}
1818data Test1T = Test1C Integer
19− deriving (Generic, Show, Eq, Binary, NFData, Atomable)
19+ deriving (Generic, Show, Eq, NFData, Atomable)
20+ deriving Serialise via WineryVariant Test1T
2021
2122data Test2T x = Test2C x
22− deriving (Show, Generic, Eq, Binary, NFData, Atomable)
23+ deriving (Show, Generic, Eq, NFData, Atomable)
24+ deriving Serialise via WineryVariant (Test2T x)
2325
2426data Test3T = Test3C Integer Integer
25− deriving (Show, Generic, Eq, Binary, NFData, Atomable)
27+ deriving (Show, Generic, Eq, NFData, Atomable)
28+ deriving Serialise via WineryVariant Test3T
2629
2730data Test4T = Test4Ca Integer |
2831 Test4Cb Integer
29− deriving (Show, Generic, Eq, Binary, NFData, Atomable)
32+ deriving (Show, Generic, Eq, NFData, Atomable)
33+ deriving Serialise via WineryVariant Test4T
3034
3135data TestListT = TestListC [Integer]
32− deriving (Show, Generic, Eq, Binary, NFData, Atomable)
36+ deriving (Show, Generic, Eq, NFData, Atomable)
37+ deriving Serialise via WineryVariant TestListT
3338
3439data TestNonEmptyT = TestNonEmptyC [Integer]
35− deriving (Show, Generic, Eq, Binary, NFData, Atomable)
40+ deriving (Show, Generic, Eq, NFData, Atomable)
41+ deriving Serialise via WineryVariant TestNonEmptyT
3642
3743data Test5T = Test5C {
3844 con1 :: Integer,
3945 con2 :: Integer
40− } deriving (Show, Generic, Eq, Binary, NFData, Atomable)
46+ } deriving (Show, Generic, Eq, NFData, Atomable)
47+ deriving Serialise via WineryRecord Test5T
4148
4249data Test6T = Test6C (Maybe Integer)
43− deriving (Show, Generic, Eq, Binary, NFData, Atomable)
50+ deriving (Show, Generic, Eq, NFData, Atomable)
51+ deriving Serialise via WineryVariant Test6T
4452
4553data Test7T = Test7C (Either Integer Integer)
46− deriving (Show, Generic, Eq, Binary, NFData, Atomable)
54+ deriving (Show, Generic, Eq, NFData, Atomable)
55+ deriving Serialise via WineryVariant Test7T
4756
4857data Test8T = Test8C Test1T
49− deriving (Show, Generic, Eq, Binary, NFData, Atomable)
58+ deriving (Show, Generic, Eq, NFData, Atomable)
59+ deriving Serialise via WineryVariant Test8T
5060
5161data User = User
5262 { userFirstName :: Text
5363 , userLastName :: Text
54− } deriving (Eq, Ord, Show, Generic, NFData, Binary, Atomable)
64+ } deriving (Eq, Ord, Show, Generic, NFData, Atomable)
65+ deriving Serialise via WineryRecord User
5566
5667data Test9_4T = Test9_4C {
5768 f9_41 :: Int,
5869 f9_42 :: Int,
5970 f9_43 :: Int,
6071 f9_44 :: Int }
61− deriving (Show, Generic, Eq, Binary, NFData, Atomable)
72+ deriving (Show, Generic, Eq, NFData, Atomable)
73+ deriving Serialise via WineryRecord Test9_4T
6274
6375data Test9_5T = Test9_5C {
6476 f9_51 :: Int,
@@ -67,7 +79,8 @@ data Test9_5T = Test9_5C {
6779 f9_54 :: Int,
6880 f9_55 :: Int
6981 }
70− deriving (Show, Generic, Eq, Binary, NFData, Atomable)
82+ deriving (Show, Generic, Eq, NFData, Atomable)
83+ deriving Serialise via WineryRecord Test9_5T
7184
7285main :: IO ()
7386main = do