clash-lib-hedgehog-1.5.0: Hedgehog Generators for clash-lib

Clash.Hedgehog.Internal.Bias

Description

Bias for influencing generator choice.

Synopsis

# Documentation

class Bias a where Source #

Determine the bias of an item. This is used to set the weight of that item so we can sample using the frequency generator instead of element or choice.

Where might you want to introduce such a bias? If there is a collection of elements where there is a likeliness that real code would use certain values more or less, we want to be able to capture this. An obvious example of this is the TyConMap, where without it every constructor would have an even weighting, when in reality some (like Void# or Addr# are much less likely to appear in code written by a Clash user).

Methods

biasOf :: a -> Int Source #

#### Instances

Instances details
 Bias TyCon Source # Instance detailsDefined in Clash.Hedgehog.Internal.Bias MethodsbiasOf :: TyCon -> Int Source #