HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulesop-extras-0.4.1.1Haskell2010

Data.SOP.Index

  • 1 type
  • 17 values

Indexing SOP types

8 declarations
patternpattern IS :: () => xs ~ (x' ': xs') => Index xs' x -> Index xs x
#
patternpattern IZ :: () => xs ~ (x ': xs1) => Index xs x
#

Zipping with indices

8 declarations
valuehcimap
  1. :: (HAp h, All c xs, Prod h ~ NP)
  2. => proxy c
  3. -> forall (a :: k). c a => Index xs a -> f1 a -> f2 a
  4. -> h f1 xs
  5. -> h f2 xs
#
valuehcizipWith
  1. :: (HAp h, All c xs, Prod h ~ NP)
  2. => proxy c
  3. -> forall (a :: k). c a => Index xs a -> f1 a -> f2 a -> f3 a
  4. -> NP f1 xs
  5. -> h f2 xs
  6. -> h f3 xs
#
valuehcizipWith3
  1. :: (HAp h, All c xs, Prod h ~ NP)
  2. => proxy c
  3. -> forall (a :: k). c a => Index xs a -> f1 a -> f2 a -> f3 a -> f4 a
  4. -> NP f1 xs
  5. -> NP f2 xs
  6. -> h f3 xs
  7. -> h f4 xs
#
valuehcizipWith4
  1. :: (HAp h, All c xs, Prod h ~ NP)
  2. => proxy c
  3. -> forall (a :: k). c a => Index xs a -> f1 a -> f2 a -> f3 a -> f4 a -> f5 a
  4. -> NP f1 xs
  5. -> NP f2 xs
  6. -> NP f3 xs
  7. -> h f4 xs
  8. -> h f5 xs
#

Indices with Word

4 declarations
valuenpWithIndices :: SListI xs => NP (K Word8) xs
#

We only allow up to 23 (so counting from 0, 24 elements in xs), because CBOR stores a Word8 in the range 0-23 as a single byte equal to the value of the Word8.