| License | BSD-3-Clause |
|---|---|
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Swarm.Game.Scenario.Scoring.GenericMetrics
Description
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.5.0.0-6qXEbhCmuXA4wRndqqhBu" '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))) | |
Arguments
| :: Ord a | |
| => (b -> Maybe a) | criteria; record field extractor |
| -> Metric b | x |
| -> Metric b | y |
| -> Metric b |
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.