{- |
Description: Module for creating demos of feature trace recording.
License: GNU LGPLv3
Maintainer: paul.bittner@uni-ulm.de
Module for creating demos of feature trace recording.
-}
module Example where
import AST ( AST )
import Edits ( EditScript )
import Grammar
import Feature
import FeatureTrace
import FeatureTraceRecording
import DefaultFeatureTraceRecording
import FeatureColour (FeatureFormulaColourPalette)
import Control.Monad.State ( State, runState )
import UUID
data Example m g a = Example {
Example m g a -> String
name :: String,
Example m g a -> Version g a
startVersion :: Version g a,
Example m g a -> History g a
history :: History g a,
Example m g a -> FeatureFormulaColourPalette m
colours :: FeatureFormulaColourPalette m
}
runExample :: (Grammar g, Show a, Eq a) => FeatureTraceRecording g a -> Example m g a -> [Version g a]
runExample :: FeatureTraceRecording g a -> Example m g a -> [Version g a]
runExample ftr :: FeatureTraceRecording g a
ftr example :: Example m g a
example = FeatureTraceRecording g a
-> Version g a -> History g a -> [Version g a]
forall a g.
(Show a, Eq a) =>
FeatureTraceRecording g a
-> Version g a -> History g a -> [Version g a]
runFTRWithIntermediateSteps FeatureTraceRecording g a
ftr (Example m g a -> Version g a
forall (m :: * -> *) g a. Example m g a -> Version g a
startVersion Example m g a
example) (Example m g a -> History g a
forall (m :: * -> *) g a. Example m g a -> History g a
history Example m g a
example)
runExampleWithDefaultFTR :: (Grammar g, Show a, Eq a) => Example m g a -> [Version g a]
runExampleWithDefaultFTR :: Example m g a -> [Version g a]
runExampleWithDefaultFTR = FeatureTraceRecording g a -> Example m g a -> [Version g a]
forall g a (m :: * -> *).
(Grammar g, Show a, Eq a) =>
FeatureTraceRecording g a -> Example m g a -> [Version g a]
runExample FeatureTraceRecording g a
forall g a. (Grammar g, Show a, Eq a) => FeatureTraceRecording g a
defaultFeatureTraceRecording
finalizeExample :: State UUID (Example m g a) -> Example m g a
finalizeExample :: State UUID (Example m g a) -> Example m g a
finalizeExample ex :: State UUID (Example m g a)
ex = (Example m g a, UUID) -> Example m g a
forall a b. (a, b) -> a
fst ((Example m g a, UUID) -> Example m g a)
-> (Example m g a, UUID) -> Example m g a
forall a b. (a -> b) -> a -> b
$ State UUID (Example m g a) -> UUID -> (Example m g a, UUID)
forall s a. State s a -> s -> (a, s)
runState State UUID (Example m g a)
ex 0