on master help sign in
add Changelog and documentation for v0.9.3
commit5b6d3f124d2361e9afe5f8fe8ba99fe7df06d600 authorAgentM <agentm@themactionfaction.com> dateFri 2 Apr 2021, 16:16 (6 years ago) parent3004be0
6 files changed+36−5
Changelog.markdown+4 docs/tutd_cheatsheet.markdown+2 docs/tutd_tutorial.markdown+18 project-m36.cabal+6−5 stack.ghc8.6.yaml+4 stack.ghc8.8.yaml+2
Changelog.markdown+4
@@ -1,3 +1,7 @@
1+# 2021-04-01 (v0.9.3)
2+
3+* add new ":importtutd <URI> <SHA256 hash>" feature to import TutorialD from a local file or a HTTP/HTTPS URI
4+
15# 2020-12-27 (v0.9.0)
26
37* replace unmaintained distributed-process-client-server RPC package with new curryer RPC package
docs/tutd_cheatsheet.markdown+2
@@ -48,6 +48,8 @@ Database context expressions take the current database context as input and alte
4848|Database Context Expression |Description |
4949|------------------------------------------------------|---------------------------------------|
5050|`:importexample cjdate`|Imports a precooked schema from Chris Date's books resulting in relvars `s`, `sp`, and `p`|
51+|`:importtutd "file:///home/agentm/project-m36/scripts/emp.tutd"`|Imports TutorialD from file URI|
52+|`:importtutd "https://raw.githubusercontent.com/agentm/project-m36/master/scripts/emp.tutd" "effe32b247586dc3ac0079fc241b9618d41d189afcaeb7907edbe5a8b45992a4"`| Imports TutorialD from HTTP or HTTPS URI|
5153|`newrelvar:=relation{tuple{age 3}}`|Assign a new relation variable named `newrelvar`|
5254|`undefine s`|Remove a relation variable|
5355|`insert s relation{tuple{city "Boston",s# "S10",sname "Gonzalez",status 10}}`| Append to an existing relation variable with another relational expression|
docs/tutd_tutorial.markdown+18
@@ -30,6 +30,24 @@ Each section assumes a fresh instance of the Date examples. The relation variabl
3030|p|parts|
3131|sp|contains mapping of which suppliers supply which parts|
3232
33+### Importing TutorialD from Other Sources
34+
35+The `tutd` console can also run TutorialD from a local file or from a web server.
36+
37+To import TutorialD from a file:
38+
39+```
40+:importtutd "file:///home/agentm/project-m36/scripts/emp.tutd"
41+```
42+
43+or from a web server:
44+
45+```
46+:importtutd "https://raw.githubusercontent.com/agentm/project-m36/master/scripts/DateExamples.tutd" "db9f3d9fe06d0a29b8355e045b89ec94d6428e3a3de93def7ca77bf0298b7010"
47+```
48+
49+The second argument is an optional SHA256 hash in hexadecimal form. This can be used to validate that the script has not changed since the last import. Importing TutorialD from the web is in general safe because it is effectively sandboxed with "Safe Haskell" for functions, so the script is contained security-wise, however, nothing prevents the script from running forever. Downloading a schema from the web is a great way to share schemas and to kick start your project without starting from scratch.
50+
3351### Types
3452
3553TutorialD is strongly-typed. The basic built-in types are:
project-m36.cabal+6−5
@@ -1,6 +1,6 @@
11Cabal-Version: 2.2
22Name: project-m36
3−Version: 0.9.2
3+Version: 0.9.3
44License: MIT
55--note that this license specification is erroneous and only labeled MIT to appease hackage which does not recognize public domain packages in cabal >2.2- Project:M36 is dedicated to the public domain
66Build-Type: Simple
@@ -35,7 +35,7 @@ Flag haskell-scripting
3535 Default: True
3636
3737Library
38− 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, 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.4, winery, curryer-rpc, network, async, vector-instances, recursion-schemes
38+ 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, 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.4, winery, curryer-rpc, network, async, vector-instances, recursion-schemes, streamly >= 0.7.2
3939 if flag(haskell-scripting)
4040 Build-Depends: ghc >= 8.2 && < 8.11
4141 CPP-Options: -DPM36_HASKELL_SCRIPTING
@@ -186,7 +186,8 @@ Executable tutd
186186 curryer-rpc,
187187 prettyprinter,
188188 cryptohash-sha256,
189− base16-bytestring,
189+ --due to decode signature change
190+ base16-bytestring >= 1.0.0.0,
190191 http-conduit,
191192 modern-uri,
192193 http-types
@@ -424,7 +425,7 @@ Test-Suite test-scripts
424425
425426Executable project-m36-websocket-server
426427 Default-Language: Haskell2010
427− 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, semigroups, attoparsec, parser-combinators, prettyprinter, network
428+ 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, semigroups, attoparsec, parser-combinators, prettyprinter, network, modern-uri, http-types, cryptohash-sha256, http-conduit, base16-bytestring
428429 Main-Is: ProjectM36/Server/WebSocket/websocket-server.hs
429430 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, TutorialD.Printer
430431 GHC-Options: -Wall -threaded
@@ -473,7 +474,7 @@ Test-Suite test-client-simple
473474Executable handles
474475 Default-Language: Haskell2010
475476 Default-Extensions: OverloadedStrings
476− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, optparse-applicative, stm-containers, list-t, ghc, ghc-paths, transformers, project-m36, random, MonadRandom, semigroups, parser-combinators, prettyprinter
477+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics,parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, optparse-applicative, stm-containers, list-t, ghc, ghc-paths, transformers, project-m36, random, MonadRandom, semigroups, parser-combinators, prettyprinter, modern-uri, base16-bytestring, http-conduit, cryptohash-sha256, http-types
477478 main-is: benchmark/Handles.hs
478479 Other-Modules: TutorialD.Interpreter,
479480 TutorialD.Interpreter.Base,
stack.ghc8.6.yaml+4
@@ -28,6 +28,10 @@ extra-deps:
2828- prettyprinter-1.7.0
2929- prettyprinter-ansi-terminal-1.1.2
3030- fusion-plugin-types-0.1.0
31+- base16-bytestring-1.0.1.0
32+- modern-uri-0.3.4.0
33+- cryptohash-sha256-0.11.102.0
34+- http-types-0.12.3
3135
3236# Override default flag values for local packages and extra-deps
3337flags:
stack.ghc8.8.yaml+2
@@ -30,6 +30,8 @@ extra-deps:
3030- primitive-unlifted-0.1.3.0
3131- prettyprinter-1.7.0
3232- prettyprinter-ansi-terminal-1.1.2
33+- base16-bytestring-1.0.1.0
34+- modern-uri-0.3.4.0
3335
3436# Override default flag values for local packages and extra-deps
3537flags: