Safe Haskell | None |
---|---|
Language | Haskell2010 |
Type-level indexing functionality
- class GetIndexGo ixTy myTy cmp where
- type ResolvedIx ixTy myTy cmp :: *
- type GetIndex l r = GetIndexGo l r (CmpNat (ToNat l) (ToNat r))
- type GetIx l r = ResolvedIx l r (CmpNat (ToNat l) (ToNat r))
- getIndex :: forall ixTy myTy. GetIndex ixTy myTy => ixTy -> Proxy myTy -> GetIx ixTy myTy
- type family ToNat x :: Nat
Documentation
class GetIndexGo ixTy myTy cmp where Source #
Given some complete index list ixTy
and some lower-dimensional
version myTy
, walk down along ixTy
until we have is:.i ~ ms:.m
and
return m
.
type ResolvedIx ixTy myTy cmp :: * Source #
getIndexGo :: ixTy -> Proxy myTy -> Proxy cmp -> ResolvedIx ixTy myTy cmp Source #
GetIndexGo Z Z EQ Source # | |
GetIndexGo (RunningIndex Z) (RunningIndex Z) EQ Source # | |
GetIndexGo (RunningIndex ix) (RunningIndex Z) (CmpNat (ToNat (RunningIndex ix)) (ToNat (RunningIndex Z))) => GetIndexGo (RunningIndex ((:.) ix i)) (RunningIndex Z) GT Source # | |
GetIndexGo (RunningIndex ix) (RunningIndex ((:.) my m)) (CmpNat (ToNat (RunningIndex ix)) (ToNat (RunningIndex ((:.) my m)))) => GetIndexGo (RunningIndex ((:.) ix i)) (RunningIndex ((:.) my m)) GT Source # | |
GetIndexGo (RunningIndex ((:.) ix i)) (RunningIndex ((:.) my m)) EQ Source # | |
GetIndexGo ix Z (CmpNat (ToNat ix) (ToNat Z)) => GetIndexGo ((:.) ix i) Z GT Source # | |
GetIndexGo ix ((:.) my m) (CmpNat (ToNat ix) (ToNat ((:.) my m))) => GetIndexGo ((:.) ix i) ((:.) my m) GT Source # | |
GetIndexGo ((:.) ix i) ((:.) my m) EQ Source # | |
type GetIndex l r = GetIndexGo l r (CmpNat (ToNat l) (ToNat r)) Source #
Wrap GetIndexGo
and the type-level shenanigans.