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

Modulerebase-1.21.2Haskell2010

Rebase.Data.Functor.Extend

  • 1 class
  • 2 values
  • Packagerebase-1.21.2
  • Exports3
  • LanguageHaskell2010
  • LicenceMIT
  • SourceExtend.hs
classclass Functor w => Extend (w :: Type -> Type) where
#

Methods

  • duplicated :: w a -> w (w a)
    duplicated = extended id
    fmap (fmap f) . duplicated = duplicated . fmap f
  • extended :: (w a -> b) -> w a -> w b
    extended f  = fmap f . duplicated
Instances42Extend, …
valuegduplicated :: (Extend (Rep1 w), Generic1 w) => w a -> w (w a)
#

Generic duplicated. Caveats:

  1. Will not compile if w is a product type.

  2. Will not compile if w contains fields where the type variable appears underneath the composition of type constructors (e.g., f (g a)).