| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Haskell.Template.Task
Synopsis
- data FSolutionConfig m = SolutionConfig {
- allowAdding :: m Bool
- allowModifying :: m Bool
- allowRemoving :: m Bool
- addCodeWorldButton :: m Bool
- addCodeWorldRenderButton :: m Bool
- addCodeWorldPartialRenderButton :: m Bool
- configGhcLimit :: m (Maybe Natural)
- configGhcErrors :: m [String]
- configGhcWarnings :: m [String]
- configHlintSuggestionsLimit :: m (Maybe Natural)
- configHlintErrors :: m [String]
- configHlintGroups :: m [String]
- configHlintRules :: m [String]
- configHlintSuggestions :: m [String]
- configLanguageExtensions :: m [String]
- maxLineLength :: m (Maybe Natural)
- provideSampleSolution :: m Bool
- messageOnCloningSampleSolution :: m (Maybe String)
- disableSemantics :: m Bool
- rigorousValidation :: m Bool
- syntaxCutoff :: m FeedbackPhase
- type SolutionConfig = FSolutionConfig Identity
- check :: MonadIO m => (forall a. Doc -> m a) -> (Doc -> m ()) -> FilePath -> String -> m ()
- defaultCode :: String
- defaultSolutionConfig :: SolutionConfigOpt
- finaliseConfigs :: [SolutionConfigOpt] -> Maybe SolutionConfig
- getCodeWorldButtonOption :: String -> Bool
- getCodeWorldRenderButtonOption :: String -> Bool
- getCodeWorldPartialRenderButtonOption :: String -> Bool
- getHlintFeedback :: MonadIO m => (Doc -> m a) -> SolutionConfig -> FilePath -> String -> (SolutionConfig -> Identity [String]) -> m [a]
- grade :: MonadIO m => (m () -> m ()) -> (m () -> m ()) -> (forall c. Doc -> m c) -> (Doc -> m ()) -> FilePath -> String -> String -> m Bool
- matchTemplate :: Monad m => (forall a. Doc -> m a) -> SolutionConfig -> Int -> [Extension] -> String -> String -> m ()
- maybeSampleSolution :: String -> Maybe Doc
- parse :: Monad m => (forall a. Doc -> m a) -> [Extension] -> String -> m (Module SrcSpanInfo)
- rejectHint :: Doc
- rejectMatch :: Applicative m => (forall a. Doc -> m a) -> SolutionConfig -> Int -> String -> String -> Location -> m ()
- toSolutionConfigOpt :: SolutionConfig -> SolutionConfigOpt
- unsafeTemplateSegment :: String -> String
Documentation
data FSolutionConfig m Source #
Constructors
| SolutionConfig | |
Fields
| |
Instances
| Show SolutionConfig Source # | |
Defined in Haskell.Template.Task Methods showsPrec :: Int -> SolutionConfig -> ShowS # show :: SolutionConfig -> String # showList :: [SolutionConfig] -> ShowS # | |
| Generic (FSolutionConfig m) Source # | |
Defined in Haskell.Template.Task Associated Types type Rep (FSolutionConfig m) :: Type -> Type # Methods from :: FSolutionConfig m -> Rep (FSolutionConfig m) x # to :: Rep (FSolutionConfig m) x -> FSolutionConfig m # | |
| type Rep (FSolutionConfig m) Source # | |
Defined in Haskell.Template.Task | |
type SolutionConfig = FSolutionConfig Identity Source #
check :: MonadIO m => (forall a. Doc -> m a) -> (Doc -> m ()) -> FilePath -> String -> m () Source #
defaultCode :: String Source #
defaultSolutionConfig :: SolutionConfigOpt Source #
finaliseConfigs :: [SolutionConfigOpt] -> Maybe SolutionConfig Source #
getCodeWorldButtonOption :: String -> Bool Source #
Extract the value of the addCodeWorldButton option.
Defaults to False if not specified.
Also returns False in case the config cannot be read.
getCodeWorldRenderButtonOption :: String -> Bool Source #
Extract the value of the addCodeWorldRenderButton option.
Defaults to False if not specified.
Also returns False in case the config cannot be read.
getCodeWorldPartialRenderButtonOption :: String -> Bool Source #
Extract the value of the addCodeWorldPartialRenderButton option.
Defaults to False if not specified.
Also returns False in case the config cannot be read.
Arguments
| :: MonadIO m | |
| => (Doc -> m a) | |
| -> SolutionConfig | |
| -> FilePath | directory where to write |
| -> String | |
| -> (SolutionConfig -> Identity [String]) | |
| -> m [a] |
Arguments
| :: MonadIO m | |
| => (m () -> m ()) | Evaluation function for the syntax phase |
| -> (m () -> m ()) | Evaluation function for the semantics phase |
| -> (forall c. Doc -> m c) | display a message and fail |
| -> (Doc -> m ()) | display a message and continue |
| -> FilePath | parent directory to use for file operations |
| -> String | the task |
| -> String | the submission |
| -> m Bool | whether the conditions outlined in the description apply or not |
Generate consecutive syntax and possible semantics feedback in the context of an evaluation Monad.
This Monad is expected to provide a mechanism to prematurely end the evaluation in case of failure.
This function returns an encapsulated Bool value if all tests pass.
It will only be True if the submission contains a clone of the sample solution,
the semantics phase is not disabled by disableSemantics and
the task was also configured to add a custom message on clones via messageOnCloningSampleSolution.
Otherwise, the value will always be False.
This can be used by the caller to conditionally add the sample solution
after the grading is already completed, with maybeSampleSolution.
matchTemplate :: Monad m => (forall a. Doc -> m a) -> SolutionConfig -> Int -> [Extension] -> String -> String -> m () Source #
maybeSampleSolution :: String -> Maybe Doc Source #
Extract the sample solution if one was provided, provideSampleSolution is enabled
and disableSemantics is not enabled.
parse :: Monad m => (forall a. Doc -> m a) -> [Extension] -> String -> m (Module SrcSpanInfo) Source #
rejectHint :: Doc Source #
rejectMatch :: Applicative m => (forall a. Doc -> m a) -> SolutionConfig -> Int -> String -> String -> Location -> m () Source #
toSolutionConfigOpt :: SolutionConfig -> SolutionConfigOpt Source #
unsafeTemplateSegment :: String -> String Source #