box-tuples-0.2.0.4: A hack to use GHC.Prim primitives in GHCi
Copyright(C) 2020 mniip
LicenseMIT
Maintainermniip <mniip@mniip.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Tuple.Unboxed.Rep

Description

This module provides an ad-hoc polymorphic alternative to the functions in Data.Tuple.Unboxed. The functions have the same basic signature, but using GHC 8.0+ features they are made parametrically polymorphic within each fixed representation/calling convention.

This module defines instances for all calling conventions that have ever come up in GHC.Prim but in principle other cases could be added too.

Documentation

class RepCompose1 (r0 :: RuntimeRep) (r1 :: RuntimeRep) where Source #

Methods

repCompose1 :: forall (a :: TYPE r0) (b :: TYPE r1) (r :: *). (a -> (# b #)) -> a -> (b -> r) -> r Source #

repDecompose1 :: forall (a :: TYPE r0) (b :: TYPE r1) (r :: *). (a -> (b -> (# b #)) -> (# b #)) -> a -> (# b #) Source #

Instances

Instances details
RepCompose1 'LiftedRep 'LiftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose1 :: forall (a :: TYPE 'LiftedRep) (b :: TYPE 'LiftedRep) r. (a -> (# b #)) -> a -> (b -> r) -> r Source #

repDecompose1 :: forall (a :: TYPE 'LiftedRep) (b :: TYPE 'LiftedRep) r. (a -> (b -> (# b #)) -> (# b #)) -> a -> (# b #) Source #

RepCompose1 'UnliftedRep 'LiftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose1 :: forall (a :: TYPE 'UnliftedRep) (b :: TYPE 'LiftedRep) r. (a -> (# b #)) -> a -> (b -> r) -> r Source #

repDecompose1 :: forall (a :: TYPE 'UnliftedRep) (b :: TYPE 'LiftedRep) r. (a -> (b -> (# b #)) -> (# b #)) -> a -> (# b #) Source #

RepCompose1 'IntRep 'LiftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose1 :: forall (a :: TYPE 'IntRep) (b :: TYPE 'LiftedRep) r. (a -> (# b #)) -> a -> (b -> r) -> r Source #

repDecompose1 :: forall (a :: TYPE 'IntRep) (b :: TYPE 'LiftedRep) r. (a -> (b -> (# b #)) -> (# b #)) -> a -> (# b #) Source #

RepCompose1 'WordRep 'LiftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose1 :: forall (a :: TYPE 'WordRep) (b :: TYPE 'LiftedRep) r. (a -> (# b #)) -> a -> (b -> r) -> r Source #

repDecompose1 :: forall (a :: TYPE 'WordRep) (b :: TYPE 'LiftedRep) r. (a -> (b -> (# b #)) -> (# b #)) -> a -> (# b #) Source #

RepCompose1 'AddrRep 'LiftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose1 :: forall (a :: TYPE 'AddrRep) (b :: TYPE 'LiftedRep) r. (a -> (# b #)) -> a -> (b -> r) -> r Source #

repDecompose1 :: forall (a :: TYPE 'AddrRep) (b :: TYPE 'LiftedRep) r. (a -> (b -> (# b #)) -> (# b #)) -> a -> (# b #) Source #

class RepCompose2 (r0 :: RuntimeRep) (r1 :: RuntimeRep) (r2 :: RuntimeRep) where Source #

Methods

repCompose2 :: forall (a :: TYPE r0) (b :: TYPE r1) (c :: TYPE r2) (r :: *). (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE r0) (b :: TYPE r1) (c :: TYPE r2) (r :: *). (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

Instances

Instances details
RepCompose2 'LiftedRep 'UnliftedRep 'UnliftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'LiftedRep) (b :: TYPE 'UnliftedRep) (c :: TYPE 'UnliftedRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'LiftedRep) (b :: TYPE 'UnliftedRep) (c :: TYPE 'UnliftedRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'UnliftedRep 'IntRep 'UnliftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'UnliftedRep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'UnliftedRep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'IntRep 'IntRep 'LiftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'IntRep) (b :: TYPE 'IntRep) (c :: TYPE 'LiftedRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'IntRep) (b :: TYPE 'IntRep) (c :: TYPE 'LiftedRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'IntRep 'IntRep 'UnliftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'IntRep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'IntRep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'IntRep 'IntRep 'IntRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'IntRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'IntRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'Int8Rep 'Int8Rep 'Int8Rep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'Int8Rep) (b :: TYPE 'Int8Rep) (c :: TYPE 'Int8Rep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'Int8Rep) (b :: TYPE 'Int8Rep) (c :: TYPE 'Int8Rep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'Int16Rep 'Int16Rep 'Int16Rep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'Int16Rep) (b :: TYPE 'Int16Rep) (c :: TYPE 'Int16Rep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'Int16Rep) (b :: TYPE 'Int16Rep) (c :: TYPE 'Int16Rep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'Int64Rep 'IntRep 'UnliftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'Int64Rep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'Int64Rep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'Int64Rep 'Int64Rep 'Int64Rep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'Int64Rep) (b :: TYPE 'Int64Rep) (c :: TYPE 'Int64Rep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'Int64Rep) (b :: TYPE 'Int64Rep) (c :: TYPE 'Int64Rep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'WordRep 'IntRep 'UnliftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'WordRep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'WordRep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'WordRep 'WordRep 'IntRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'WordRep) (b :: TYPE 'WordRep) (c :: TYPE 'IntRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'WordRep) (b :: TYPE 'WordRep) (c :: TYPE 'IntRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'WordRep 'WordRep 'WordRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'WordRep) (b :: TYPE 'WordRep) (c :: TYPE 'WordRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'WordRep) (b :: TYPE 'WordRep) (c :: TYPE 'WordRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'Word8Rep 'Word8Rep 'Word8Rep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'Word8Rep) (b :: TYPE 'Word8Rep) (c :: TYPE 'Word8Rep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'Word8Rep) (b :: TYPE 'Word8Rep) (c :: TYPE 'Word8Rep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'Word16Rep 'Word16Rep 'Word16Rep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'Word16Rep) (b :: TYPE 'Word16Rep) (c :: TYPE 'Word16Rep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'Word16Rep) (b :: TYPE 'Word16Rep) (c :: TYPE 'Word16Rep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'Word64Rep 'IntRep 'UnliftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'Word64Rep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'Word64Rep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'Word64Rep 'Word64Rep 'Word64Rep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'Word64Rep) (b :: TYPE 'Word64Rep) (c :: TYPE 'Word64Rep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'Word64Rep) (b :: TYPE 'Word64Rep) (c :: TYPE 'Word64Rep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'AddrRep 'IntRep 'UnliftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'AddrRep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'AddrRep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'FloatRep 'IntRep 'IntRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'FloatRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'FloatRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'DoubleRep 'IntRep 'IntRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'DoubleRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'DoubleRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

RepCompose2 'DoubleRep 'Int64Rep 'IntRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose2 :: forall (a :: TYPE 'DoubleRep) (b :: TYPE 'Int64Rep) (c :: TYPE 'IntRep) r. (a -> (# b, c #)) -> a -> (b -> c -> r) -> r Source #

repDecompose2 :: forall (a :: TYPE 'DoubleRep) (b :: TYPE 'Int64Rep) (c :: TYPE 'IntRep) r. (a -> (b -> c -> (# b, c #)) -> (# b, c #)) -> a -> (# b, c #) Source #

class RepCompose3 (r0 :: RuntimeRep) (r1 :: RuntimeRep) (r2 :: RuntimeRep) (r3 :: RuntimeRep) where Source #

Methods

repCompose3 :: forall (a :: TYPE r0) (b :: TYPE r1) (c :: TYPE r2) (d :: TYPE r3) (r :: *). (a -> (# b, c, d #)) -> a -> (b -> c -> d -> r) -> r Source #

repDecompose3 :: forall (a :: TYPE r0) (b :: TYPE r1) (c :: TYPE r2) (d :: TYPE r3) (r :: *). (a -> (b -> c -> d -> (# b, c, d #)) -> (# b, c, d #)) -> a -> (# b, c, d #) Source #

Instances

Instances details
RepCompose3 'LiftedRep 'AddrRep 'UnliftedRep 'UnliftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose3 :: forall (a :: TYPE 'LiftedRep) (b :: TYPE 'AddrRep) (c :: TYPE 'UnliftedRep) (d :: TYPE 'UnliftedRep) r. (a -> (# b, c, d #)) -> a -> (b -> c -> d -> r) -> r Source #

repDecompose3 :: forall (a :: TYPE 'LiftedRep) (b :: TYPE 'AddrRep) (c :: TYPE 'UnliftedRep) (d :: TYPE 'UnliftedRep) r. (a -> (b -> c -> d -> (# b, c, d #)) -> (# b, c, d #)) -> a -> (# b, c, d #) Source #

RepCompose3 'IntRep 'IntRep 'IntRep 'IntRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose3 :: forall (a :: TYPE 'IntRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) (d :: TYPE 'IntRep) r. (a -> (# b, c, d #)) -> a -> (b -> c -> d -> r) -> r Source #

repDecompose3 :: forall (a :: TYPE 'IntRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) (d :: TYPE 'IntRep) r. (a -> (b -> c -> d -> (# b, c, d #)) -> (# b, c, d #)) -> a -> (# b, c, d #) Source #

RepCompose3 'FloatRep 'IntRep 'IntRep 'UnliftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose3 :: forall (a :: TYPE 'FloatRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) (d :: TYPE 'UnliftedRep) r. (a -> (# b, c, d #)) -> a -> (b -> c -> d -> r) -> r Source #

repDecompose3 :: forall (a :: TYPE 'FloatRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) (d :: TYPE 'UnliftedRep) r. (a -> (b -> c -> d -> (# b, c, d #)) -> (# b, c, d #)) -> a -> (# b, c, d #) Source #

RepCompose3 'DoubleRep 'IntRep 'IntRep 'UnliftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose3 :: forall (a :: TYPE 'DoubleRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) (d :: TYPE 'UnliftedRep) r. (a -> (# b, c, d #)) -> a -> (b -> c -> d -> r) -> r Source #

repDecompose3 :: forall (a :: TYPE 'DoubleRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) (d :: TYPE 'UnliftedRep) r. (a -> (b -> c -> d -> (# b, c, d #)) -> (# b, c, d #)) -> a -> (# b, c, d #) Source #

RepCompose3 'DoubleRep 'IntRep 'IntRep 'IntRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose3 :: forall (a :: TYPE 'DoubleRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) (d :: TYPE 'IntRep) r. (a -> (# b, c, d #)) -> a -> (b -> c -> d -> r) -> r Source #

repDecompose3 :: forall (a :: TYPE 'DoubleRep) (b :: TYPE 'IntRep) (c :: TYPE 'IntRep) (d :: TYPE 'IntRep) r. (a -> (b -> c -> d -> (# b, c, d #)) -> (# b, c, d #)) -> a -> (# b, c, d #) Source #

class RepCompose4 (r0 :: RuntimeRep) (r1 :: RuntimeRep) (r2 :: RuntimeRep) (r3 :: RuntimeRep) (r4 :: RuntimeRep) where Source #

Methods

repCompose4 :: forall (a :: TYPE r0) (b :: TYPE r1) (c :: TYPE r2) (d :: TYPE r3) (e :: TYPE r4) (r :: *). (a -> (# b, c, d, e #)) -> a -> (b -> c -> d -> e -> r) -> r Source #

repDecompose4 :: forall (a :: TYPE r0) (b :: TYPE r1) (c :: TYPE r2) (d :: TYPE r3) (e :: TYPE r4) (r :: *). (a -> (b -> c -> d -> e -> (# b, c, d, e #)) -> (# b, c, d, e #)) -> a -> (# b, c, d, e #) Source #

Instances

Instances details
RepCompose4 'UnliftedRep 'IntRep 'UnliftedRep 'IntRep 'UnliftedRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose4 :: forall (a :: TYPE 'UnliftedRep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) (d :: TYPE 'IntRep) (e :: TYPE 'UnliftedRep) r. (a -> (# b, c, d, e #)) -> a -> (b -> c -> d -> e -> r) -> r Source #

repDecompose4 :: forall (a :: TYPE 'UnliftedRep) (b :: TYPE 'IntRep) (c :: TYPE 'UnliftedRep) (d :: TYPE 'IntRep) (e :: TYPE 'UnliftedRep) r. (a -> (b -> c -> d -> e -> (# b, c, d, e #)) -> (# b, c, d, e #)) -> a -> (# b, c, d, e #) Source #

RepCompose4 'DoubleRep 'IntRep 'WordRep 'WordRep 'IntRep Source # 
Instance details

Defined in Data.Tuple.Unboxed.Rep

Methods

repCompose4 :: forall (a :: TYPE 'DoubleRep) (b :: TYPE 'IntRep) (c :: TYPE 'WordRep) (d :: TYPE 'WordRep) (e :: TYPE 'IntRep) r. (a -> (# b, c, d, e #)) -> a -> (b -> c -> d -> e -> r) -> r Source #

repDecompose4 :: forall (a :: TYPE 'DoubleRep) (b :: TYPE 'IntRep) (c :: TYPE 'WordRep) (d :: TYPE 'WordRep) (e :: TYPE 'IntRep) r. (a -> (b -> c -> d -> e -> (# b, c, d, e #)) -> (# b, c, d, e #)) -> a -> (# b, c, d, e #) Source #