on master help sign in
WIP more librarization work
commit0a5ee8bb8066dfce89b1277212e1048a6864defb authorAgentM <agentm@themactionfaction.com> dateSun 21 Aug 2016, 11:23 (10 years ago) parentaed8762
14 files changed+87−265
examples/PersistClient.hs−1 project-m36.cabal+22−197 src/lib/ProjectM36/Client/Json.hs → src/bin/ProjectM36/Client/Json.hs src/lib/ProjectM36/Server/RemoteCallTypes/Json.hs → src/bin/ProjectM36/Server/RemoteCallTypes/Json.hs src/lib/ProjectM36/Server/WebSocket.hs → src/bin/ProjectM36/Server/WebSocket.hs src/lib/ProjectM36/Server/WebSocket/project-m36.js → src/bin/ProjectM36/Server/WebSocket/project-m36.js src/lib/ProjectM36/Server/WebSocket/websocket-client.html → src/bin/ProjectM36/Server/WebSocket/websocket-client.html src/lib/ProjectM36/Server/WebSocket/websocket-client.js → src/bin/ProjectM36/Server/WebSocket/websocket-client.js src/lib/ProjectM36/Server/WebSocket/Main.hs → src/bin/ProjectM36/Server/WebSocket/websocket-server.hs src/lib/ProjectM36/Server/project-m36-server.hs → src/bin/ProjectM36/Server/project-m36-server.hs benchmark/Relation.hs → src/bin/benchmark/Relation.hs benchmark/bigrel.hs → src/bin/benchmark/bigrel.hs+1−1 Database/Persist/ProjectM36.hs → src/persistent/Database/Persist/ProjectM36.hs test/TutorialD/Interpreter.hs+64−66
examples/PersistClient.hs−1
@@ -3,7 +3,6 @@
33{- A simple example of using the persistent-ProjectM36 driver. -}
44import Database.Persist.ProjectM36 hiding (executeDatabaseContextExpr)
55import ProjectM36.Client
6−import ProjectM36.DataTypes.Primitive
76import System.Exit
87import System.IO
98import Database.Persist
project-m36.cabal+22−197
@@ -67,6 +67,7 @@ Library
6767 ,distributed-process
6868 ,stm-containers
6969 ,list-t
70+ ,optparse-applicative
7071 Exposed-Modules: ProjectM36.Error,
7172 ProjectM36.Transaction,
7273 ProjectM36.TransactionGraph,
@@ -105,6 +106,10 @@ Library
105106 ProjectM36.MiscUtils,
106107 ProjectM36.Notifications,
107108 ProjectM36.Relation,
109+ ProjectM36.Server,
110+ ProjectM36.Server.Config,
111+ ProjectM36.Server.EntryPoints,
112+ ProjectM36.Server.ParseArgs,
108113 ProjectM36.Server.RemoteCallTypes,
109114 ProjectM36.Session,
110115 ProjectM36.Sessions,
@@ -128,7 +133,7 @@ Executable tutd
128133 Build-Depends: base >=4.8 && <4.9,
129134 ghc >= 7.8 && <= 8.0.1,
130135 ghc-paths,
131− project-m36,
136+ project-m36 == 0.1,
132137 containers,
133138 unordered-containers,
134139 hashable,
@@ -201,6 +206,7 @@ Executable project-m36-server
201206 Build-Depends: base,
202207 ghc >= 7.8 && <= 8.0.1,
203208 ghc-paths,
209+ project-m36 == 0.1,
204210 distributed-process-client-server,
205211 distributed-process-extras,
206212 distributed-process-async,
@@ -234,126 +240,37 @@ Executable project-m36-server
234240 stm-containers,
235241 list-t,
236242 base64-bytestring
237− Main-Is: ProjectM36/Server/project-m36-server.hs
243+ Main-Is: ./src/bin/ProjectM36/Server/project-m36-server.hs
238244 CPP-Options: -DPROJECTM36_VERSION="v0.1"
239245 GHC-Options: -Wall -threaded -rtsopts
240246 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
241247 Default-Language: Haskell2010
242248 Default-Extensions: OverloadedStrings
243− Other-Modules: ProjectM36.Atom,
244− ProjectM36.AtomFunction,
245− ProjectM36.AtomFunctions.Basic,
246− ProjectM36.AtomFunctions.Primitive,
247− ProjectM36.AtomType,
248− ProjectM36.Attribute,
249− ProjectM36.AttributeNames,
250− ProjectM36.Base,
251− ProjectM36.Client,
252− ProjectM36.ConcreteTypeRep,
253− ProjectM36.DataConstructorDef,
254− ProjectM36.DataTypes.Basic,
255− ProjectM36.DataTypes.Day,
256− ProjectM36.DataTypes.Either,
257− ProjectM36.DataTypes.Maybe,
258− ProjectM36.DataTypes.Primitive,
259− ProjectM36.DatabaseContext,
260− ProjectM36.Error,
261− ProjectM36.MiscUtils,
262− ProjectM36.Notifications,
263− ProjectM36.Persist,
264− ProjectM36.Relation,
265− ProjectM36.RelationalExpression,
266− ProjectM36.Server,
267− ProjectM36.Server.Config,
268− ProjectM36.Server.EntryPoints,
269− ProjectM36.Server.ParseArgs,
270− ProjectM36.Server.RemoteCallTypes,
271− ProjectM36.Session,
272− ProjectM36.Sessions,
273− ProjectM36.StaticOptimizer,
274− ProjectM36.Transaction,
275− ProjectM36.Transaction.Persist,
276− ProjectM36.TransactionGraph,
277− ProjectM36.TransactionGraph.Persist,
278− ProjectM36.TransactionGraph.Merge,
279− ProjectM36.Tuple,
280− ProjectM36.TupleSet,
281− ProjectM36.TypeConstructor,
282− ProjectM36.TypeConstructorDef
283− if os(windows)
284− Build-Depends: Win32 >= 2.3 && < 2.4
285− Other-Modules: ProjectM36.Win32Handle
286− else
287− C-sources: ProjectM36/DirectoryFsync.c
288− Build-Depends: unix
289−
290249
291250Executable bigrel
292251 Default-Language: Haskell2010
293252 Default-Extensions: OverloadedStrings
294− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, optparse-applicative, stm-containers, list-t, ghc, ghc-paths, transformers
295− Other-Modules: ProjectM36.Base,
296− ProjectM36.Relation
297− ProjectM36.Tuple,
298− ProjectM36.Error,
299− ProjectM36.Relation.Show.CSV,
300− ProjectM36.Atom,
301− ProjectM36.AtomFunction,
302− ProjectM36.AtomFunctions.Basic,
303− ProjectM36.AtomFunctions.Primitive,
304− ProjectM36.AtomType,
305− ProjectM36.Attribute,
306− ProjectM36.AttributeNames,
307− ProjectM36.ConcreteTypeRep,
308− ProjectM36.DataConstructorDef,
309− ProjectM36.DataTypes.Basic,
310− ProjectM36.DataTypes.Day,
311− ProjectM36.Relation.Show.Term,
312− ProjectM36.DataTypes.Either,
313− ProjectM36.DataTypes.Maybe,
314− ProjectM36.DataTypes.Primitive,
315− ProjectM36.DatabaseContext,
316− ProjectM36.DateExamples,
317− ProjectM36.Key,
318− ProjectM36.MiscUtils,
319− ProjectM36.Relation.Show.HTML,
320− ProjectM36.RelationalExpression,
321− ProjectM36.StaticOptimizer,
322− ProjectM36.TupleSet,
323− ProjectM36.TypeConstructor,
324− ProjectM36.TypeConstructorDef,
325− TutorialD.Interpreter.Base,
253+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, optparse-applicative, stm-containers, list-t, ghc, ghc-paths, transformers, project-m36 == 0.1
254+ Other-Modules: TutorialD.Interpreter.Base,
326255 TutorialD.Interpreter.DatabaseContextExpr,
327256 TutorialD.Interpreter.RelationalExpr,
328257 TutorialD.Interpreter.Types
329258 main-is: benchmark/bigrel.hs
330259 GHC-Options: -Wall -threaded -rtsopts
331260 CPP-Options: -DPROJECTM36_VERSION="v0.1"
261+ HS-Source-Dirs: ./src/bin
332262 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
333− if os(windows)
334− Build-Depends: Win32 >= 2.3 && < 2.4
335− Other-Modules: ProjectM36.Win32Handle
336− else
337− C-sources: ProjectM36/DirectoryFsync.c
338− Build-Depends: unix
339−
340263
341264Test-Suite test-tutoriald
342265 Default-Language: Haskell2010
343266 Default-Extensions: OverloadedStrings
344267 type: exitcode-stdio-1.0
345268 main-is: test/TutorialD/Interpreter.hs
346− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers, list-t
347− Other-Modules: ProjectM36.Atom, ProjectM36.AtomFunction, ProjectM36.AtomFunctions.Basic, ProjectM36.AtomFunctions.Primitive, ProjectM36.AtomType, ProjectM36.Attribute, ProjectM36.AttributeNames, ProjectM36.Base, ProjectM36.Client, ProjectM36.ConcreteTypeRep, ProjectM36.DataConstructorDef, ProjectM36.DataTypes.Basic, ProjectM36.DataTypes.Day, ProjectM36.DataTypes.Either, ProjectM36.DataTypes.Maybe, ProjectM36.DataTypes.Primitive, ProjectM36.DatabaseContext, ProjectM36.DateExamples, ProjectM36.Error, ProjectM36.Key, ProjectM36.MiscUtils, ProjectM36.Notifications, ProjectM36.Persist, ProjectM36.Relation, ProjectM36.Relation.Parse.CSV, ProjectM36.Relation.Show.CSV, ProjectM36.Relation.Show.Gnuplot, ProjectM36.Relation.Show.Term, ProjectM36.RelationalExpression, ProjectM36.Server.RemoteCallTypes, ProjectM36.Session, ProjectM36.Sessions, ProjectM36.StaticOptimizer, ProjectM36.Transaction, ProjectM36.Transaction.Persist, ProjectM36.TransactionGraph, ProjectM36.TransactionGraph.Persist, ProjectM36.TransactionGraph.Merge, ProjectM36.Tuple, ProjectM36.TupleSet, ProjectM36.TypeConstructor, ProjectM36.TypeConstructorDef, 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
269+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers, list-t, project-m36 == 0.1
270+ 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
348271 GHC-Options: -Wall
272+ Hs-Source-Dirs: ./src/bin, .
349273 CPP-Options: -DPROJECTM36_VERSION="v0.1"
350− if os(windows)
351− Build-Depends: Win32 >= 2.3 && < 2.4
352− Other-Modules: ProjectM36.Win32Handle
353− else
354− C-sources: ProjectM36/DirectoryFsync.c
355− Build-Depends: unix
356−
357274
358275Test-Suite test-relation
359276 Default-Language: Haskell2010
@@ -363,6 +280,7 @@ Test-Suite test-relation
363280 Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
364281 Other-Modules: ProjectM36.Atom, ProjectM36.AtomFunction, ProjectM36.AtomFunctions.Basic, ProjectM36.AtomFunctions.Primitive, ProjectM36.AtomType, ProjectM36.Attribute, ProjectM36.AttributeNames, ProjectM36.Base, ProjectM36.ConcreteTypeRep, ProjectM36.DataConstructorDef, ProjectM36.DataTypes.Basic, ProjectM36.DataTypes.Day, ProjectM36.DataTypes.Either, ProjectM36.DataTypes.Maybe, ProjectM36.DataTypes.Primitive, ProjectM36.DatabaseContext, ProjectM36.DateExamples, ProjectM36.Error, ProjectM36.Key, ProjectM36.MiscUtils, ProjectM36.Relation, ProjectM36.Tuple, ProjectM36.TupleSet, ProjectM36.TypeConstructor, ProjectM36.TypeConstructorDef, ProjectM36.RelationalExpression
365282 GHC-Options: -Wall
283+ Hs-Source-Dirs: ./src/bin
366284 CPP-Options: -DPROJECTM36_VERSION="v0.1"
367285
368286Test-Suite test-static-optimizer
@@ -483,106 +401,19 @@ Test-Suite test-server
483401Executable Example-SimpleClient
484402 Default-Language: Haskell2010
485403 Default-Extensions: OverloadedStrings
486− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, ghc, ghc-paths
404+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, ghc, ghc-paths, project-m36 == 0.1
487405 Main-Is: examples/SimpleClient.hs
488406 GHC-Options: -Wall
489− CPP-Options: -DPROJECTM36_VERSION="v0.1"
490− Other-Modules: ProjectM36.Atom,
491− ProjectM36.AtomFunction,
492− ProjectM36.AtomFunctions.Basic,
493− ProjectM36.AtomFunctions.Primitive,
494− ProjectM36.AtomType,
495− ProjectM36.Attribute,
496− ProjectM36.AttributeNames,
497− ProjectM36.Base,
498− ProjectM36.Client,
499− ProjectM36.ConcreteTypeRep,
500− ProjectM36.DataConstructorDef,
501− ProjectM36.DataTypes.Basic,
502− ProjectM36.DataTypes.Day,
503− ProjectM36.DataTypes.Either,
504− ProjectM36.DataTypes.Maybe,
505− ProjectM36.DataTypes.Primitive,
506− ProjectM36.DatabaseContext,
507− ProjectM36.Error,
508− ProjectM36.MiscUtils,
509− ProjectM36.Notifications,
510− ProjectM36.Persist,
511− ProjectM36.Relation,
512− ProjectM36.Relation.Show.Term,
513− ProjectM36.RelationalExpression,
514− ProjectM36.Server.RemoteCallTypes,
515− ProjectM36.Session,
516− ProjectM36.Sessions,
517− ProjectM36.StaticOptimizer,
518− ProjectM36.Transaction,
519− ProjectM36.Transaction.Persist,
520− ProjectM36.TransactionGraph,
521− ProjectM36.TransactionGraph.Persist,
522− ProjectM36.TransactionGraph.Merge,
523− ProjectM36.Tuple,
524− ProjectM36.TupleSet,
525− ProjectM36.TypeConstructor,
526− ProjectM36.TypeConstructorDef
527− if os(windows)
528− Build-Depends: Win32 >= 2.3 && < 2.4
529− Other-Modules: ProjectM36.Win32Handle
530− else
531− C-sources: ProjectM36/DirectoryFsync.c
532− Build-Depends: unix
533−
534−
535407
536408Executable Example-PersistClient
537409 Default-Language: Haskell2010
538410 Default-Extensions: OverloadedStrings
539− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, persistent, aeson, path-pieces, either, conduit, http-api-data, template-haskell, persistent-template, ghc, ghc-paths
411+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, persistent, aeson, path-pieces, either, conduit, http-api-data, template-haskell, persistent-template, ghc, ghc-paths, project-m36 == 0.1
540412 Main-Is: examples/PersistClient.hs
541413 GHC-Options: -Wall
542414 CPP-Options: -DPROJECTM36_VERSION="v0.1"
543− Other-Modules: Database.Persist.ProjectM36,
544− ProjectM36.Atom,
545− ProjectM36.AtomFunction,
546− ProjectM36.AtomFunctions.Basic,
547− ProjectM36.AtomFunctions.Primitive,
548− ProjectM36.AtomType,
549− ProjectM36.Attribute,
550− ProjectM36.AttributeNames,
551− ProjectM36.Base,
552− ProjectM36.Client,
553− ProjectM36.ConcreteTypeRep,
554− ProjectM36.DataConstructorDef,
555− ProjectM36.DataTypes.Basic,
556− ProjectM36.DataTypes.Day,
557− ProjectM36.DataTypes.Either,
558− ProjectM36.DataTypes.Maybe,
559− ProjectM36.DataTypes.Primitive,
560− ProjectM36.DatabaseContext,
561− ProjectM36.Error,
562− ProjectM36.MiscUtils,
563− ProjectM36.Notifications,
564− ProjectM36.Persist,
565− ProjectM36.Relation,
566− ProjectM36.RelationalExpression,
567− ProjectM36.Server.RemoteCallTypes,
568− ProjectM36.Session,
569− ProjectM36.Sessions,
570− ProjectM36.StaticOptimizer,
571− ProjectM36.Transaction,
572− ProjectM36.Transaction.Persist,
573− ProjectM36.TransactionGraph,
574− ProjectM36.TransactionGraph.Persist,
575− ProjectM36.TransactionGraph.Merge,
576− ProjectM36.Tuple,
577− ProjectM36.TupleSet,
578− ProjectM36.TypeConstructor,
579− ProjectM36.TypeConstructorDef
580− if os(windows)
581− Build-Depends: Win32 >= 2.3 && < 2.4
582− Other-Modules: ProjectM36.Win32Handle
583− else
584− C-sources: ProjectM36/DirectoryFsync.c
585− Build-Depends: unix
415+ Other-Modules: Database.Persist.ProjectM36
416+ Hs-Source-Dirs: ./src/persistent, .
586417
587418Test-Suite test-scripts
588419 Default-Language: Haskell2010
@@ -602,18 +433,12 @@ Test-Suite test-scripts
602433
603434Executable project-m36-websocket-server
604435 Default-Language: Haskell2010
605− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, persistent, aeson, path-pieces, either, conduit, http-api-data, template-haskell, persistent-template, websockets, aeson, uuid-aeson, optparse-applicative, ghc, ghc-paths
606− Other-Modules: ProjectM36.Atom, ProjectM36.AtomFunction, ProjectM36.AtomFunctions.Basic, ProjectM36.AtomFunctions.Primitive, ProjectM36.AtomType, ProjectM36.Attribute, ProjectM36.AttributeNames, ProjectM36.Base, ProjectM36.Client, ProjectM36.Client.Json, ProjectM36.ConcreteTypeRep, ProjectM36.DataConstructorDef, ProjectM36.DataTypes.Basic, ProjectM36.DataTypes.Day, ProjectM36.DataTypes.Either, ProjectM36.DataTypes.Maybe, ProjectM36.DataTypes.Primitive, ProjectM36.DatabaseContext, ProjectM36.DateExamples, ProjectM36.Error, ProjectM36.Key, ProjectM36.MiscUtils, ProjectM36.Notifications, ProjectM36.Persist, ProjectM36.Relation, ProjectM36.Relation.Parse.CSV, ProjectM36.Relation.Show.CSV, ProjectM36.Relation.Show.Gnuplot, ProjectM36.Relation.Show.Term, ProjectM36.RelationalExpression, ProjectM36.Server, ProjectM36.Server.Config, ProjectM36.Server.EntryPoints, ProjectM36.Server.ParseArgs, ProjectM36.Server.RemoteCallTypes, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, ProjectM36.Session, ProjectM36.Sessions, ProjectM36.StaticOptimizer, ProjectM36.Transaction, ProjectM36.Transaction.Persist, ProjectM36.TransactionGraph, ProjectM36.TransactionGraph.Merge, ProjectM36.TransactionGraph.Persist, ProjectM36.Tuple, ProjectM36.TupleSet, ProjectM36.TypeConstructor, ProjectM36.TypeConstructorDef, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, 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
607− Main-Is: ProjectM36/Server/WebSocket/Main.hs
436+ Build-Depends: base, aeson, path-pieces, either, conduit, http-api-data, template-haskell, persistent-template, websockets, aeson, uuid-aeson, optparse-applicative, project-m36 == 0.1, containers, bytestring, text, vector, uuid, parsec, haskeline, mtl, directory, base64-bytestring
437+ Main-Is: ProjectM36/Server/WebSocket/websocket-server.hs
608438 GHC-Options: -Wall
609439 CPP-Options: -DPROJECTM36_VERSION="v0.1"
440+ Hs-Source-Dirs: src/bin
610441 Default-Extensions: OverloadedStrings
611− if os(windows)
612− Build-Depends: Win32 >= 2.3 && < 2.4
613− Other-Modules: ProjectM36.Win32Handle
614− else
615− C-sources: ProjectM36/DirectoryFsync.c
616− Build-Depends: unix
617442
618443Test-Suite test-websocket-server
619444 Default-Language: Haskell2010
src/lib/ProjectM36/Client/Json.hs → src/bin/ProjectM36/Client/Json.hsrenamed

