HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulesydtest-mutation-runtime-0.2.0.0Haskell2010

Test.Syd.Mutation.Runtime

  • 1 type
  • 7 values
newtypenewtype MutationId
#

Identifies a single mutation site. The format of the strings is chosen by the plugin; the runtime treats this as an opaque key.

Parts must be non-empty and contain no '/': a MutationId is rendered as the slash-separated concatenation of its parts and parsed back by splitting on '/'. The empty list and empty parts would render to a string that parseMutationId cannot round-trip; '/' in a part would be split on parse.

Constructors

Instances8Eq, Ord, Show, Generic, Validity, HasCodec, …

Parse a mutation id from the MUTATION_ACTIVE env var format (slash-separated).

Rejects inputs that would produce an invalid MutationId (e.g. the empty string, or strings containing empty segments).

valueifMutation :: MutationId -> a -> a -> a
#

Emitted at every mutation site by the plugin.

When mid is the active mutation, evaluates to mutated; otherwise to original. When no mutation is active but a coverage slot is installed, records mid as covered.

NOINLINE prevents GHC from floating the readIORef on coverageSlot out of the call site or CSE-ing it across calls. Each ifMutation call must read coverageSlot afresh so that withCoverageSlot can install and uninstall the slot between tests in the coverage phase. The activeMutation read is constant within a process (mutations run in separate processes, each set by MUTATION_ACTIVE at start), but the coverageSlot read is not.