Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data types and functions applicable across different scoring methods.
Documentation
This is a subset of the ScenarioStatus type that excludes the NotStarted case.
Instances
FromJSON Progress Source # | |
ToJSON Progress Source # | |
Defined in Swarm.Game.Scenario.Scoring.GenericMetrics | |
Generic Progress Source # | |
Read Progress Source # | |
Show Progress Source # | |
Eq Progress Source # | |
Ord Progress Source # | |
Defined in Swarm.Game.Scenario.Scoring.GenericMetrics | |
type Rep Progress Source # | |
Defined in Swarm.Game.Scenario.Scoring.GenericMetrics |
Instances
FromJSON a => FromJSON (Metric a) Source # | |
ToJSON a => ToJSON (Metric a) Source # | |
Defined in Swarm.Game.Scenario.Scoring.GenericMetrics | |
Generic (Metric a) Source # | |
Read a => Read (Metric a) Source # | |
Show a => Show (Metric a) Source # | |
Eq a => Eq (Metric a) Source # | |
Ord a => Ord (Metric a) Source # | |
Defined in Swarm.Game.Scenario.Scoring.GenericMetrics | |
type Rep (Metric a) Source # | |
Defined in Swarm.Game.Scenario.Scoring.GenericMetrics type Rep (Metric a) = D1 ('MetaData "Metric" "Swarm.Game.Scenario.Scoring.GenericMetrics" "swarm-0.4-ISnx5FXhZ2Y66vKOx5hQmE" 'False) (C1 ('MetaCons "Metric" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Progress) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a))) |
This encodes the notion of "more play is better" for incomplete games (rationale: more play = more fun), whereas "smaller inputs are better" for completed games.
Since Maybe has its own Ord instance where
Nothing < Just x
regardless of x
, when we want to
choose the minimum value we `fmap Down` to ensure that
the Just
is selected while inverting the ordering of
the inner member.