diff --git a/base/GraphRewriting/Graph/Internal.hs b/base/GraphRewriting/Graph/Internal.hs index ef0c0a7..aea36c0 100644 --- a/base/GraphRewriting/Graph/Internal.hs +++ b/base/GraphRewriting/Graph/Internal.hs @@ -7,6 +7,7 @@ module GraphRewriting.Graph.Internal where +import Control.Monad.Fix import Control.Monad.Reader import Control.Monad.State import Data.IntMap as Map (IntMap, lookup) diff --git a/base/GraphRewriting/Graph/Read.hs b/base/GraphRewriting/Graph/Read.hs index 84f9d46..35cf540 100644 --- a/base/GraphRewriting/Graph/Read.hs +++ b/base/GraphRewriting/Graph/Read.hs @@ -13,6 +13,7 @@ module GraphRewriting.Graph.Read ( ) where +import Control.Monad import Control.Monad.Reader import qualified Data.IntMap as Map import qualified Data.IntSet as Set diff --git a/base/GraphRewriting/Pattern.hs b/base/GraphRewriting/Pattern.hs index fa74797..e626bee 100644 --- a/base/GraphRewriting/Pattern.hs +++ b/base/GraphRewriting/Pattern.hs @@ -5,7 +5,7 @@ module GraphRewriting.Pattern (module GraphRewriting.Pattern, PatternT, Pattern, Match, (<|>)) where import Control.Applicative -import Control.Monad.List +import Control.Monad import Control.Monad.Reader import Data.Functor.Identity import qualified Data.Set as Set (empty, insert, member) diff --git a/base/GraphRewriting/Rule.hs b/base/GraphRewriting/Rule.hs index fd91297..43b320a 100644 --- a/base/GraphRewriting/Rule.hs +++ b/base/GraphRewriting/Rule.hs @@ -10,6 +10,7 @@ module GraphRewriting.Rule (Replace, module GraphRewriting.Rule) where import Prelude.Unicode +import Control.Monad import Control.Monad.Reader import Control.Monad.State import Data.List (nub) diff --git a/base/graph-rewriting.cabal b/base/graph-rewriting.cabal index 75be7ba..95099af 100644 --- a/base/graph-rewriting.cabal +++ b/base/graph-rewriting.cabal @@ -26,7 +26,7 @@ Library Build-Depends: base >= 4.9 && < 5, base-unicode-symbols >= 0.2 && < 0.3, - mtl >= 1.1 && < 2.3, + mtl >= 1.1 && < 2.4, containers >= 0.3 && < 0.7 Exposed-Modules: Data.View diff --git a/gl/cabal.project b/gl/cabal.project deleted file mode 100644 index 73e3b43..0000000 --- a/gl/cabal.project +++ /dev/null @@ -1,8 +0,0 @@ -packages: - graph-rewriting-gl.cabal - ../base/graph-rewriting.cabal - ../layout/graph-rewriting-layout.cabal - - - - diff --git a/lambdascope/Main.hs b/lambdascope/Main.hs index 3bc6268..c0c5914 100644 --- a/lambdascope/Main.hs +++ b/lambdascope/Main.hs @@ -33,6 +33,18 @@ instance (Render n) => Render (Layout.Wrapper n) where render = render . wrappee instance (PortSpec n) => PortSpec (Control.Wrapper n) where portSpec = portSpec . wrapped instance (LeftmostOutermost n) => LeftmostOutermost (Layout.Wrapper n) where lmoPort = lmoPort . wrappee +instance Show NodeLS where + show _ = error "TODO: Implement or derive Show NodeLS" + +instance Show Control where + show _ = error "TODO: Implement or derive Show Control" +instance Eq Control where + (==) _ _ = error "TODO: Implement or derive Eq Control" +instance Show (Control.Wrapper (Layout.Wrapper NodeLS)) where + show _ = error "TODO: Implement or derive Show (Control.Wrapper (Layout.Wrapper NodeLS))" +instance Eq (Control.Wrapper (Layout.Wrapper NodeLS)) where + (==) _ _ = error "TODO: Implement or derive Eq (Control.Wrapper (Layout.Wrapper NodeLS))" + main :: IO () main = do (prog, args) <- UI.initialise @@ -88,7 +100,11 @@ layoutStep n = do rot <- angularMomentum n return (cgf, cf, sf, rot) Unsafe.adjustNode n $ - Position . sf (\x -> min 10 (x * 0.9)) . cgf (\x -> min 10 (x * 0.01)) . cf (\x -> min 10 (100 / (x ^ 2 + 0.1))) . position + Position + . sf (\x -> min 10 (x * 0.9)) + . cgf (\x -> min 10 (x * 0.01)) + . cf (\x -> min 10 (100 / (x ^ 2 + 0.1))) + . position Unsafe.adjustNode n $ rot (* 0.9) lmoTree :: (LeftmostOutermost n, View [Port] n, View Control n) => LabelledTree (Rule n) -> LabelledTree (Rule n) diff --git a/lambdascope/cabal.project b/lambdascope/cabal.project deleted file mode 100644 index d48a305..0000000 --- a/lambdascope/cabal.project +++ /dev/null @@ -1,7 +0,0 @@ -packages: - graph-rewriting-lambdascope.cabal - ../gl/graph-rewriting-gl.cabal - ../base/graph-rewriting.cabal - ../layout/graph-rewriting-layout.cabal - ../strategies/graph-rewriting-strategies.cabal - diff --git a/lambdascope/graph-rewriting-lambdascope.cabal b/lambdascope/graph-rewriting-lambdascope.cabal index 4de8013..234d1cd 100644 --- a/lambdascope/graph-rewriting-lambdascope.cabal +++ b/lambdascope/graph-rewriting-lambdascope.cabal @@ -25,7 +25,7 @@ Executable lambdascope graph-rewriting-layout >= 0.5.4 && < 0.6, graph-rewriting-gl >= 0.7.6 && < 0.8, graph-rewriting-strategies >= 0.2.4 && < 0.3, - mtl >= 1.1 && < 2.3, + mtl >= 1.1 && < 2.4, parsec >= 3.1 && < 3.2, GLUT >= 2.2 && < 3, OpenGL >= 3.0 && < 4, diff --git a/lib/cabal.project b/lib/cabal.project deleted file mode 100644 index 7dcde30..0000000 --- a/lib/cabal.project +++ /dev/null @@ -1,3 +0,0 @@ -packages: - graph-rewriting-lib.cabal - ../base/graph-rewriting.cabal \ No newline at end of file diff --git a/ski/cabal.project b/ski/cabal.project deleted file mode 100644 index 2366249..0000000 --- a/ski/cabal.project +++ /dev/null @@ -1,6 +0,0 @@ -packages: - graph-rewriting-ski.cabal - ../gl/graph-rewriting-gl.cabal - ../base/graph-rewriting.cabal - ../layout/graph-rewriting-layout.cabal - ../lib/graph-rewriting-lib.cabal diff --git a/ski/graph-rewriting-ski.cabal b/ski/graph-rewriting-ski.cabal index e147865..4ada2ea 100644 --- a/ski/graph-rewriting-ski.cabal +++ b/ski/graph-rewriting-ski.cabal @@ -21,7 +21,6 @@ library Common.GL, INet.GL, INet.Graph, - Main, INet.Rules hs-source-dirs: ., INet default-language: Haskell2010 @@ -70,4 +69,4 @@ test-suite graph-rewriting-ski-tests tasty-hunit, graph-rewriting-ski hs-source-dirs: tests - default-language: Haskell2010 \ No newline at end of file + default-language: Haskell2010 diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 0000000..f50c31c --- /dev/null +++ b/stack.yaml @@ -0,0 +1,78 @@ +# This file was automatically generated by 'stack init' +# +# Some commonly used options have been documented as comments in this file. +# For advanced use and comprehensive documentation of the format, please see: +# https://docs.haskellstack.org/en/stable/configure/yaml/ + +# A 'specific' Stackage snapshot or a compiler version. +# A snapshot resolver dictates the compiler version and the set of packages +# to be used for project dependencies. For example: +# +# snapshot: lts-23.0 +# snapshot: nightly-2024-12-13 +# snapshot: ghc-9.8.4 +# +# The location of a snapshot can be provided as a file or url. Stack assumes +# a snapshot provided as a file might change, whereas a url resource does not. +# +# snapshot: ./custom-snapshot.yaml +# snapshot: https://example.com/snapshots/2024-01-01.yaml +resolver: lts-23.18 + +# User packages to be built. +# Various formats can be used as shown in the example below. +# +# packages: +# - some-directory +# - https://example.com/foo/bar/baz-0.0.2.tar.gz +# subdirs: +# - auto-update +# - wai +packages: + - base + - lib + - strategies + - gl + - lambdascope + - layout + - ski + - trs + - ww + +# Dependency packages to be pulled from upstream that are not in the snapshot. +# These entries can reference officially published versions as well as +# forks / in-progress versions pinned to a git hash. For example: +# +# extra-deps: +# - acme-missiles-0.3 +# - git: https://github.com/commercialhaskell/stack.git +# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a +# +extra-deps: + - AC-Vector-2.4.0@sha256:e9b03da163208a948f47d294cfd9f496108d060a73c8a9d1f0ec9c9429d7f67d,1237 + - indentparser-0.1@sha256:038219aa47c404d62994db118aaa40cbc44762f0af776b66f21190001e296edc,1605 + - uu-parsinglib-2.9.2@sha256:cd1d7ac35d65afa3919b9918fa003b1c2a6aee9f77e1fb04d045cdc7c59fb03e,3094 + - uu-interleaved-0.2.0.2@sha256:595e62dfca0e3a08e9fd37e102568313d4f3e2c29fab26a66f3640cc9412ecf3,1721 +# Override default flag values for project packages and extra-deps +# flags: {} + +# Extra package databases containing global packages +# extra-package-dbs: [] + +# Control whether we use the GHC we find on the path +# system-ghc: true +# +# Require a specific version of Stack, using version ranges +# require-stack-version: -any # Default +# require-stack-version: ">=3.3" +# +# Override the architecture used by Stack, especially useful on Windows +# arch: i386 +# arch: x86_64 +# +# Extra directories used by Stack for building +# extra-include-dirs: [/path/to/dir] +# extra-lib-dirs: [/path/to/dir] +# +# Allow a newer minor version of GHC than the snapshot specifies +# compiler-check: newer-minor diff --git a/stack.yaml.lock b/stack.yaml.lock new file mode 100644 index 0000000..ed786ab --- /dev/null +++ b/stack.yaml.lock @@ -0,0 +1,40 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/topics/lock_files + +packages: +- completed: + hackage: AC-Vector-2.4.0@sha256:e9b03da163208a948f47d294cfd9f496108d060a73c8a9d1f0ec9c9429d7f67d,1237 + pantry-tree: + sha256: 2bef6641223aafbdca6e75eec4534b09edeb7edf40184e87438e099270d4e701 + size: 1038 + original: + hackage: AC-Vector-2.4.0@sha256:e9b03da163208a948f47d294cfd9f496108d060a73c8a9d1f0ec9c9429d7f67d,1237 +- completed: + hackage: indentparser-0.1@sha256:038219aa47c404d62994db118aaa40cbc44762f0af776b66f21190001e296edc,1605 + pantry-tree: + sha256: 785e74e17bbfb055994852f78fdd6d5dd8f2952b6183f36f9a2e46ce3410b705 + size: 540 + original: + hackage: indentparser-0.1@sha256:038219aa47c404d62994db118aaa40cbc44762f0af776b66f21190001e296edc,1605 +- completed: + hackage: uu-parsinglib-2.9.2@sha256:cd1d7ac35d65afa3919b9918fa003b1c2a6aee9f77e1fb04d045cdc7c59fb03e,3094 + pantry-tree: + sha256: 092f68d0da727a4884d1b293378031ab6c048aa8874d83cbbfb9e85a832f331b + size: 974 + original: + hackage: uu-parsinglib-2.9.2@sha256:cd1d7ac35d65afa3919b9918fa003b1c2a6aee9f77e1fb04d045cdc7c59fb03e,3094 +- completed: + hackage: uu-interleaved-0.2.0.2@sha256:595e62dfca0e3a08e9fd37e102568313d4f3e2c29fab26a66f3640cc9412ecf3,1721 + pantry-tree: + sha256: 030748a52a5397cb0217fc58f4ea89f7c7f4daaafea71d95ca40335da9d9cecc + size: 237 + original: + hackage: uu-interleaved-0.2.0.2@sha256:595e62dfca0e3a08e9fd37e102568313d4f3e2c29fab26a66f3640cc9412ecf3,1721 +snapshots: +- completed: + sha256: d133abe75e408a407cce3f032c96ac1bbadf474a93b5156ebf4135b53382d56b + size: 683827 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/18.yaml + original: lts-23.18 diff --git a/trs/Graph.hs b/trs/Graph.hs index 01c3093..549b84f 100644 --- a/trs/Graph.hs +++ b/trs/Graph.hs @@ -14,6 +14,7 @@ data Vertex = Applicator {inp, out1, out2 :: Port} | Variable {inp :: Port, name :: Char} | Root {out :: Port} + deriving (Show, Eq) instance View [Port] Vertex where inspect node = case node of diff --git a/ww/Graph.hs b/ww/Graph.hs index b58c61b..bb7e80c 100644 --- a/ww/Graph.hs +++ b/ww/Graph.hs @@ -15,6 +15,7 @@ data NodeWW | Eraser {inp :: Port} | Duplicator {active :: Bool, inp, out1, out2 :: Port} | Multiplexer {out :: Port, ins :: [Port]} -- only intermediate compilation result + deriving (Show, Eq) instance View [Port] NodeWW where inspect node = case node of diff --git a/ww/Term.hs b/ww/Term.hs index f362a62..834489c 100644 --- a/ww/Term.hs +++ b/ww/Term.hs @@ -2,6 +2,7 @@ module Term where +import Control.Monad import Control.Monad.Identity import Prelude.Unicode import Text.Parsec diff --git a/ww/graph-rewriting-ww.cabal b/ww/graph-rewriting-ww.cabal index 04c487a..ef0ea61 100644 --- a/ww/graph-rewriting-ww.cabal +++ b/ww/graph-rewriting-ww.cabal @@ -23,7 +23,7 @@ Executable ww graph-rewriting >= 0.7.8 && < 0.9, graph-rewriting-layout >= 0.5.4 && < 0.6, graph-rewriting-gl >= 0.7.6 && < 0.8, - mtl >= 1.1 && < 2.3, + mtl >= 1.1 && < 2.4, parsec >= 3.1 && < 3.2, GLUT >= 2.2 && < 3, OpenGL >= 3.0 && < 4,