Skip to content

Improve the situation with the stimes cycle

meooow requested to merge meooow/ghc:improve-stimes into master

Currently the Semigroup stimes cycle is resolved in GHC.Base by importing stimes implementations from a hs-boot file.
Resolve the cycle using hs-boot files for required classes (Num, Integral) instead. Now stimes can be defined directly in GHC.Base, making inlining and specialization possible.

This MR is adapted from !6863 (closed) (thanks @treeowl!). See also a CLC dicussion at https://github.com/haskell/core-libraries-committee/issues/8.

Things that are related but not in this MR:

  • Improving stimes for Endo. This is in !6863 (closed) but not here, it can be done separately.
  • Making stimes INLINABLE. I would like to make it so (this already happens), and also those in Semigroup.Internal, but this needs CLC approval according to #23074 (comment 485732) and can be done later.
Edited by meooow

Merge request reports