sop-extras-0.2.0.0: Type-level and data utilities that build upon SOP.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.SOP.InPairs

Description

Intended for qualified import

import           Data.SOP.InPairs (InPairs(..))
import qualified Data.SOP.InPairs as InPairs
Synopsis

InPairs

data InPairs f xs where Source #

We have an f x y for each pair (x, y) of successive list elements

Constructors

PNilInPairs f '[x] 
PCons ∷ f x y → InPairs f (y ': zs) → InPairs f (x ': (y ': zs)) 

Convenience constructors

mk1InPairs f '[x] Source #

mk2 ∷ f x y → InPairs f '[x, y] Source #

mk3 ∷ f x y → f y z → InPairs f '[x, y, z] Source #

SOP-like operators

hcmap ∷ ∀ proxy c f g xs. All c xs ⇒ proxy c → (∀ x y. (c x, c y) ⇒ f x y → g x y) → InPairs f xs → InPairs g xs Source #

hcpure ∷ ∀ proxy c xs f. (All c xs, IsNonEmpty xs) ⇒ proxy c → (∀ x y. (c x, c y) ⇒ f x y) → InPairs f xs Source #

hczipWith ∷ ∀ proxy c f f' f'' xs. All c xs ⇒ proxy c → (∀ x y. (c x, c y) ⇒ f x y → f' x y → f'' x y) → InPairs f xs → InPairs f' xs → InPairs f'' xs Source #

hmapSListI xs ⇒ (∀ x y. f x y → g x y) → InPairs f xs → InPairs g xs Source #

hpure ∷ (SListI xs, IsNonEmpty xs) ⇒ (∀ x y. f x y) → InPairs f xs Source #

Requiring

newtype Requiring h f x y Source #

Constructors

Require 

Fields

newtype RequiringBoth h f x y Source #

Constructors

RequireBoth 

Fields

ignoring ∷ f x y → Requiring h f x y Source #

ignoringBoth ∷ f x y → RequiringBoth h f x y Source #

requiringSListI xs ⇒ NP h xs → InPairs (Requiring h f) xs → InPairs f xs Source #

requiringBothNP h xs → InPairs (RequiringBoth h f) xs → InPairs f xs Source #