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.Kind.Necessity ( Necessity( Required ) )
19import Rel8.Schema.Dict ( Dict( Dict ) )
20import Rel8.Schema.HTable
21 ( HTable, HConstrainTable, HField
22 , hfield, htabulate, htraverse, hdicts, hspecs
24import qualified Rel8.Schema.Kind as K
25import Rel8.Schema.Spec ( Spec( Spec ), KnownSpec, specSing )
28type HType :: Type -> K.HTable
29type HType a = HIdentity ('Spec '[] 'Required a)
32pattern HType :: context ('Spec '[] 'Required a) -> HType a context
33pattern HType a = HIdentity a
37type HIdentity :: Spec -> K.HTable
38newtype HIdentity spec context = HIdentity
39 { unHIdentity :: context spec
43type HIdentityField :: Spec -> Spec -> Type
44data HIdentityField _spec spec where
45 HIdentityField :: HIdentityField spec spec
48instance KnownSpec spec => HTable (HIdentity spec) where
49 type HConstrainTable (HIdentity spec) c = c spec
50 type HField (HIdentity spec) = HIdentityField spec
52 hfield (HIdentity a) HIdentityField = a
53 htabulate f = HIdentity $ f HIdentityField
54 htraverse f (HIdentity a) = HIdentity <$> f a
55 hdicts = HIdentity Dict
56 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