Skip to content

Commit

Permalink
upgrade to output-blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellussiegburg committed Jul 3, 2024
1 parent 36c213f commit b5dbd4b
Show file tree
Hide file tree
Showing 59 changed files with 279 additions and 271 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ stack ghci --stack-yaml=stack-examples.yaml
```

``` haskell
:m + Control.Monad.Output Control.Monad.Output.Generic
:m +Control.OutputCapable.Blocks Control.OutputCapable.Blocks.Generic
inst <- nameCdErrorGenerate defaultNameCdErrorConfig 0 0
runLangMReport (return ()) (>>) (nameCdErrorTask "/tmp/" inst) >>= \(Just (), x) -> (x English :: IO ())
runLangMReport (return ()) (>>) (nameCdErrorSyntax inst NameCdErrorAnswer {reason = 'b', dueTo = [1,2,4]}) >>= \(Just (), x) -> (x English :: IO ())
Expand All @@ -35,7 +35,7 @@ runLangMReport (return ()) (>>) (nameCdErrorEvaluation inst NameCdErrorAnswer {r
For running all steps at once in `ghci`, the following approach is also possible:

``` haskell
:m + Control.Monad.Output.Debug System.Random Text.Parsec
:m +Control.OutputCapable.Blocks.Debug System.Random Text.Parsec
let getLines = init <$> getLines' where getLines' = do { x <- getLine; if null x then pure [] else (\l -> x ++ '\n' : l) <$> getLines' }
testTask English (randomRIO (0,1000) >>= nameCdErrorGenerate defaultNameCdErrorConfig 0) (nameCdErrorTask "/tmp/") nameCdErrorSyntax nameCdErrorEvaluation (either (error . show) id . parse parseNameCdErrorAnswer "" <$> getLines)
```
Expand Down
4 changes: 2 additions & 2 deletions app/common/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ module Common (
withLang,
) where

import qualified Control.Monad.Output.Generic as GenericOutput (withLang)
import qualified Control.OutputCapable.Blocks.Generic as GenericOutput (withLang)

import Control.Monad.Output (LangM', Language, ReportT)
import Control.OutputCapable.Blocks (LangM', Language, ReportT)
import Control.Monad.Trans.Except (ExceptT, runExceptT)
import Data.Maybe (fromMaybe)
import Diagrams.Prelude (Diagram, mkWidth)
Expand Down
2 changes: 1 addition & 1 deletion app/concurrency.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import Modelling.PetriNet.Types (
defaultFindConcurrencyConfig, defaultPickConcurrencyConfig,
)

import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import Control.Monad.Trans.Class (lift)
import Data.Maybe (isNothing)
import System.IO (
Expand Down
2 changes: 1 addition & 1 deletion app/conflicts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import Modelling.PetriNet.Types (
defaultFindConflictConfig, defaultPickConflictConfig,
)

import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import Control.Monad.Trans.Class (MonadTrans (lift))
import Data.Maybe (isNothing)
import System.IO (
Expand Down
2 changes: 1 addition & 1 deletion app/different-names.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Modelling.CdOd.DifferentNames
(defaultDifferentNamesConfig, differentNames, differentNamesTask)
import EvaluateArgs (evaluateArgs)

import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import Control.Monad.Trans.Except (runExceptT)
import System.Environment (getArgs)

Expand Down
2 changes: 1 addition & 1 deletion app/enterASTaskDemo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Modelling.ActivityDiagram.EnterAS (
enterASSyntax,
enterASEvaluation
)
import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import System.Environment (getArgs)

import Common (withLang)
Expand Down
2 changes: 1 addition & 1 deletion app/findSupportSTTaskDemo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Modelling.ActivityDiagram.FindSupportST (
findSupportSTTask,
findSupportSTEvaluation
)
import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import System.Environment (getArgs)

import Common (withLang)
Expand Down
2 changes: 1 addition & 1 deletion app/match-cd-od.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Modelling.CdOd.MatchCdOd (
)
import EvaluateArgs (evaluateArgs)

import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import System.Environment (getArgs)

main :: IO ()
Expand Down
2 changes: 1 addition & 1 deletion app/matchAdTaskDemo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Modelling.ActivityDiagram.MatchAd (
matchAdSyntax,
matchAdEvaluation
)
import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import System.Environment (getArgs)

import Common (withLang)
Expand Down
2 changes: 1 addition & 1 deletion app/matchPetriTaskDemo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Modelling.ActivityDiagram.MatchPetri (
matchPetriSyntax,
matchPetriEvaluation
)
import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import System.Environment (getArgs)

import Common (withLang)
Expand Down
2 changes: 1 addition & 1 deletion app/matchToMath.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Modelling.PetriNet.Types (
)

import Control.Monad (when)
import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Except (throwE)
import System.IO (
Expand Down
24 changes: 12 additions & 12 deletions app/modelling-tasks-apps.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ executable concurrency
, digest
, modelling-tasks
, mtl
, output-monad
, output-blocks
, pretty-simple
, transformers
default-language: Haskell2010
Expand All @@ -78,7 +78,7 @@ executable conflicts
, digest
, modelling-tasks
, mtl
, output-monad
, output-blocks
, pretty-simple
, transformers
default-language: Haskell2010
Expand All @@ -105,7 +105,7 @@ executable different-names
, digest
, modelling-tasks
, mtl
, output-monad
, output-blocks
, transformers
default-language: Haskell2010

Expand All @@ -128,7 +128,7 @@ executable enterASTaskDemo
, diagrams-svg
, modelling-tasks
, mtl
, output-monad
, output-blocks
, transformers
default-language: Haskell2010

Expand Down Expand Up @@ -203,7 +203,7 @@ executable findSupportSTTaskDemo
, diagrams-svg
, modelling-tasks
, mtl
, output-monad
, output-blocks
, transformers
default-language: Haskell2010

Expand All @@ -229,7 +229,7 @@ executable match-cd-od
, digest
, modelling-tasks
, mtl
, output-monad
, output-blocks
, transformers
default-language: Haskell2010

Expand All @@ -252,7 +252,7 @@ executable matchAdTaskDemo
, diagrams-svg
, modelling-tasks
, mtl
, output-monad
, output-blocks
, transformers
default-language: Haskell2010

Expand All @@ -275,7 +275,7 @@ executable matchPetriTaskDemo
, diagrams-svg
, modelling-tasks
, mtl
, output-monad
, output-blocks
, transformers
default-language: Haskell2010

Expand All @@ -300,7 +300,7 @@ executable matchToMath
, digest
, modelling-tasks
, mtl
, output-monad
, output-blocks
, pretty-simple
, transformers
default-language: Haskell2010
Expand All @@ -327,7 +327,7 @@ executable repair-incorrect
, digest
, modelling-tasks
, mtl
, output-monad
, output-blocks
, transformers
default-language: Haskell2010

Expand All @@ -350,7 +350,7 @@ executable selectASTaskDemo
, diagrams-svg
, modelling-tasks
, mtl
, output-monad
, output-blocks
, transformers
default-language: Haskell2010

Expand All @@ -373,6 +373,6 @@ executable selectPetriTaskDemo
, diagrams-svg
, modelling-tasks
, mtl
, output-monad
, output-blocks
, transformers
default-language: Haskell2010
24 changes: 12 additions & 12 deletions app/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ executables:
- bytestring
- digest
- modelling-tasks
- output-monad
- output-blocks
- pretty-simple
other-modules:
- Common
Expand All @@ -53,7 +53,7 @@ executables:
- bytestring
- digest
- modelling-tasks
- output-monad
- output-blocks
- pretty-simple
other-modules:
- Common
Expand All @@ -66,7 +66,7 @@ executables:
- bytestring
- digest
- modelling-tasks
- output-monad
- output-blocks
other-modules:
- EvaluateArgs
- Common
Expand All @@ -77,7 +77,7 @@ executables:
- common
dependencies:
- modelling-tasks
- output-monad
- output-blocks
other-modules:
- Common
evalIsomorphic:
Expand Down Expand Up @@ -107,7 +107,7 @@ executables:
- common
dependencies:
- modelling-tasks
- output-monad
- output-blocks
other-modules:
- Common
matchAdTaskDemo:
Expand All @@ -117,7 +117,7 @@ executables:
- common
dependencies:
- modelling-tasks
- output-monad
- output-blocks
other-modules:
- Common
matchPetriTaskDemo:
Expand All @@ -127,7 +127,7 @@ executables:
- common
dependencies:
- modelling-tasks
- output-monad
- output-blocks
other-modules:
- Common
match-cd-od:
Expand All @@ -139,7 +139,7 @@ executables:
- bytestring
- digest
- modelling-tasks
- output-monad
- output-blocks
other-modules:
- Common
- EvaluateArgs
Expand All @@ -152,7 +152,7 @@ executables:
- bytestring
- digest
- modelling-tasks
- output-monad
- output-blocks
- pretty-simple
other-modules:
- Common
Expand All @@ -165,7 +165,7 @@ executables:
- bytestring
- digest
- modelling-tasks
- output-monad
- output-blocks
other-modules:
- Common
- EvaluateArgs
Expand All @@ -176,7 +176,7 @@ executables:
- common
dependencies:
- modelling-tasks
- output-monad
- output-blocks
other-modules:
- Common
selectPetriTaskDemo:
Expand All @@ -186,6 +186,6 @@ executables:
- common
dependencies:
- modelling-tasks
- output-monad
- output-blocks
other-modules:
- Common
2 changes: 1 addition & 1 deletion app/repair-incorrect.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Modelling.CdOd.SelectValidCd
(defaultSelectValidCdConfig, selectValidCd, selectValidCdTask)
import EvaluateArgs (evaluateArgs)

import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import System.Environment (getArgs)

main :: IO ()
Expand Down
2 changes: 1 addition & 1 deletion app/selectASTaskDemo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Modelling.ActivityDiagram.SelectAS (
selectASSyntax,
selectASEvaluation
)
import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import System.Environment (getArgs)

import Common (withLang)
Expand Down
2 changes: 1 addition & 1 deletion app/selectPetriTaskDemo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Modelling.ActivityDiagram.SelectPetri (
selectPetriSyntax,
selectPetriEvaluation
)
import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import System.Environment (getArgs)

import Common (withLang)
Expand Down
2 changes: 1 addition & 1 deletion legacy-app/different-names.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Modelling.CdOd.DifferentNames
import Modelling.CdOd.Generate.DifferentNames (differentNames)
import EvaluateArgs (evaluateArgs)

import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import System.Environment (getArgs)

main :: IO ()
Expand Down
2 changes: 1 addition & 1 deletion legacy-app/match-cd-od.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Modelling.CdOd.MatchCdOd (
)
import EvaluateArgs (evaluateArgs)

import Control.Monad.Output (Language (English))
import Control.OutputCapable.Blocks (Language (English))
import System.Environment (getArgs)

main :: IO ()
Expand Down
4 changes: 2 additions & 2 deletions legacy-app/modelling-task-legacy-apps.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ executable different-names-legacy
, graphviz
, modelling-tasks
, mtl
, output-monad
, output-blocks
, random-shuffle
, transformers
default-language: Haskell2010
Expand Down Expand Up @@ -137,7 +137,7 @@ executable match-cd-od-legacy
, graphviz
, modelling-tasks
, mtl
, output-monad
, output-blocks
, random-shuffle
, transformers
default-language: Haskell2010
Loading

0 comments on commit b5dbd4b

Please sign in to comment.