Copyright | (C) 2020 mniip |
---|---|
License | MIT |
Maintainer | mniip <mniip@mniip.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
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 #
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
RepCompose1 'LiftedRep 'LiftedRep Source # | |
Defined in Data.Tuple.Unboxed.Rep | |
RepCompose1 'UnliftedRep 'LiftedRep Source # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep | |
RepCompose1 'WordRep 'LiftedRep Source # | |
Defined in Data.Tuple.Unboxed.Rep | |
RepCompose1 'AddrRep 'LiftedRep Source # | |
Defined in Data.Tuple.Unboxed.Rep |
class RepCompose2 (r0 :: RuntimeRep) (r1 :: RuntimeRep) (r2 :: RuntimeRep) where Source #
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
RepCompose2 'LiftedRep 'UnliftedRep 'UnliftedRep Source # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep | |
RepCompose2 'Int8Rep 'Int8Rep 'Int8Rep Source # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 #
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
RepCompose3 'LiftedRep 'AddrRep 'UnliftedRep 'UnliftedRep Source # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 #
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
RepCompose4 'UnliftedRep 'IntRep 'UnliftedRep 'IntRep 'UnliftedRep Source # | |
Defined in Data.Tuple.Unboxed.Rep 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 # | |
Defined in Data.Tuple.Unboxed.Rep 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 # |