HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Modulederiving-compat-0.6.8Haskell2010

Data.Ix.Deriving

Exports functions to mechanically derive Ix instances.

  • 4 values

Ix

4 declarations
valuederiveIx :: Name -> Q [Dec]
#

Generates a Ix instance declaration for the given data type or data family instance.

valuemakeRange :: Name -> Q Exp
#

Generates a lambda expression which behaves like range (without requiring an Ix instance).

valuemakeUnsafeIndex :: Name -> Q Exp
#

Generates a lambda expression which behaves like unsafeIndex (without requiring an Ix instance).

valuemakeInRange :: Name -> Q Exp
#

Generates a lambda expression which behaves like inRange (without requiring an Ix instance).

deriveIx limitations

0 declarations

Be aware of the following potential gotchas:

  • Type variables of kind * are assumed to have Ix constraints. If this is not desirable, use makeRange or one of its cousins.

  • Generated Ix instances for poly-kinded data family instances are likely to require the use of the TypeInType extension on GHC 8.0, 8.2, or 8.4.