on master help sign in
compilation checkpoint

extricated final traces of distributed-process

commitf8432522adaafeae7c32bc2b8b6cb09c00396fc6 authorAgentM <agentm@themactionfaction.com> dateSat 26 Dec 2020, 01:41 (6 years ago) parentdf60608
16 files changed+70−109
cabal.project+2−8 examples/DerivingCustomTupleable.hs+1 examples/SimpleClient.hs+1−1 examples/blog.hs+4−3 examples/hair.hs+3−1 examples/out_of_the_tarpit.hs+11−7 project-m36.cabal+28−51 src/bin/ProjectM36/Server/WebSocket.hs+1−1 src/bin/ProjectM36/Server/WebSocket/websocket-server.hs+7−10 src/lib/ProjectM36/Client.hs+1−1 src/lib/ProjectM36/Server.hs−2 stack.ghc8.0.yaml+2−4 stack.ghc8.2.yaml+3−4 stack.ghc8.4.yaml+2−4 stack.ghc8.6.yaml+2−6 stack.ghc8.8.yaml+2−6
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
21packages: 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
102
3+--RPC library
114source-repository-package
125 type: git
136 location: https://github.com/agentm/curryer.git
147 tag: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
158
9+--high-performance streaming library
1610source-repository-package
1711 type: git
1812 location: https://github.com/composewell/streamly.git
examples/DerivingCustomTupleable.hs+1
@@ -5,6 +5,7 @@ import ProjectM36.Atomable (Atomable)
55import Control.DeepSeq (NFData)
66import Data.Text (Text)
77import GHC.Generics (Generic)
8+import Codec.Winery
89
910newtype BlogId = BlogId { getBlogId :: Int }
1011 deriving stock (Eq, Ord, Show, Generic)
examples/SimpleClient.hs+1−1
@@ -6,7 +6,7 @@ import Data.Text.IO as TIO
66main :: IO ()
77main = do
88 -- 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
1010 -- 2. conncted to the remote database
1111 eConn <- connectProjectM36 connInfo
1212 case eConn of
examples/blog.hs+4−3
@@ -1,5 +1,5 @@
11-- a simple example of a blog schema
2−{-# LANGUAGE DeriveAnyClass, DeriveGeneric, OverloadedStrings, CPP #-}
2+{-# LANGUAGE DeriveAnyClass, DeriveGeneric, OverloadedStrings, CPP, DerivingVia #-}
33
44import ProjectM36.Client
55import ProjectM36.Base
@@ -10,7 +10,6 @@ import ProjectM36.Tuple (atomForAttributeName)
1010
1111import Data.Either
1212import GHC.Generics
13−import Data.Binary
1413import qualified Data.Text as T
1514import qualified Data.Text.Lazy as TL
1615import Data.Time.Clock
@@ -22,6 +21,7 @@ import Data.Monoid
2221#endif
2322import Data.List
2423import Control.Monad (when, forM_)
24+import Codec.Winery
2525
2626import Web.Scotty as S
2727import Text.Blaze.Html5 (h1, h2, h3, p, form, input, (!), toHtml, Html, a, toValue, hr, textarea)
@@ -52,7 +52,8 @@ data Comment = Comment {
5252instance Tupleable Comment
5353
5454data 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
5657
5758-- add some short-hand error handling- your application should have proper handling
5859handleIOError :: 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 #-}
22import ProjectM36.Client
33import ProjectM36.Relation.Show.Term
44import GHC.Generics
@@ -7,9 +7,11 @@ import Control.DeepSeq
77import qualified Data.Map as M
88import qualified Data.Text.IO as TIO
99import Data.Proxy
10+import Codec.Winery
1011
1112data Hair = Bald | Brown | Blond | OtherColor Text
1213 deriving (Generic, Show, Eq, NFData, Atomable)
14+ deriving Serialise via WineryVariant Hair
1315
1416main :: IO ()
1517main = do
examples/out_of_the_tarpit.hs+11−7
@@ -1,5 +1,5 @@
11-- the Out-of-the-Tarpit example in Haskell and Project:M36
2−{-# LANGUAGE DeriveAnyClass, DeriveGeneric, OverloadedStrings #-}
2+{-# LANGUAGE DeriveAnyClass, DeriveGeneric, OverloadedStrings, DerivingVia #-}
33import ProjectM36.Client
44import ProjectM36.DataTypes.Primitive
55import ProjectM36.Tupleable
@@ -7,11 +7,11 @@ import ProjectM36.Relation
77import ProjectM36.Error
88import Data.Either
99import GHC.Generics
10−import Data.Binary
1110import Control.DeepSeq
1211import qualified Data.Text as T
1312import Data.Time.Calendar
1413import Data.Proxy
14+import Codec.Winery
1515
1616--create various database value (atom) types
1717type Price = Double
@@ -21,16 +21,20 @@ type Name = T.Text
2121type Address = T.Text
2222
2323data 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
2526
2627data 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
2830
2931data 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
3134
3235data 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
3438
3539main :: IO ()
3640main = do
@@ -257,4 +261,4 @@ handleIOErrors m = do
257261 [] -> pure (rights eErrs)
258262 errs -> handleError (Left (someErrors errs))
259263
260−
264+
project-m36.cabal+28−51
@@ -1,6 +1,7 @@
1+Cabal-Version: 2.2
12Name: project-m36
2−Version: 0.8.1
3−License: PublicDomain
3+Version: 0.9.0
4+License: Unlicense
45Build-Type: Simple
56Homepage: https://github.com/agentm/project-m36
67Bug-Reports: https://github.com/agentm/project-m36/issues
@@ -8,7 +9,6 @@ Author: AgentM
89Stability: experimental
910Category: Relational Algebra
1011Maintainer: agentm@themactionfaction.com
11−Cabal-Version: >= 1.10
1212Synopsis: Relational Algebra Engine
1313Description: A relational algebra engine which can be used to persist and query Haskell data types.
1414Extra-Source-Files: Changelog.markdown README.markdown
@@ -34,7 +34,7 @@ Flag haskell-scripting
3434 Default: True
3535
3636Library
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
3838 if flag(haskell-scripting)
3939 Build-Depends: ghc >= 8.2 && < 8.11
4040 CPP-Options: -DPM36_HASKELL_SCRIPTING
@@ -261,6 +261,13 @@ Executable bigrel
261261 if flag(profiler)
262262 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
263263
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+
264271Benchmark basic-benchmark
265272 Default-Language: Haskell2010
266273 Default-Extensions: OverloadedStrings
@@ -273,68 +280,43 @@ Benchmark basic-benchmark
273280 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
274281
275282Test-Suite test-tutoriald
276− Default-Language: Haskell2010
277− Default-Extensions: OverloadedStrings
283+ import: commontest
278284 type: exitcode-stdio-1.0
279285 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
281286 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
284287
285288Test-Suite test-tutoriald-atomfunctionscript
286− Default-Language: Haskell2010
287− Default-Extensions: OverloadedStrings
289+ import: commontest
288290 type: exitcode-stdio-1.0
289291 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
290292 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, .
294293
295294Test-Suite test-tutoriald-databasecontextfunctionscript
296− Default-Language: Haskell2010
297− Default-Extensions: OverloadedStrings
295+ import: commontest
298296 type: exitcode-stdio-1.0
299297 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
300298 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, .
304299
305300Test-Suite test-relation
306− Default-Language: Haskell2010
307− Default-Extensions: OverloadedStrings
301+ import: commontest
308302 type: exitcode-stdio-1.0
309303 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
312304
313305Test-Suite test-static-optimizer
314− Default-Language: Haskell2010
315− Default-Extensions: OverloadedStrings
306+ import: commontest
316307 type: exitcode-stdio-1.0
317308 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
320309
321310Test-Suite test-transactiongraph-persist
322− Default-Language: Haskell2010
323− Default-Extensions: OverloadedStrings
311+ import: commontest
324312 type: exitcode-stdio-1.0
325313 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
327314 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
330315
331316Test-Suite test-relation-import-csv
332− Default-Language: Haskell2010
333− Default-Extensions: OverloadedStrings
317+ import: commontest
334318 type: exitcode-stdio-1.0
335319 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
338320
339321Test-Suite test-tutoriald-import-tutoriald
340322 Default-Language: Haskell2010
@@ -390,29 +372,28 @@ Executable Example-SimpleClient
390372Executable Example-OutOfTheTarpit
391373 Default-Language: Haskell2010
392374 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
394376 Main-Is: examples/out_of_the_tarpit.hs
395377 GHC-Options: -Wall -threaded
396378
397379Executable Example-Blog
398380 Default-Language: Haskell2010
399381 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
401383 Main-Is: examples/blog.hs
402384 GHC-Options: -Wall -threaded
403385
404−
405386Executable Example-Hair
406387 Default-Language: Haskell2010
407388 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
409390 Main-Is: examples/hair.hs
410391 GHC-Options: -Wall -threaded
411392
412393Executable Example-CustomTupleable
413394 Default-Language: Haskell2010
414395 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
416397 Main-Is: examples/CustomTupleable.hs
417398 GHC-Options: -Wall -threaded
418399
@@ -422,7 +403,7 @@ Executable Example-DerivingCustomTupleable
422403 else
423404 Buildable: False
424405 Default-Language: Haskell2010
425− Build-Depends: base, text, deepseq,project-m36
406+ Build-Depends: base, text, deepseq, project-m36, winery
426407 Main-Is: examples/DerivingCustomTupleable.hs
427408 GHC-Options: -Wall -threaded
428409
@@ -438,7 +419,7 @@ Test-Suite test-scripts
438419
439420Executable project-m36-websocket-server
440421 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
442423 Main-Is: ProjectM36/Server/WebSocket/websocket-server.hs
443424 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
444425 GHC-Options: -Wall -threaded
@@ -538,13 +519,9 @@ Executable handles
538519 HS-Source-Dirs: ./src/bin
539520 if flag(profiler)
540521 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
541−
522+
542523Test-Suite test-dataframe
543− Default-Language: Haskell2010
524+ import: commontest
544525 Main-Is: test/DataFrame.hs
545− 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
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/
526+ type: exitcode-stdio-1.0
527+
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 (RemoteConnectionInfo dbname host port (notificationCallback wsconn))
88+createConnection wsconn dbname port host = connectProjectM36 (RemoteConnectionInfo dbname host (show port) (notificationCallback wsconn))
8989
9090sendError :: (ToJSON a) => WS.Connection -> a -> IO ()
9191sendError 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
55import ProjectM36.Server
66import Control.Concurrent
77import 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−
158import Control.Exception
9+import Network.Socket
1610
1711main :: IO ()
1812main = do
@@ -26,8 +20,11 @@ main = do
2620 serverConfig' = serverConfig {bindPort = 0, bindHost = serverHost}
2721 _ <- forkFinally (launchServer serverConfig' (Just addressMVar) >> pure ()) (either throwIO pure)
2822 --wait for server to be listening
29− address <- takeMVar addressMVar
30− let Just (_, serverPort, _) = decodeEndPointAddress address
23+ addr <- takeMVar addressMVar
24+ let port =
25+ case addr of
26+ SockAddrInet port' _ -> fromIntegral port'
27+ _ -> error "unsupported socket address (IPv4 only currently)"
3128 --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)
3330
src/lib/ProjectM36/Client.hs+1−1
@@ -185,7 +185,7 @@ data RequestTimeoutException = RequestTimeoutException
185185
186186instance Exception RequestTimeoutException
187187
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.
189189data ConnectionInfo = InProcessConnectionInfo PersistenceStrategy NotificationCallback [GhcPkgPath] |
190190 RemoteConnectionInfo DatabaseName Hostname ServiceName NotificationCallback
191191
src/lib/ProjectM36/Server.hs−2
@@ -16,8 +16,6 @@ import Network.Socket
1616import qualified StmContainers.Map as StmMap
1717import Control.Concurrent.STM
1818
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
2119type TestMode = Bool
2220
2321requestHandlers :: TestMode -> Maybe Timeout -> RequestHandlers ServerState
stack.ghc8.0.yaml+2−4
@@ -9,16 +9,14 @@ packages:
99- '.'
1010# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
1111extra-deps:
12+- git: https://github.com/agentm/curryer.git
13+ commit: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
1214- data-accessor-transformers-0.2.1.7
1315- data-interval-1.2.0
1416- extended-reals-0.2.1.0
1517- gnuplot-0.5.4.1
1618- text-1.2.2.1
1719- 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
2220- deferred-folds-0.6.12
2321- rset-1.0.0
2422
stack.ghc8.2.yaml+3−4
@@ -7,18 +7,17 @@ resolver: lts-11.20
77# Local packages, usually specified by relative directory name
88packages:
99- '.'
10+
1011# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
1112extra-deps:
13+- git: https://github.com/agentm/curryer.git
14+ commit: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
1215- data-accessor-transformers-0.2.1.7
1316- data-interval-1.2.0
1417- extended-reals-0.2.1.0
1518- gnuplot-0.5.4.1
1619- text-1.2.2.1
1720- 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
2221- rset-1.0.0
2322
2423# Override default flag values for local packages and extra-deps
stack.ghc8.4.yaml+2−4
@@ -9,12 +9,10 @@ packages:
99- '.'
1010# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
1111extra-deps:
12+- git: https://github.com/agentm/curryer.git
13+ commit: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
1214- data-interval-1.3.0
1315- 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
1816- rset-1.0.0
1917- hashable-time-0.2.0.2
2018- network-transport-tcp-0.6.0
stack.ghc8.6.yaml+2−6
@@ -9,16 +9,12 @@ packages:
99- '.'
1010# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
1111extra-deps:
12−- git: https://github.com/haskell-distributed/distributed-process.git
13− commit: 660d554f6acd2dba8b605c84e8fa69e45708bc14
12+- git: https://github.com/agentm/curryer.git
13+ commit: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
1414- extended-reals-0.2.3.0
1515- data-interval-2.0.1
1616- stm-containers-1.1.0.4
17−- distributed-static-0.3.9
1817- 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
2218- rset-1.0.0
2319- hashable-time-0.2.0.2
2420- network-transport-tcp-0.6.0
stack.ghc8.8.yaml+2−6
@@ -9,16 +9,12 @@ packages:
99- '.'
1010# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
1111extra-deps:
12−- git: https://github.com/agentm/distributed-process.git
13− commit: 688a5b96d4b7b36d90c3db676230b2c943604288
12+- git: https://github.com/agentm/curryer.git
13+ commit: 1e60c0580ca33d6ae1e97aaddc32189fdfe3ef6c
1414- extended-reals-0.2.3.0
1515- data-interval-2.0.1
1616- stm-containers-1.1.0.4
17−- distributed-static-0.3.9
1817- 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
2218- rset-1.0.0
2319- hashable-time-0.2.0.2
2420- network-transport-tcp-0.7.0