on master help sign in
compilation checkpoint
f843252AgentM
cabal.project+2−8
@@ -1,18 +1,12 @@
1−-- this is needed for GHC8 until distributed-process-extras is updated on Hackage with increased upper bounds
2packages: project-m36.cabal
1packages: project-m36.cabal
3−allow-newer: distributed-process-extras:time,distributed-process-extras:binary,distributed-process-client-server:binary,distributed-process-client-server:time,distributed-process-async:time,distributed-process-async:binary,distributed-process-extras:stm,distributed-process-extras:containers,network-transport-tcp:containers,distributed-process-client-server:stm,distributed-process-client-server:containers,distributed-process-async:stm,distributed-process-async:containers,distributed-process:hashable,distributed-process-extras:hashable,distributed-process-client-server:hashable,distributed-process-async:hashable
4−
5−--necessary for GHC 8.6 support :/
6−source-repository-package
7− type: git
8− location: https://github.com/agentm/distributed-process.git
9− tag: f352e097fbe494ad648b4e09249f865893ae90a3
10
2
3+--RPC library
11source-repository-package
4source-repository-package
12 type: git
5 type: git
13 location: https://github.com/agentm/curryer.git
6 location: https://github.com/agentm/curryer.git
14 tag: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
7 tag: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
15
8
9+--high-performance streaming library
16source-repository-package
10source-repository-package
17 type: git
11 type: git
18 location: https://github.com/composewell/streamly.git
12 location: https://github.com/composewell/streamly.git
examples/DerivingCustomTupleable.hs+1
@@ -5,6 +5,7 @@ import ProjectM36.Atomable (Atomable)
5import Control.DeepSeq (NFData)
5import Control.DeepSeq (NFData)
6import Data.Text (Text)
6import Data.Text (Text)
7import GHC.Generics (Generic)
7import GHC.Generics (Generic)
8+import Codec.Winery
8
9
9newtype BlogId = BlogId { getBlogId :: Int }
10newtype BlogId = BlogId { getBlogId :: Int }
10 deriving stock (Eq, Ord, Show, Generic)
11 deriving stock (Eq, Ord, Show, Generic)
examples/SimpleClient.hs+1−1
@@ -6,7 +6,7 @@ import Data.Text.IO as TIO
6main :: IO ()
6main :: IO ()
7main = do
7main = do
8 -- 1. create a ConnectionInfo
8 -- 1. create a ConnectionInfo
9− let connInfo = RemoteProcessConnectionInfo "mytestdb" (createNodeId "127.0.0.1" defaultServerPort) emptyNotificationCallback
9+ let connInfo = RemoteConnectionInfo "mytestdb" "127.0.0.1" (show defaultServerPort) emptyNotificationCallback
10 -- 2. conncted to the remote database
10 -- 2. conncted to the remote database
11 eConn <- connectProjectM36 connInfo
11 eConn <- connectProjectM36 connInfo
12 case eConn of
12 case eConn of
examples/blog.hs+4−3
@@ -1,5 +1,5 @@
1-- a simple example of a blog schema
1-- a simple example of a blog schema
2−{-# LANGUAGE DeriveAnyClass, DeriveGeneric, OverloadedStrings, CPP #-}
2+{-# LANGUAGE DeriveAnyClass, DeriveGeneric, OverloadedStrings, CPP, DerivingVia #-}
3
3
4import ProjectM36.Client
4import ProjectM36.Client
5import ProjectM36.Base
5import ProjectM36.Base
@@ -10,7 +10,6 @@ import ProjectM36.Tuple (atomForAttributeName)
10
10
11import Data.Either
11import Data.Either
12import GHC.Generics
12import GHC.Generics
13−import Data.Binary
14import qualified Data.Text as T
13import qualified Data.Text as T
15import qualified Data.Text.Lazy as TL
14import qualified Data.Text.Lazy as TL
16import Data.Time.Clock
15import Data.Time.Clock
@@ -22,6 +21,7 @@ import Data.Monoid
22#endif
21#endif
23import Data.List
22import Data.List
24import Control.Monad (when, forM_)
23import Control.Monad (when, forM_)
24+import Codec.Winery
25
25
26import Web.Scotty as S
26import Web.Scotty as S
27import Text.Blaze.Html5 (h1, h2, h3, p, form, input, (!), toHtml, Html, a, toValue, hr, textarea)
27import Text.Blaze.Html5 (h1, h2, h3, p, form, input, (!), toHtml, Html, a, toValue, hr, textarea)
@@ -52,7 +52,8 @@ data Comment = Comment {
52instance Tupleable Comment
52instance Tupleable Comment
53
53
54data Category = Food | Cats | Photos | Other T.Text -- note that this data type could not be represented by an "enumeration" as found in SQL databases
54data Category = Food | Cats | Photos | Other T.Text -- note that this data type could not be represented by an "enumeration" as found in SQL databases
55− deriving (Atomable, Eq, Show, NFData, Binary, Generic) -- derive Atomable so that values of this type can be stored as a database value
55+ deriving (Atomable, Eq, Show, NFData, Generic) -- derive Atomable so that values of this type can be stored as a database value
56+ deriving Serialise via WineryVariant Category -- derive Serialisable to be able to transmit this data remotely
56
57
57-- add some short-hand error handling- your application should have proper handling
58-- add some short-hand error handling- your application should have proper handling
58handleIOError :: Show e => IO (Either e a) -> IO a
59handleIOError :: Show e => IO (Either e a) -> IO a
examples/hair.hs+3−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE DeriveGeneric, DeriveAnyClass, OverloadedStrings #-}
1+{-# LANGUAGE DeriveGeneric, DeriveAnyClass, OverloadedStrings, DerivingVia #-}
2import ProjectM36.Client
2import ProjectM36.Client
3import ProjectM36.Relation.Show.Term
3import ProjectM36.Relation.Show.Term
4import GHC.Generics
4import GHC.Generics
@@ -7,9 +7,11 @@ import Control.DeepSeq
7import qualified Data.Map as M
7import qualified Data.Map as M
8import qualified Data.Text.IO as TIO
8import qualified Data.Text.IO as TIO
9import Data.Proxy
9import Data.Proxy
10+import Codec.Winery
10
11
11data Hair = Bald | Brown | Blond | OtherColor Text
12data Hair = Bald | Brown | Blond | OtherColor Text
12 deriving (Generic, Show, Eq, NFData, Atomable)
13 deriving (Generic, Show, Eq, NFData, Atomable)
14+ deriving Serialise via WineryVariant Hair
13
15
14main :: IO ()
16main :: IO ()
15main = do
17main = do
examples/out_of_the_tarpit.hs+11−7
@@ -1,5 +1,5 @@
1-- the Out-of-the-Tarpit example in Haskell and Project:M36
1-- the Out-of-the-Tarpit example in Haskell and Project:M36
2−{-# LANGUAGE DeriveAnyClass, DeriveGeneric, OverloadedStrings #-}
2+{-# LANGUAGE DeriveAnyClass, DeriveGeneric, OverloadedStrings, DerivingVia #-}
3import ProjectM36.Client
3import ProjectM36.Client
4import ProjectM36.DataTypes.Primitive
4import ProjectM36.DataTypes.Primitive
5import ProjectM36.Tupleable
5import ProjectM36.Tupleable
@@ -7,11 +7,11 @@ import ProjectM36.Relation
7import ProjectM36.Error
7import ProjectM36.Error
8import Data.Either
8import Data.Either
9import GHC.Generics
9import GHC.Generics
10−import Data.Binary
11import Control.DeepSeq
10import Control.DeepSeq
12import qualified Data.Text as T
11import qualified Data.Text as T
13import Data.Time.Calendar
12import Data.Time.Calendar
14import Data.Proxy
13import Data.Proxy
14+import Codec.Winery
15
15
16--create various database value (atom) types
16--create various database value (atom) types
17type Price = Double
17type Price = Double
@@ -21,16 +21,20 @@ type Name = T.Text
21type Address = T.Text
21type Address = T.Text
22
22
23data RoomType = Kitchen | Bathroom | LivingRoom
23data RoomType = Kitchen | Bathroom | LivingRoom
24− deriving (Generic, Atomable, Eq, Show, Binary, NFData)
24+ deriving (Generic, Atomable, Eq, Show, NFData)
25+ deriving Serialise via WineryVariant RoomType
25
26
26data PriceBand = Low | Medium | High | Premium
27data PriceBand = Low | Medium | High | Premium
27− deriving (Generic, Atomable, Eq, Show, Binary, NFData)
28+ deriving (Generic, Atomable, Eq, Show, NFData)
29+ deriving Serialise via WineryVariant PriceBand
28
30
29data AreaCode = City | Suburban | Rural
31data AreaCode = City | Suburban | Rural
30− deriving (Generic, Atomable, Eq, Show, Binary, NFData)
32+ deriving (Generic, Atomable, Eq, Show, NFData)
33+ deriving Serialise via WineryVariant AreaCode
31
34
32data SpeedBand = VeryFastBand | FastBand | MediumBand | SlowBand
35data SpeedBand = VeryFastBand | FastBand | MediumBand | SlowBand
33− deriving (Generic, Atomable, Eq, Show, Binary, NFData)
36+ deriving (Generic, Atomable, Eq, Show, NFData)
37+ deriving Serialise via WineryVariant SpeedBand
34
38
35main :: IO ()
39main :: IO ()
36main = do
40main = do
@@ -257,4 +261,4 @@ handleIOErrors m = do
257 [] -> pure (rights eErrs)
261 [] -> pure (rights eErrs)
258 errs -> handleError (Left (someErrors errs))
262 errs -> handleError (Left (someErrors errs))
259
263
260−
264+
project-m36.cabal+28−51
@@ -1,6 +1,7 @@
1+Cabal-Version: 2.2
1Name: project-m36
2Name: project-m36
2−Version: 0.8.1
3+Version: 0.9.0
3−License: PublicDomain
4+License: Unlicense
4Build-Type: Simple
5Build-Type: Simple
5Homepage: https://github.com/agentm/project-m36
6Homepage: https://github.com/agentm/project-m36
6Bug-Reports: https://github.com/agentm/project-m36/issues
7Bug-Reports: https://github.com/agentm/project-m36/issues
@@ -8,7 +9,6 @@ Author: AgentM
8Stability: experimental
9Stability: experimental
9Category: Relational Algebra
10Category: Relational Algebra
10Maintainer: agentm@themactionfaction.com
11Maintainer: agentm@themactionfaction.com
11−Cabal-Version: >= 1.10
12Synopsis: Relational Algebra Engine
12Synopsis: Relational Algebra Engine
13Description: A relational algebra engine which can be used to persist and query Haskell data types.
13Description: A relational algebra engine which can be used to persist and query Haskell data types.
14Extra-Source-Files: Changelog.markdown README.markdown
14Extra-Source-Files: Changelog.markdown README.markdown
@@ -34,7 +34,7 @@ Flag haskell-scripting
34 Default: True
34 Default: True
35
35
36Library
36Library
37− Build-Depends: base>=4.8 && < 4.15, ghc-paths, mtl, containers, unordered-containers, hashable, haskeline, directory, MonadRandom, random-shuffle, uuid >= 1.3.12, cassava >= 0.4.5.1 && < 0.6, text, bytestring, deepseq, deepseq-generics, vector, parallel, monad-parallel, exceptions, transformers, gnuplot, filepath, zlib, directory, temporary, stm, time, hashable-time, old-locale, rset, attoparsec, either, base64-bytestring, data-interval, extended-reals, network-transport, aeson >= 1.1, path-pieces, conduit, resourcet, http-api-data, semigroups, QuickCheck, quickcheck-instances, distributed-process-client-server >= 0.2.3, distributed-process >= 0.7.4, distributed-process-extras >= 0.3.2, distributed-process-async >= 0.2.4.1, network-transport-tcp >= 0.6.0, network-transport, list-t, stm-containers >= 0.2.15, foldl, optparse-applicative, Glob, cryptohash-sha256, text-manipulate >= 0.2.0.1 && < 0.3, winery, curryer, network
37+ Build-Depends: base>=4.8 && < 4.15, ghc-paths, mtl, containers, unordered-containers, hashable, haskeline, directory, MonadRandom, random-shuffle, uuid >= 1.3.12, cassava >= 0.4.5.1 && < 0.6, text, bytestring, deepseq, deepseq-generics, vector, parallel, monad-parallel, exceptions, transformers, gnuplot, filepath, zlib, directory, temporary, stm, time, hashable-time, old-locale, rset, attoparsec, either, base64-bytestring, data-interval, extended-reals, network-transport, aeson >= 1.1, path-pieces, conduit, resourcet, http-api-data, semigroups, QuickCheck, quickcheck-instances, list-t, stm-containers >= 0.2.15, foldl, optparse-applicative, Glob, cryptohash-sha256, text-manipulate >= 0.2.0.1 && < 0.3, winery, curryer, network
38 if flag(haskell-scripting)
38 if flag(haskell-scripting)
39 Build-Depends: ghc >= 8.2 && < 8.11
39 Build-Depends: ghc >= 8.2 && < 8.11
40 CPP-Options: -DPM36_HASKELL_SCRIPTING
40 CPP-Options: -DPM36_HASKELL_SCRIPTING
@@ -261,6 +261,13 @@ Executable bigrel
261 if flag(profiler)
261 if flag(profiler)
262 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
262 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
263
263
264+Common commontest
265+ Default-Language: Haskell2010
266+ 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
267+ Default-Extensions: OverloadedStrings
268+ GHC-Options: -Wall -threaded
269+ Hs-Source-Dirs: ./src/bin, ., test/
270+
264Benchmark basic-benchmark
271Benchmark basic-benchmark
265 Default-Language: Haskell2010
272 Default-Language: Haskell2010
266 Default-Extensions: OverloadedStrings
273 Default-Extensions: OverloadedStrings
@@ -273,68 +280,43 @@ Benchmark basic-benchmark
273 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
280 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
274
281
275Test-Suite test-tutoriald
282Test-Suite test-tutoriald
276− Default-Language: Haskell2010
283+ import: commontest
277− Default-Extensions: OverloadedStrings
278 type: exitcode-stdio-1.0
284 type: exitcode-stdio-1.0
279 main-is: test/TutorialD/Interpreter.hs
285 main-is: test/TutorialD/Interpreter.hs
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
281 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
286 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
282− GHC-Options: -Wall -threaded
283− Hs-Source-Dirs: ./src/bin, ., test
284
287
285Test-Suite test-tutoriald-atomfunctionscript
288Test-Suite test-tutoriald-atomfunctionscript
286− Default-Language: Haskell2010
289+ import: commontest
287− Default-Extensions: OverloadedStrings
288 type: exitcode-stdio-1.0
290 type: exitcode-stdio-1.0
289 Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.SchemaOperator
291 Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.SchemaOperator
290 main-is: test/TutorialD/Interpreter/AtomFunctionScript.hs
292 main-is: test/TutorialD/Interpreter/AtomFunctionScript.hs
291− Build-Depends: base, HUnit, project-m36, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline, random, MonadRandom, semigroups, time, parser-combinators
292− GHC-Options: -Wall -threaded
293− Hs-Source-Dirs: ./src/bin, ./test, .
294
293
295Test-Suite test-tutoriald-databasecontextfunctionscript
294Test-Suite test-tutoriald-databasecontextfunctionscript
296− Default-Language: Haskell2010
295+ import: commontest
297− Default-Extensions: OverloadedStrings
298 type: exitcode-stdio-1.0
296 type: exitcode-stdio-1.0
299 Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.SchemaOperator
297 Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.SchemaOperator
300 main-is: test/TutorialD/Interpreter/DatabaseContextFunctionScript.hs
298 main-is: test/TutorialD/Interpreter/DatabaseContextFunctionScript.hs
301− Build-Depends: base, HUnit, project-m36, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline, random, MonadRandom, semigroups, time, parser-combinators
302− GHC-Options: -Wall -threaded
303− Hs-Source-Dirs: ./src/bin, ./test, .
304
299
305Test-Suite test-relation
300Test-Suite test-relation
306− Default-Language: Haskell2010
301+ import: commontest
307− Default-Extensions: OverloadedStrings
308 type: exitcode-stdio-1.0
302 type: exitcode-stdio-1.0
309 main-is: test/Relation/Basic.hs
303 main-is: test/Relation/Basic.hs
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
311− GHC-Options: -Wall -threaded
312
304
313Test-Suite test-static-optimizer
305Test-Suite test-static-optimizer
314− Default-Language: Haskell2010
306+ import: commontest
315− Default-Extensions: OverloadedStrings
316 type: exitcode-stdio-1.0
307 type: exitcode-stdio-1.0
317 main-is: test/Relation/StaticOptimizer.hs
308 main-is: test/Relation/StaticOptimizer.hs
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
319− GHC-Options: -Wall -threaded
320
309
321Test-Suite test-transactiongraph-persist
310Test-Suite test-transactiongraph-persist
322− Default-Language: Haskell2010
311+ import: commontest
323− Default-Extensions: OverloadedStrings
324 type: exitcode-stdio-1.0
312 type: exitcode-stdio-1.0
325 main-is: test/TransactionGraph/Persist.hs
313 main-is: test/TransactionGraph/Persist.hs
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
327 Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.BasicExamples
314 Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.BasicExamples
328− Hs-Source-Dirs: ., ./src/bin
329− GHC-Options: -Wall -threaded
330
315
331Test-Suite test-relation-import-csv
316Test-Suite test-relation-import-csv
332− Default-Language: Haskell2010
317+ import: commontest
333− Default-Extensions: OverloadedStrings
334 type: exitcode-stdio-1.0
318 type: exitcode-stdio-1.0
335 main-is: test/Relation/Import/CSV.hs
319 main-is: test/Relation/Import/CSV.hs
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
337− GHC-Options: -Wall -threaded
338
320
339Test-Suite test-tutoriald-import-tutoriald
321Test-Suite test-tutoriald-import-tutoriald
340 Default-Language: Haskell2010
322 Default-Language: Haskell2010
@@ -390,29 +372,28 @@ Executable Example-SimpleClient
390Executable Example-OutOfTheTarpit
372Executable Example-OutOfTheTarpit
391 Default-Language: Haskell2010
373 Default-Language: Haskell2010
392 Default-Extensions: OverloadedStrings
374 Default-Extensions: OverloadedStrings
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
375+ 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, winery
394 Main-Is: examples/out_of_the_tarpit.hs
376 Main-Is: examples/out_of_the_tarpit.hs
395 GHC-Options: -Wall -threaded
377 GHC-Options: -Wall -threaded
396
378
397Executable Example-Blog
379Executable Example-Blog
398 Default-Language: Haskell2010
380 Default-Language: Haskell2010
399 Default-Extensions: OverloadedStrings
381 Default-Extensions: OverloadedStrings
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
382+ 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, winery
401 Main-Is: examples/blog.hs
383 Main-Is: examples/blog.hs
402 GHC-Options: -Wall -threaded
384 GHC-Options: -Wall -threaded
403
385
404−
405Executable Example-Hair
386Executable Example-Hair
406 Default-Language: Haskell2010
387 Default-Language: Haskell2010
407 Default-Extensions: OverloadedStrings
388 Default-Extensions: OverloadedStrings
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
389+ 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, winery
409 Main-Is: examples/hair.hs
390 Main-Is: examples/hair.hs
410 GHC-Options: -Wall -threaded
391 GHC-Options: -Wall -threaded
411
392
412Executable Example-CustomTupleable
393Executable Example-CustomTupleable
413 Default-Language: Haskell2010
394 Default-Language: Haskell2010
414 Default-Extensions: OverloadedStrings
395 Default-Extensions: OverloadedStrings
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
396+ 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, winery
416 Main-Is: examples/CustomTupleable.hs
397 Main-Is: examples/CustomTupleable.hs
417 GHC-Options: -Wall -threaded
398 GHC-Options: -Wall -threaded
418
399
@@ -422,7 +403,7 @@ Executable Example-DerivingCustomTupleable
422 else
403 else
423 Buildable: False
404 Buildable: False
424 Default-Language: Haskell2010
405 Default-Language: Haskell2010
425− Build-Depends: base, text, deepseq,project-m36
406+ Build-Depends: base, text, deepseq, project-m36, winery
426 Main-Is: examples/DerivingCustomTupleable.hs
407 Main-Is: examples/DerivingCustomTupleable.hs
427 GHC-Options: -Wall -threaded
408 GHC-Options: -Wall -threaded
428
409
@@ -438,7 +419,7 @@ Test-Suite test-scripts
438
419
439Executable project-m36-websocket-server
420Executable project-m36-websocket-server
440 Default-Language: Haskell2010
421 Default-Language: Haskell2010
441− Build-Depends: base, aeson, path-pieces, either, conduit, http-api-data, template-haskell, websockets, aeson, optparse-applicative, project-m36, containers, bytestring, text, vector, uuid, megaparsec, haskeline, mtl, directory, base64-bytestring, random, MonadRandom, time, network-transport-tcp, semigroups, attoparsec, parser-combinators
422+ Build-Depends: base, aeson, path-pieces, either, conduit, http-api-data, template-haskell, websockets, aeson, optparse-applicative, project-m36, containers, bytestring, text, vector, uuid, megaparsec, haskeline, mtl, directory, base64-bytestring, random, MonadRandom, time, network-transport-tcp, semigroups, attoparsec, parser-combinators, network
442 Main-Is: ProjectM36/Server/WebSocket/websocket-server.hs
423 Main-Is: ProjectM36/Server/WebSocket/websocket-server.hs
443 Other-Modules: ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.SchemaOperator
424 Other-Modules: ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.SchemaOperator
444 GHC-Options: -Wall -threaded
425 GHC-Options: -Wall -threaded
@@ -538,13 +519,9 @@ Executable handles
538 HS-Source-Dirs: ./src/bin
519 HS-Source-Dirs: ./src/bin
539 if flag(profiler)
520 if flag(profiler)
540 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
521 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
541−
522+
542Test-Suite test-dataframe
523Test-Suite test-dataframe
543− Default-Language: Haskell2010
524+ import: commontest
544 Main-Is: test/DataFrame.hs
525 Main-Is: test/DataFrame.hs
545− type: exitcode-stdio-1.0
526+ type: exitcode-stdio-1.0
546− 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
527+
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
548− Default-Extensions: OverloadedStrings
549− GHC-Options: -Wall -threaded
550− Hs-Source-Dirs: ./src/bin, ., test/
src/bin/ProjectM36/Server/WebSocket.hs+1−1
@@ -85,7 +85,7 @@ notificationCallback conn notifName evaldNotif = WS.sendTextData conn (encode (o
85
85
86--this creates a new database for each connection- perhaps not what we want (?)
86--this creates a new database for each connection- perhaps not what we want (?)
87createConnection :: WS.Connection -> DatabaseName -> Port -> Hostname -> IO (Either ConnectionError Connection)
87createConnection :: WS.Connection -> DatabaseName -> Port -> Hostname -> IO (Either ConnectionError Connection)
88−createConnection wsconn dbname port host = connectProjectM36 (RemoteConnectionInfo dbname host port (notificationCallback wsconn))
88+createConnection wsconn dbname port host = connectProjectM36 (RemoteConnectionInfo dbname host (show port) (notificationCallback wsconn))
89
89
90sendError :: (ToJSON a) => WS.Connection -> a -> IO ()
90sendError :: (ToJSON a) => WS.Connection -> a -> IO ()
91sendError conn err = WS.sendTextData conn (encode (object ["displayerror" .= err]))
91sendError conn err = WS.sendTextData conn (encode (object ["displayerror" .= err]))
src/bin/ProjectM36/Server/WebSocket/websocket-server.hs+7−10
@@ -5,14 +5,8 @@ import ProjectM36.Server.ParseArgs
5import ProjectM36.Server
5import ProjectM36.Server
6import Control.Concurrent
6import Control.Concurrent
7import qualified Network.WebSockets as WS
7import qualified Network.WebSockets as WS
8−
9−#if MIN_VERSION_network_transport_tcp(0,6,0)
10−import Network.Transport.TCP.Internal (decodeEndPointAddress)
11−#else
12−import Network.Transport.TCP (decodeEndPointAddress)
13−#endif
14−
15import Control.Exception
8import Control.Exception
9+import Network.Socket
16
10
17main :: IO ()
11main :: IO ()
18main = do
12main = do
@@ -26,8 +20,11 @@ main = do
26 serverConfig' = serverConfig {bindPort = 0, bindHost = serverHost}
20 serverConfig' = serverConfig {bindPort = 0, bindHost = serverHost}
27 _ <- forkFinally (launchServer serverConfig' (Just addressMVar) >> pure ()) (either throwIO pure)
21 _ <- forkFinally (launchServer serverConfig' (Just addressMVar) >> pure ()) (either throwIO pure)
28 --wait for server to be listening
22 --wait for server to be listening
29− address <- takeMVar addressMVar
23+ addr <- takeMVar addressMVar
30− let Just (_, serverPort, _) = decodeEndPointAddress address
24+ let port =
25+ case addr of
26+ SockAddrInet port' _ -> fromIntegral port'
27+ _ -> error "unsupported socket address (IPv4 only currently)"
31 --this built-in server is apparently not meant for production use, but it's easier to test than starting up the wai or snap interfaces
28 --this built-in server is apparently not meant for production use, but it's easier to test than starting up the wai or snap interfaces
32− WS.runServer wsHost (fromIntegral wsPort) (websocketProxyServer (read serverPort) serverHost)
29+ WS.runServer wsHost (fromIntegral wsPort) (websocketProxyServer port serverHost)
33
30
src/lib/ProjectM36/Client.hs+1−1
@@ -185,7 +185,7 @@ data RequestTimeoutException = RequestTimeoutException
185
185
186instance Exception RequestTimeoutException
186instance Exception RequestTimeoutException
187
187
188−-- | Construct a 'ConnectionInfo' to describe how to make the 'Connection'. The database can be run within the current process or running remotely via distributed-process.
188+-- | Construct a 'ConnectionInfo' to describe how to make the 'Connection'. The database can be run within the current process or running remotely via RPC.
189data ConnectionInfo = InProcessConnectionInfo PersistenceStrategy NotificationCallback [GhcPkgPath] |
189data ConnectionInfo = InProcessConnectionInfo PersistenceStrategy NotificationCallback [GhcPkgPath] |
190 RemoteConnectionInfo DatabaseName Hostname ServiceName NotificationCallback
190 RemoteConnectionInfo DatabaseName Hostname ServiceName NotificationCallback
191
191
src/lib/ProjectM36/Server.hs−2
@@ -16,8 +16,6 @@ import Network.Socket
16import qualified StmContainers.Map as StmMap
16import qualified StmContainers.Map as StmMap
17import Control.Concurrent.STM
17import Control.Concurrent.STM
18
18
19−-- 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
20−--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
21type TestMode = Bool
19type TestMode = Bool
22
20
23requestHandlers :: TestMode -> Maybe Timeout -> RequestHandlers ServerState
21requestHandlers :: TestMode -> Maybe Timeout -> RequestHandlers ServerState
stack.ghc8.0.yaml+2−4
@@ -9,16 +9,14 @@ packages:
9- '.'
9- '.'
10# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
10# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
11extra-deps:
11extra-deps:
12+- git: https://github.com/agentm/curryer.git
13+ commit: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
12- data-accessor-transformers-0.2.1.7
14- data-accessor-transformers-0.2.1.7
13- data-interval-1.2.0
15- data-interval-1.2.0
14- extended-reals-0.2.1.0
16- extended-reals-0.2.1.0
15- gnuplot-0.5.4.1
17- gnuplot-0.5.4.1
16- text-1.2.2.1
18- text-1.2.2.1
17- aeson-1.2.1.00
19- aeson-1.2.1.00
18−- distributed-process-0.6.6
19−- distributed-process-async-0.2.4
20−- distributed-process-client-server-0.2.3
21−- distributed-process-extras-0.3.2
22- deferred-folds-0.6.12
20- deferred-folds-0.6.12
23- rset-1.0.0
21- rset-1.0.0
24
22
stack.ghc8.2.yaml+3−4
@@ -7,18 +7,17 @@ resolver: lts-11.20
7# Local packages, usually specified by relative directory name
7# Local packages, usually specified by relative directory name
8packages:
8packages:
9- '.'
9- '.'
10+
10# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
11# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
11extra-deps:
12extra-deps:
13+- git: https://github.com/agentm/curryer.git
14+ commit: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
12- data-accessor-transformers-0.2.1.7
15- data-accessor-transformers-0.2.1.7
13- data-interval-1.2.0
16- data-interval-1.2.0
14- extended-reals-0.2.1.0
17- extended-reals-0.2.1.0
15- gnuplot-0.5.4.1
18- gnuplot-0.5.4.1
16- text-1.2.2.1
19- text-1.2.2.1
17- aeson-1.2.1.00
20- aeson-1.2.1.00
18−- distributed-process-0.7.3
19−- distributed-process-async-0.2.4.1
20−- distributed-process-client-server-0.2.3
21−- distributed-process-extras-0.3.2
22- rset-1.0.0
21- rset-1.0.0
23
22
24# Override default flag values for local packages and extra-deps
23# Override default flag values for local packages and extra-deps
stack.ghc8.4.yaml+2−4
@@ -9,12 +9,10 @@ packages:
9- '.'
9- '.'
10# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
10# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
11extra-deps:
11extra-deps:
12+- git: https://github.com/agentm/curryer.git
13+ commit: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
12- data-interval-1.3.0
14- data-interval-1.3.0
13- extended-reals-0.2.3.0
15- extended-reals-0.2.3.0
14−- distributed-process-0.7.4
15−- distributed-process-async-0.2.6
16−- distributed-process-client-server-0.2.5.1
17−- distributed-process-extras-0.3.5
18- rset-1.0.0
16- rset-1.0.0
19- hashable-time-0.2.0.2
17- hashable-time-0.2.0.2
20- network-transport-tcp-0.6.0
18- network-transport-tcp-0.6.0
stack.ghc8.6.yaml+2−6
@@ -9,16 +9,12 @@ packages:
9- '.'
9- '.'
10# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
10# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
11extra-deps:
11extra-deps:
12−- git: https://github.com/haskell-distributed/distributed-process.git
12+- git: https://github.com/agentm/curryer.git
13− commit: 660d554f6acd2dba8b605c84e8fa69e45708bc14
13+ commit: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
14- extended-reals-0.2.3.0
14- extended-reals-0.2.3.0
15- data-interval-2.0.1
15- data-interval-2.0.1
16- stm-containers-1.1.0.4
16- stm-containers-1.1.0.4
17−- distributed-static-0.3.9
18- stm-hamt-1.2.0.4
17- stm-hamt-1.2.0.4
19−- distributed-process-async-0.2.6
20−- distributed-process-client-server-0.2.5.1
21−- distributed-process-extras-0.3.5
22- rset-1.0.0
18- rset-1.0.0
23- hashable-time-0.2.0.2
19- hashable-time-0.2.0.2
24- network-transport-tcp-0.6.0
20- network-transport-tcp-0.6.0
stack.ghc8.8.yaml+2−6
@@ -9,16 +9,12 @@ packages:
9- '.'
9- '.'
10# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
10# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
11extra-deps:
11extra-deps:
12−- git: https://github.com/agentm/distributed-process.git
12+- git: https://github.com/agentm/curryer.git
13− commit: 688a5b96d4b7b36d90c3db676230b2c943604288
13+ commit: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
14- extended-reals-0.2.3.0
14- extended-reals-0.2.3.0
15- data-interval-2.0.1
15- data-interval-2.0.1
16- stm-containers-1.1.0.4
16- stm-containers-1.1.0.4
17−- distributed-static-0.3.9
18- stm-hamt-1.2.0.4
17- stm-hamt-1.2.0.4
19−- distributed-process-async-0.2.6
20−- distributed-process-client-server-0.2.5.1
21−- distributed-process-extras-0.3.5
22- rset-1.0.0
18- rset-1.0.0
23- hashable-time-0.2.0.2
19- hashable-time-0.2.0.2
24- network-transport-tcp-0.7.0
20- network-transport-tcp-0.7.0