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.Match

Intended for qualified import

import           Data.SOP.Match (Mismatch(..))
import qualified Data.SOP.Match as Match
  • 1 type
  • 14 values
datadata Mismatch (f :: k -> Type) (g :: k -> Type) (xs :: [k]) where
#

We have a mismatch in the index between two NS

Constructors

  • ML :: f x -> NS g xs1 -> Mismatch f g (x ': xs1)

    The left is at the current x and the right is somewhere in the later xs

  • MR :: NS f xs1 -> g x -> Mismatch f g (x ': xs1)

    The right is at the current x and the left is somewhere in the later xs

  • MS :: Mismatch f g xs1 -> Mismatch f g (x ': xs1)

    There is a mismatch later on in the xs

Instances10HTrans, HAp, Eq, Ord, Show, NoThunks, …

Utilities

7 declarations
valuemismatchTwo :: Mismatch f g '[x, y] -> Either (f x, g y) (f y, g x)
#

If we only have two eras, only two possibilities for a mismatch

SOP operators

3 declarations
valuebihcmap
  1. :: All c xs
  2. => proxy c
  3. -> forall (x :: k). c x => f x -> f' x
  4. -> forall (x :: k). c x => g x -> g' x
  5. -> Mismatch f g xs
  6. -> Mismatch f' g' xs
#

Bifunctor analogue of hcmap