packages feed

exploring-interpreters 0.3.1.0 → 0.3.2.0

raw patch · 5 files changed

+30/−1 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Language.Explorer.Monadic: fromExport :: Explorer p m c o -> (Ref, [(Ref, c)], [(Ref, Ref, (p, o))]) -> Explorer p m c o
+ Language.Explorer.Monadic: initialRef :: Int
+ Language.Explorer.Monadic: toExport :: Explorer p m c o -> (Ref, [(Ref, c)], [(Ref, Ref, (p, o))])
+ Language.Explorer.Pure: initialRef :: Int

Files

CHANGELOG.md view
@@ -9,3 +9,8 @@  ## 0.3.1.0 -- 2021-04-18 * This version adds the 'leaves' function to the exploring interpreter.++## 0.3.2.0 -- 2021-06-29+* This version adds functionality to support exporting and importing of execution environments.+This functionality is provided via the 'toExport' and 'fromExport' functions.+* Furthermore, this version also exports the initial reference.
Language/Explorer/Basic.hs view
@@ -19,6 +19,7 @@     , getPathsFromTo     , getPathFromTo     , executionGraph+    , ExplorerM.initialRef     ) where  import qualified Language.Explorer.Monadic as ExplorerM@@ -93,3 +94,9 @@  leaves :: Explorer p c -> [(Ref, c)] leaves = ExplorerM.leaves++toExport :: Explorer p c -> (Ref, [(Ref, c)], [(Ref, Ref, p)])+toExport exp = let (curr, nds, edges) = ExplorerM.toExport exp in (curr, nds, map (\(r1, r2, (p, o)) -> (r1, r2, p)) edges)++fromExport :: Explorer p c -> (Ref, [(Ref, c)], [(Ref, Ref, p)]) -> Explorer p c+fromExport exp (curr, nds, edgs) = ExplorerM.fromExport exp (curr, nds, map (\(r1, r2, p) -> (r1, r2, (p, ()))) edgs)
Language/Explorer/Monadic.hs view
@@ -15,6 +15,7 @@     , config     , execEnv     , currRef+    , initialRef     , leaves     , Ref     , deref@@ -23,6 +24,8 @@     , getPathsFromTo     , getPathFromTo     , executionGraph+    , toExport+    , fromExport     ) where  import Data.Graph.Inductive.Graph@@ -192,3 +195,10 @@     env = execEnv exp     refToPair = \r -> (r, fromJust $ deref exp r)     leave_nodes = nodes $ nfilter (\n -> (==0) $ outdeg env n) env+++toExport :: Explorer p m c o -> (Ref, [(Ref, c)], [(Ref, Ref, (p, o))])+toExport exp = (currRef exp, IntMap.toList $ cmap exp, labEdges $ execEnv exp)++fromExport :: Explorer p m c o -> (Ref, [(Ref, c)], [(Ref, Ref, (p, o))]) -> Explorer p m c o+fromExport exp (curr, nds, edgs) = exp { currRef = curr, cmap = IntMap.fromList nds, execEnv = mkGraph (map (\(x, _) -> (x, x)) nds) edgs }
Language/Explorer/Pure.hs view
@@ -13,6 +13,7 @@     , config     , currRef     , Ref+    , ExplorerM.initialRef     , deref     , leaves     , getTrace@@ -84,3 +85,9 @@  leaves :: Explorer p c o -> [(Ref, c)] leaves = ExplorerM.leaves++toExport :: Explorer p c o -> (Ref, [(Ref, c)], [(Ref, Ref, (p, o))])+toExport = ExplorerM.toExport++fromExport :: Explorer p c o -> (Ref, [(Ref, c)], [(Ref, Ref, (p, o))]) -> Explorer p c o+fromExport = ExplorerM.fromExport
exploring-interpreters.cabal view
@@ -1,7 +1,7 @@ cabal-version:       >=1.10  name:                exploring-interpreters-version:             0.3.1.0+version:             0.3.2.0 synopsis:            A generic exploring interpreter for exploratory programming -- synopsis: -- description: