Skip to content

Generalise Data.Fixed.Fixed to allow Nat type parameter.

Ashley Yakeley requested to merge wip/issue15622 into master

Fix for #10055 (closed). The type parameter for Fixed (in Data.Fixed) is now generalised to allow Nat kind as well as Type kind. Predefined Fixed types changed to use Nat.

This makes it easier to create fixed-point types without having to create an instance of HasResolution:

type FP16 = Fixed (2 ^ 16)
type Femto = Fixed (10 ^ 15)

This breaks the time library. As the maintainer of time, I will follow up to create a new point release with the (very small) fix.

Edited by Ashley Yakeley

Merge request reports