1{-# language DataKinds #-}
3{-# language PatternSynonyms #-}
4{-# language StandaloneKindSignatures #-}
5{-# language TypeFamilies #-}
7module Rel8.Schema.HTable.Identity
8 ( HIdentity( HIdentity, HType, unHIdentity )
14import Data.Kind ( Type )
18import Rel8.Schema.Dict ( Dict( Dict ) )
19import Rel8.Schema.HTable
20 ( HTable, HConstrainTable, HField
21 , hfield, htabulate, htraverse, hdicts, hspecs
23import qualified Rel8.Schema.Kind as K
24import Rel8.Schema.Spec ( Spec( Spec ), KnownSpec, specSing )
27type HType :: Type -> K.HTable
28type HType a = HIdentity ('Spec a)
31pattern HType :: context ('Spec a) -> HType a context
32pattern HType a = HIdentity a
36type HIdentity :: Spec -> K.HTable
37newtype HIdentity spec context = HIdentity
38 { unHIdentity :: context spec
42type HIdentityField :: Spec -> Spec -> Type
43data HIdentityField _spec spec where
44 HIdentityField :: HIdentityField spec spec
47instance KnownSpec spec => HTable (HIdentity spec) where
48 type HConstrainTable (HIdentity spec) c = c spec
49 type HField (HIdentity spec) = HIdentityField spec
51 hfield (HIdentity a) HIdentityField = a
52 htabulate f = HIdentity $ f HIdentityField
53 htraverse f (HIdentity a) = HIdentity <$> f a
54 hdicts = HIdentity Dict
55 hspecs = HIdentity specSing
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list