Copyright | (c) 2018 Jiasen Wu |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Jiasen Wu <jiasenwu@hotmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This module defins operations to manipulate the generic representation of tuple.
- newtype TupleR (f :: [* -> *]) x = TupleR {}
- class AppDistributive (a :: [* -> *]) where
- appDistrWitPassArg :: (f :*: g) x -> (Proxy (L f), Proxy (L g), Proxy x)
- class Linearize (t :: * -> *) where
- length' :: TupleR a x -> Proxy (Len a)
- type family Half (a :: N) :: N where ...
- half :: Proxy n -> Proxy (Half n)
- class Take (n :: N) (a :: [* -> *]) where
- class Drop (n :: N) (a :: [* -> *]) where
- class Normalize (a :: [* -> *]) where
- type MetaS = MetaSel Nothing NoSourceUnpackedness NoSourceStrictness DecidedLazy
- type family UnRec0 t where ...
- type family UnS1 t where ...
- type family UnD1 t where ...
- type family MetaOfD1 t where ...
Documentation
class AppDistributive (a :: [* -> *]) where Source #
appDistrWit :: (Proxy a, Proxy b, Proxy x) -> Wit (((a ++ b) <&> x) ~ ((a <&> x) ++ (b <&> x))) Source #
AppDistributive ([] (* -> *)) Source # | inductive proof on |
AppDistributive as => AppDistributive ((:<) (* -> *) a as) Source # | case 2. |
appDistrWitPassArg :: (f :*: g) x -> (Proxy (L f), Proxy (L g), Proxy x) Source #
utility function to call appDistrWit
class Linearize (t :: * -> *) where Source #
Representation of tuple are shaped in a balanced tree.
L
transforms the tree into a list, for further manipulation.
class Normalize (a :: [* -> *]) where Source #
Normalize
converts a linear product back into a balanced tree.
Normalize ((:) (* -> *) (S1 * MetaS (Rec0 * t)) ([] (* -> *))) Source # | base case. singleton |
(Take (Half ((+) N2 (Len (* -> *) c))) ((:<) (* -> *) a ((:<) (* -> *) b c)), Drop (Half ((+) N2 (Len (* -> *) c))) ((:<) (* -> *) a ((:<) (* -> *) b c)), Normalize (T (Half ((+) N2 (Len (* -> *) c))) ((:<) (* -> *) a ((:<) (* -> *) b c))), Normalize (D (Half ((+) N2 (Len (* -> *) c))) ((:<) (* -> *) a ((:<) (* -> *) b c)))) => Normalize ((:<) (* -> *) a ((:<) (* -> *) b c)) Source # | inductive case. product |