The content is the same.

src/lib/ProjectM36/Server/RemoteCallTypes/Json.hs → src/bin/ProjectM36/Server/RemoteCallTypes/Json.hsrenamed

The content is the same.

src/lib/ProjectM36/Server/WebSocket.hs → src/bin/ProjectM36/Server/WebSocket.hsrenamed

The content is the same.

src/lib/ProjectM36/Server/WebSocket/project-m36.js → src/bin/ProjectM36/Server/WebSocket/project-m36.jsrenamed

The content is the same.

src/lib/ProjectM36/Server/WebSocket/websocket-client.html → src/bin/ProjectM36/Server/WebSocket/websocket-client.htmlrenamed

The content is the same.

src/lib/ProjectM36/Server/WebSocket/websocket-client.js → src/bin/ProjectM36/Server/WebSocket/websocket-client.jsrenamed

The content is the same.

src/lib/ProjectM36/Server/WebSocket/Main.hs → src/bin/ProjectM36/Server/WebSocket/websocket-server.hsrenamed

The content is the same.

src/lib/ProjectM36/Server/project-m36-server.hs → src/bin/ProjectM36/Server/project-m36-server.hsrenamed

The content is the same.

benchmark/Relation.hs → src/bin/benchmark/Relation.hsrenamed

The content is the same.

