HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleutility-ht-0.0.17.2Haskell98

Data.Function.HT

  • 1 type
  • 3 values
typetype Id a = a -> a
#

Useful for adding type annotations like in

f . (id :: Id Char) . g
valuenest :: Int -> (a -> a) -> a -> a
#

Compositional power of a function, i.e. apply the function n times to a value. It is rather the same as iter in Simon Thompson: "The Craft of Functional Programming", page 172

valuepowerAssociative :: (a -> a -> a) -> a -> a -> Integer -> a
#

powerAssociative is an auxiliary function that, for an associative operation op, computes the same value as

powerAssociative op a0 a n = foldr op a0 (genericReplicate n a)

but applies "op" O(log n) times and works for large n.

valuecompose2 :: (b -> b -> c) -> (a -> b) -> a -> a -> c
#

Known as on in newer versions of the base package.