benchmark/bigrel.hs → src/bin/benchmark/bigrel.hsrenamed+1−1
@@ -1,8 +1,8 @@
11{-# LANGUAGE FlexibleInstances #-}
2+{-# OPTIONS_GHC -fno-warn-orphans #-}
23import ProjectM36.Base
34import ProjectM36.Relation
45import ProjectM36.DateExamples
5−import ProjectM36.DataTypes.Primitive
66import ProjectM36.Error
77import qualified ProjectM36.Attribute as A
88import qualified Data.Text as T
Database/Persist/ProjectM36.hs → src/persistent/Database/Persist/ProjectM36.hsrenamed

The content is the same.

test/TutorialD/Interpreter.hs+64−66
@@ -9,13 +9,11 @@ import ProjectM36.Error
99import ProjectM36.DatabaseContext
1010import ProjectM36.AtomFunctions.Primitive
1111import ProjectM36.DataTypes.Either
12−import ProjectM36.DataTypes.Primitive
1312import ProjectM36.DateExamples
1413import ProjectM36.Base hiding (Finite)
1514import qualified ProjectM36.Base as Base
1615import ProjectM36.TransactionGraph
1716import ProjectM36.Client
18−import ProjectM36.Atom
1917import ProjectM36.Session
2018import qualified ProjectM36.Attribute as A
2119import qualified Data.Map as M
@@ -43,7 +41,7 @@ main = do
4341 ("x:=relation{a Int}{}", mkRelation simpleAAttributes emptyTupleSet),
4442 ("x:=relation{c Int}{} rename {c as d}", mkRelation simpleBAttributes emptyTupleSet),
4543 ("y:=relation{b Int, c Int}{}; x:=y{c}", mkRelation simpleProjectionAttributes emptyTupleSet),
46− ("x:=relation{tuple{a \"spam\", b 5}}", mkRelation simpleCAttributes $ RelationTupleSet [(RelationTuple simpleCAttributes) (V.fromList [textAtom "spam", intAtom 5])]),
44+ ("x:=relation{tuple{a \"spam\", b 5}}", mkRelation simpleCAttributes $ RelationTupleSet [(RelationTuple simpleCAttributes) (V.fromList [TextAtom "spam", IntAtom 5])]),
4745 ("constraint failc true in false; x:=true", Left $ InclusionDependencyCheckError "failc"),
4846 ("x:=y; x:=true", Left $ RelVarNotDefinedError "y"),
4947 ("x:=relation{}{}", Right relationFalse),
@@ -57,74 +55,74 @@ main = do
5755 ("x:=true=true", Right relationTrue),
5856 ("x:=true=false", Right relationFalse),
5957 ("x:=true; undefine x", Left (RelVarNotDefinedError "x")),
60− ("x:=relation {b Int, a Text}{}; insert x relation{tuple{b 5, a \"spam\"}}", mkRelationFromTuples simpleCAttributes [RelationTuple simpleCAttributes $ V.fromList[textAtom "spam", intAtom 5]]),
58+ ("x:=relation {b Int, a Text}{}; insert x relation{tuple{b 5, a \"spam\"}}", mkRelationFromTuples simpleCAttributes [RelationTuple simpleCAttributes $ V.fromList[TextAtom "spam", IntAtom 5]]),
6159 -- test nested relation constructor
62− ("x:=relation{tuple{a 5, b relation{tuple{a 6}}}}", mkRelation nestedRelationAttributes $ RelationTupleSet [RelationTuple nestedRelationAttributes (V.fromList [intAtom 5, Atom (Relation simpleAAttributes $ RelationTupleSet [RelationTuple simpleAAttributes $ V.fromList [intAtom 6]])])]),
63− ("x:=relation{tuple{b 5,a \"spam\"},tuple{b 6,a \"sam\"}}; delete x where b=6", mkRelation simpleCAttributes $ RelationTupleSet [RelationTuple simpleCAttributes (V.fromList [textAtom "spam", intAtom 5])]),
64− ("x:=relation{tuple{a 5}} : {b:=@a}", mkRelation simpleDAttributes $ RelationTupleSet [RelationTuple simpleDAttributes (V.fromList [intAtom 5, intAtom 5])]),
65− ("x:=relation{tuple{a 5}} : {b:=6}", mkRelationFromTuples simpleDAttributes [RelationTuple simpleDAttributes (V.fromList [intAtom 5, intAtom 6])]),
66− ("x:=relation{tuple{a 5}} : {b:=add(@a,5)}", mkRelationFromTuples simpleDAttributes [RelationTuple simpleDAttributes (V.fromList [intAtom 5, intAtom 10])]),
67− ("x:=relation{tuple{a 5}} : {b:=add(@a,\"spam\")}", Left (AtomFunctionTypeError "add" 2 intAtomType textAtomType)),
68− ("x:=relation{tuple{a 5}} : {b:=add(add(@a,2),5)}", mkRelationFromTuples simpleDAttributes [RelationTuple simpleDAttributes (V.fromList [intAtom 5, intAtom 12])])
60+ ("x:=relation{tuple{a 5, b relation{tuple{a 6}}}}", mkRelation nestedRelationAttributes $ RelationTupleSet [RelationTuple nestedRelationAttributes (V.fromList [IntAtom 5, RelationAtom (Relation simpleAAttributes $ RelationTupleSet [RelationTuple simpleAAttributes $ V.fromList [IntAtom 6]])])]),
61+ ("x:=relation{tuple{b 5,a \"spam\"},tuple{b 6,a \"sam\"}}; delete x where b=6", mkRelation simpleCAttributes $ RelationTupleSet [RelationTuple simpleCAttributes (V.fromList [TextAtom "spam", IntAtom 5])]),
62+ ("x:=relation{tuple{a 5}} : {b:=@a}", mkRelation simpleDAttributes $ RelationTupleSet [RelationTuple simpleDAttributes (V.fromList [IntAtom 5, IntAtom 5])]),
63+ ("x:=relation{tuple{a 5}} : {b:=6}", mkRelationFromTuples simpleDAttributes [RelationTuple simpleDAttributes (V.fromList [IntAtom 5, IntAtom 6])]),
64+ ("x:=relation{tuple{a 5}} : {b:=add(@a,5)}", mkRelationFromTuples simpleDAttributes [RelationTuple simpleDAttributes (V.fromList [IntAtom 5, IntAtom 10])]),
65+ ("x:=relation{tuple{a 5}} : {b:=add(@a,\"spam\")}", Left (AtomFunctionTypeError "add" 2 IntAtomType TextAtomType)),
66+ ("x:=relation{tuple{a 5}} : {b:=add(add(@a,2),5)}", mkRelationFromTuples simpleDAttributes [RelationTuple simpleDAttributes (V.fromList [IntAtom 5, IntAtom 12])])
6967 ]
70− simpleAAttributes = A.attributesFromList [Attribute "a" intAtomType]
71− simpleBAttributes = A.attributesFromList [Attribute "d" intAtomType]
72− simpleCAttributes = A.attributesFromList [Attribute "a" textAtomType, Attribute "b" intAtomType]
73− simpleDAttributes = A.attributesFromList [Attribute "a" intAtomType, Attribute "b" intAtomType]
74− maybeTextAtomType = ConstructedAtomType "Maybe" (M.singleton "a" textAtomType)
75− maybeIntAtomType = ConstructedAtomType "Maybe" (M.singleton "a" intAtomType)
68+ simpleAAttributes = A.attributesFromList [Attribute "a" IntAtomType]
69+ simpleBAttributes = A.attributesFromList [Attribute "d" IntAtomType]
70+ simpleCAttributes = A.attributesFromList [Attribute "a" TextAtomType, Attribute "b" IntAtomType]
71+ simpleDAttributes = A.attributesFromList [Attribute "a" IntAtomType, Attribute "b" IntAtomType]
72+ maybeTextAtomType = ConstructedAtomType "Maybe" (M.singleton "a" TextAtomType)
73+ maybeIntAtomType = ConstructedAtomType "Maybe" (M.singleton "a" IntAtomType)
7674 simpleMaybeTextAttributes = A.attributesFromList [Attribute "a" maybeTextAtomType]
7775 simpleMaybeIntAttributes = A.attributesFromList [Attribute "a" maybeIntAtomType]
78− simpleEitherIntTextAttributes = A.attributesFromList [Attribute "a" (eitherAtomType intAtomType textAtomType)]
79− simpleProjectionAttributes = A.attributesFromList [Attribute "c" intAtomType]
80− nestedRelationAttributes = A.attributesFromList [Attribute "a" intAtomType, Attribute "b" (RelationAtomType $ A.attributesFromList [Attribute "a" intAtomType])]
81− extendTestAttributes = A.attributesFromList [Attribute "a" intAtomType, Attribute "b" $ RelationAtomType (attributes suppliersRel)]
82− byteStringAttributes = A.attributesFromList [Attribute "y" byteStringAtomType]
83− groupCountAttrs = A.attributesFromList [Attribute "z" intAtomType]
84− minMaxAttrs = A.attributesFromList [Attribute "s#" textAtomType, Attribute "z" intAtomType]
76+ simpleEitherIntTextAttributes = A.attributesFromList [Attribute "a" (eitherAtomType IntAtomType TextAtomType)]
77+ simpleProjectionAttributes = A.attributesFromList [Attribute "c" IntAtomType]
78+ nestedRelationAttributes = A.attributesFromList [Attribute "a" IntAtomType, Attribute "b" (RelationAtomType $ A.attributesFromList [Attribute "a" IntAtomType])]
79+ extendTestAttributes = A.attributesFromList [Attribute "a" IntAtomType, Attribute "b" $ RelationAtomType (attributes suppliersRel)]
80+ byteStringAttributes = A.attributesFromList [Attribute "y" ByteStringAtomType]
81+ groupCountAttrs = A.attributesFromList [Attribute "z" IntAtomType]
82+ minMaxAttrs = A.attributesFromList [Attribute "s#" TextAtomType, Attribute "z" IntAtomType]
8583 updateParisPlus10 = relMap (\tuple -> do
8684 statusAtom <- atomForAttributeName "status" tuple
8785 cityAtom <- atomForAttributeName "city" tuple
88− if cityAtom == textAtom "Paris" then
89− Right $ updateTupleWithAtoms (M.singleton "status" (intAtom ((castInt statusAtom) + 10))) tuple
86+ if cityAtom == TextAtom "Paris" then
87+ Right $ updateTupleWithAtoms (M.singleton "status" (IntAtom ((castInt statusAtom) + 10))) tuple
9088 else Right tuple) suppliersRel
9189 dateExampleRelTests = [("x:=s where true", Right suppliersRel),
92− ("x:=s where city = \"London\"", restrict (\tuple -> atomForAttributeName "city" tuple == (Right $ textAtom "London")) suppliersRel),
90+ ("x:=s where city = \"London\"", restrict (\tuple -> atomForAttributeName "city" tuple == (Right $ TextAtom "London")) suppliersRel),
9391 ("x:=s where false", Right $ Relation (attributes suppliersRel) emptyTupleSet),
94− ("x:=p where color=\"Blue\" and city=\"Paris\"", mkRelationFromList (attributes productsRel) [[textAtom "P5", textAtom "Cam", textAtom "Blue", intAtom 12, textAtom "Paris"]]),
95− ("a:=s; update a (status:=50); x:=a{status}", mkRelation (A.attributesFromList [Attribute "status" intAtomType]) (RelationTupleSet [mkRelationTuple (A.attributesFromList [Attribute "status" intAtomType]) (V.fromList [intAtom 50])])),
96− ("x:=s minus (s where status=20)", mkRelationFromList (attributes suppliersRel) [[textAtom "S2", textAtom "Jones", intAtom 10, textAtom "Paris"], [textAtom "S3", textAtom "Blake", intAtom 30, textAtom "Paris"], [textAtom "S5", textAtom "Adams", intAtom 30, textAtom "Athens"]]),
92+ ("x:=p where color=\"Blue\" and city=\"Paris\"", mkRelationFromList (attributes productsRel) [[TextAtom "P5", TextAtom "Cam", TextAtom "Blue", IntAtom 12, TextAtom "Paris"]]),
93+ ("a:=s; update a (status:=50); x:=a{status}", mkRelation (A.attributesFromList [Attribute "status" IntAtomType]) (RelationTupleSet [mkRelationTuple (A.attributesFromList [Attribute "status" IntAtomType]) (V.fromList [IntAtom 50])])),
94+ ("x:=s minus (s where status=20)", mkRelationFromList (attributes suppliersRel) [[TextAtom "S2", TextAtom "Jones", IntAtom 10, TextAtom "Paris"], [TextAtom "S3", TextAtom "Blake", IntAtom 30, TextAtom "Paris"], [TextAtom "S5", TextAtom "Adams", IntAtom 30, TextAtom "Athens"]]),
9795 --atom function tests
9896 ("x:=((s : {status2 := add(10,@status)}) where status2=add(10,@status)){city,s#,sname,status}", Right suppliersRel),
99− ("x:=relation{tuple{a 5}} : {b:=s}", mkRelation extendTestAttributes (RelationTupleSet [mkRelationTuple extendTestAttributes (V.fromList [intAtom 5, Atom suppliersRel])])),
100− ("x:=s; update x where sname=\"Blake\" (city:=\"Boston\")", relMap (\tuple -> if atomForAttributeName "sname" tuple == (Right $ textAtom "Blake") then Right $ updateTupleWithAtoms (M.singleton "city" (textAtom "Boston")) tuple else Right tuple) suppliersRel),
97+ ("x:=relation{tuple{a 5}} : {b:=s}", mkRelation extendTestAttributes (RelationTupleSet [mkRelationTuple extendTestAttributes (V.fromList [IntAtom 5, RelationAtom suppliersRel])])),
98+ ("x:=s; update x where sname=\"Blake\" (city:=\"Boston\")", relMap (\tuple -> if atomForAttributeName "sname" tuple == (Right $ TextAtom "Blake") then Right $ updateTupleWithAtoms (M.singleton "city" (TextAtom "Boston")) tuple else Right tuple) suppliersRel),
10199 ("x:=s; update x where city=\"Paris\" (status:=add(@status,10))", updateParisPlus10),
102100 --relatom function tests
103− ("x:=((s group ({city} as y)):{z:=count(@y)}){z}", mkRelation groupCountAttrs (RelationTupleSet [mkRelationTuple groupCountAttrs (V.singleton $ intAtom 1)])),
101+ ("x:=((s group ({city} as y)):{z:=count(@y)}){z}", mkRelation groupCountAttrs (RelationTupleSet [mkRelationTuple groupCountAttrs (V.singleton $ IntAtom 1)])),
104102 ("x:=(sp group ({s#} as y)) ungroup y", Right supplierProductsRel),
105− ("x:=((sp{s#,qty}) group ({qty} as x):{z:=max(@x)}){s#,z}", mkRelationFromList minMaxAttrs (map (\(s,i) -> [textAtom s,intAtom i]) [("S1", 400), ("S2", 400), ("S3", 200), ("S4", 400)])),
106− ("x:=((sp{s#,qty}) group ({qty} as x):{z:=min(@x)}){s#,z}", mkRelationFromList minMaxAttrs (map (\(s,i) -> [textAtom s,intAtom i]) [("S1", 100), ("S2", 300), ("S3", 200), ("S4", 200)])),
107− ("x:=((sp{s#,qty}) group ({qty} as x):{z:=sum(@x)}){s#,z}", mkRelationFromList minMaxAttrs (map (\(s,i) -> [textAtom s,intAtom i]) [("S1", 1000), ("S2", 700), ("S3", 200), ("S4", 900)])),
103+ ("x:=((sp{s#,qty}) group ({qty} as x):{z:=max(@x)}){s#,z}", mkRelationFromList minMaxAttrs (map (\(s,i) -> [TextAtom s,IntAtom i]) [("S1", 400), ("S2", 400), ("S3", 200), ("S4", 400)])),
104+ ("x:=((sp{s#,qty}) group ({qty} as x):{z:=min(@x)}){s#,z}", mkRelationFromList minMaxAttrs (map (\(s,i) -> [TextAtom s,IntAtom i]) [("S1", 100), ("S2", 300), ("S3", 200), ("S4", 200)])),
105+ ("x:=((sp{s#,qty}) group ({qty} as x):{z:=sum(@x)}){s#,z}", mkRelationFromList minMaxAttrs (map (\(s,i) -> [TextAtom s,IntAtom i]) [("S1", 1000), ("S2", 700), ("S3", 200), ("S4", 900)])),
108106 --boolean function restriction
109− ("x:=s where ^lt(@status,20)", mkRelationFromList (attributes suppliersRel) [[textAtom "S2", textAtom "Jones", intAtom 10, textAtom "Paris"]]),
110− ("x:=s where ^gt(@status,20)", mkRelationFromList (attributes suppliersRel) [[textAtom "S3", textAtom "Blake", intAtom 30, textAtom "Paris"],
111− [textAtom "S5", textAtom "Adams", intAtom 30, textAtom "Athens"]]),
112− ("x:=s where ^sum(@status)", Left $ AtomTypeMismatchError intAtomType boolAtomType),
113− ("x:=s where ^not(gte(@status,20))", mkRelationFromList (attributes suppliersRel) [[textAtom "S2", textAtom "Jones", intAtom 10, textAtom "Paris"]]),
107+ ("x:=s where ^lt(@status,20)", mkRelationFromList (attributes suppliersRel) [[TextAtom "S2", TextAtom "Jones", IntAtom 10, TextAtom "Paris"]]),
108+ ("x:=s where ^gt(@status,20)", mkRelationFromList (attributes suppliersRel) [[TextAtom "S3", TextAtom "Blake", IntAtom 30, TextAtom "Paris"],
109+ [TextAtom "S5", TextAtom "Adams", IntAtom 30, TextAtom "Athens"]]),
110+ ("x:=s where ^sum(@status)", Left $ AtomTypeMismatchError IntAtomType BoolAtomType),
111+ ("x:=s where ^not(gte(@status,20))", mkRelationFromList (attributes suppliersRel) [[TextAtom "S2", TextAtom "Jones", IntAtom 10, TextAtom "Paris"]]),
114112 --test "all but" attribute inversion syntax
115113 ("x:=s{all but s#} = s{city,sname,status}", Right $ relationTrue),
116114 --test key syntax
117115 ("x:=s; key testconstraint {s#,city} x; insert x relation{tuple{city \"London\", s# \"S1\", sname \"gonk\", status 50}}", Left (InclusionDependencyCheckError "testconstraint")),
118116 ("y:=s; key testconstraint {s#} y; insert y relation{tuple{city \"London\", s# \"S6\", sname \"gonk\", status 50}}; x:=y{s#} = s{s#} union relation{tuple{s# \"S6\"}}", Right $ relationTrue),
119117 --test binary bytestring data type
120− ("x:=relation{tuple{y makeByteString(\"dGVzdGRhdGE=\")}}", mkRelationFromList byteStringAttributes [[Atom (TE.encodeUtf8 "testdata")]]),
118+ ("x:=relation{tuple{y makeByteString(\"dGVzdGRhdGE=\")}}", mkRelationFromList byteStringAttributes [[ByteStringAtom (TE.encodeUtf8 "testdata")]]),
121119 --test Maybe Text
122− ("x:=relation{tuple{a Just \"spam\"}}", mkRelationFromList simpleMaybeTextAttributes [[ConstructedAtom "Just" maybeTextAtomType [textAtom "spam"]]]),
120+ ("x:=relation{tuple{a Just \"spam\"}}", mkRelationFromList simpleMaybeTextAttributes [[ConstructedAtom "Just" maybeTextAtomType [TextAtom "spam"]]]),
123121 --test Maybe Int
124− ("x:=relation{tuple{a Just 3}}", mkRelationFromList simpleMaybeIntAttributes [[ConstructedAtom "Just" maybeIntAtomType [intAtom 3]]]),
122+ ("x:=relation{tuple{a Just 3}}", mkRelationFromList simpleMaybeIntAttributes [[ConstructedAtom "Just" maybeIntAtomType [IntAtom 3]]]),
125123 --test Either Int Text
126124 ("x:=relation{tuple{a Left 3}}", Left (TypeConstructorTypeVarsMismatch (S.fromList ["a","b"]) (S.fromList ["a"]))), -- Left 3, alone is not enough information to imply the type
127− ("x:=relation{a Either Int Text}{tuple{a Left 3}}", mkRelationFromList simpleEitherIntTextAttributes [[ConstructedAtom "Left" (eitherAtomType intAtomType textAtomType) [intAtom 3]]])
125+ ("x:=relation{a Either Int Text}{tuple{a Left 3}}", mkRelationFromList simpleEitherIntTextAttributes [[ConstructedAtom "Left" (eitherAtomType IntAtomType TextAtomType) [IntAtom 3]]])
128126 ]
129127
130128assertTutdEqual :: DatabaseContext -> Either RelationalError Relation -> String -> Assertion
@@ -215,31 +213,31 @@ transactionBranchTest = TestCase $ do
215213simpleJoinTest :: Test
216214simpleJoinTest = TestCase $ assertTutdEqual dateExamples joinedRel "x:=s join sp"
217215 where
218− attrs = A.attributesFromList [Attribute "city" textAtomType,
219− Attribute "qty" intAtomType,
220− Attribute "p#" textAtomType,
221− Attribute "s#" textAtomType,
222− Attribute "sname" textAtomType,
223− Attribute "status" intAtomType]
224− joinedRel = mkRelationFromList attrs [[textAtom "London", intAtom 100, textAtom "P6", textAtom "S1", textAtom "Smith", intAtom 20],
225− [textAtom "London", intAtom 400, textAtom "P3", textAtom "S1", textAtom "Smith", intAtom 20],
226− [textAtom "London", intAtom 400, textAtom "P5", textAtom "S4", textAtom "Clark", intAtom 20],
227− [textAtom "London", intAtom 300, textAtom "P1", textAtom "S1", textAtom "Smith", intAtom 20],
228− [textAtom "Paris", intAtom 200, textAtom "P2", textAtom "S3", textAtom "Blake", intAtom 30],
229− [textAtom "Paris", intAtom 300, textAtom "P1", textAtom "S2", textAtom "Jones", intAtom 10],
230− [textAtom "London", intAtom 100, textAtom "P5", textAtom "S1", textAtom "Smith", intAtom 20],
231− [textAtom "London", intAtom 300, textAtom "P4", textAtom "S4", textAtom "Clark", intAtom 20],
232− [textAtom "Paris", intAtom 400, textAtom "P2", textAtom "S2", textAtom "Jones", intAtom 10],
233− [textAtom "London", intAtom 200, textAtom "P2", textAtom "S1", textAtom "Smith", intAtom 20],
234− [textAtom "London", intAtom 200, textAtom "P4", textAtom "S1", textAtom "Smith", intAtom 20],
235− [textAtom "London", intAtom 200, textAtom "P2", textAtom "S4", textAtom "Clark", intAtom 20]
216+ attrs = A.attributesFromList [Attribute "city" TextAtomType,
217+ Attribute "qty" IntAtomType,
218+ Attribute "p#" TextAtomType,
219+ Attribute "s#" TextAtomType,
220+ Attribute "sname" TextAtomType,
221+ Attribute "status" IntAtomType]
222+ joinedRel = mkRelationFromList attrs [[TextAtom "London", IntAtom 100, TextAtom "P6", TextAtom "S1", TextAtom "Smith", IntAtom 20],
223+ [TextAtom "London", IntAtom 400, TextAtom "P3", TextAtom "S1", TextAtom "Smith", IntAtom 20],
224+ [TextAtom "London", IntAtom 400, TextAtom "P5", TextAtom "S4", TextAtom "Clark", IntAtom 20],
225+ [TextAtom "London", IntAtom 300, TextAtom "P1", TextAtom "S1", TextAtom "Smith", IntAtom 20],
226+ [TextAtom "Paris", IntAtom 200, TextAtom "P2", TextAtom "S3", TextAtom "Blake", IntAtom 30],
227+ [TextAtom "Paris", IntAtom 300, TextAtom "P1", TextAtom "S2", TextAtom "Jones", IntAtom 10],
228+ [TextAtom "London", IntAtom 100, TextAtom "P5", TextAtom "S1", TextAtom "Smith", IntAtom 20],
229+ [TextAtom "London", IntAtom 300, TextAtom "P4", TextAtom "S4", TextAtom "Clark", IntAtom 20],
230+ [TextAtom "Paris", IntAtom 400, TextAtom "P2", TextAtom "S2", TextAtom "Jones", IntAtom 10],
231+ [TextAtom "London", IntAtom 200, TextAtom "P2", TextAtom "S1", TextAtom "Smith", IntAtom 20],
232+ [TextAtom "London", IntAtom 200, TextAtom "P4", TextAtom "S1", TextAtom "Smith", IntAtom 20],
233+ [TextAtom "London", IntAtom 200, TextAtom "P2", TextAtom "S4", TextAtom "Clark", IntAtom 20]
236234 ]
237235transactionGraph :: Connection -> IO TransactionGraph
238−transactionGraph (InProcessConnection _ _ _ tvar) = atomically $ readTVar tvar
236+transactionGraph (InProcessConnection _ _ _ tvar _) = atomically $ readTVar tvar
239237transactionGraph _ = error "remote connection used"
240238
241239disconnectedTransaction :: SessionId -> Connection -> IO DisconnectedTransaction
242−disconnectedTransaction sessionId (InProcessConnection _ _ sessions _) = do
240+disconnectedTransaction sessionId (InProcessConnection _ _ sessions _ _) = do
243241 mSession <- atomically $ do
244242 STMMap.lookup sessionId sessions
245243 case mSession of
@@ -319,7 +317,7 @@ testMergeTransactions = TestCase $ do
319317 ":commit",
320318 ":mergetrans union branchA branchB"
321319 ]
322− case mkRelationFromList (attributesFromList [Attribute "conflict" intAtomType]) [[intAtom 1],[intAtom 2]] of
320+ case mkRelationFromList (attributesFromList [Attribute "conflict" IntAtomType]) [[IntAtom 1],[IntAtom 2]] of
323321 Left err -> assertFailure (show err)
324322 Right conflictCheck -> do
325323 eRv <- executeRelationalExpr sessionId dbconn (RelationVariable "conflictrv")