File tree Expand file tree Collapse file tree 6 files changed +16
-8
lines changed
Expand file tree Collapse file tree 6 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -302,8 +302,12 @@ toCoreDefn (I.DatatypeDefn dt) ty =
302302 dataConstructors = cons_indexes}
303303 return $ Core. DatatypeDefn d
304304
305- toCoreDefn (I. RecordDefn _) _ =
306- throwError " records are not supported"
305+ toCoreDefn (I. RecordDefn rd) ty =
306+ withError (\ e -> multiLineText $ " record definition failure \n " <> Pretty. render (nest 1 e)) $ do
307+ let I. RecordData {
308+ _recPars = pars,
309+ _recFields = fields} = rd
310+ throwError " records are not supported"
307311
308312toCoreDefn (I. ConstructorDefn cs) ty =
309313 withError (\ e -> multiLineText $ " constructor definition failure:\n " <> Pretty. render (nest 1 e)) $ do
Original file line number Diff line number Diff line change @@ -246,14 +246,14 @@ convertWhnf r (TSort s) (TSort t) = convSorts s t
246246-- return (CEtaVar x f b proof)
247247convertWhnf r functionTerm (TLam x b) =
248248 let
249- depPairX = ⟨ x ⟩ (Zero ⟨ IsZero refl ⟩)
249+ -- depPairX = ⟨ x ⟩ (Zero ⟨ IsZero refl ⟩)
250250 subsetProof = (subWeaken subRefl)
251251 newScope = singBind r
252- term = TApp (weakenTerm subsetProof functionTerm) (TVar depPairX )
252+ term = TApp (weakenTerm subsetProof functionTerm) (TVar (VZero x) )
253253 in
254254 do
255255 conversionProof <- convertCheck newScope b term
256- return (CEtaVar2 x functionTerm b conversionProof)
256+ return (CEtaFunctions x functionTerm b conversionProof)
257257-- convertWhnf r (TLam x v) (TVar x') = tcError "implement eta-functions 2"
258258-- convertWhnf r (TApp _ _) (TLam _ _) = tcError "implement eta-functions 3"
259259convertWhnf r _ _ = tcError "two terms are not the same and aren't convertible"
Original file line number Diff line number Diff line change @@ -113,5 +113,6 @@ instance
113113pattern Vsuc n p = ⟨ _ ⟩ (Suc n ⟨ IsSuc p ⟩)
114114pattern V2suc n p = ⟨ _ ⟩ (Suc (Suc n) ⟨ IsSuc (IsSuc p) ⟩)
115115pattern Vzero = ⟨ _ ⟩ Zero ⟨ IsZero refl ⟩
116+ pattern VZero x = ⟨ x ⟩ Zero ⟨ IsZero refl ⟩
116117pattern Vone = ⟨ _ ⟩ (Suc Zero) ⟨ IsSuc (IsZero refl) ⟩
117118-------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -118,12 +118,11 @@ data Conv {α} where
118118 (b : Term (α ▸ x))
119119 → b ≅ TApp (TVar depPairF) (TVar depPairX)
120120 → TVar f ≅ (TLam x b)
121- CEtaVar2 : (@0 x : Name) (f : Term α) (b : Term (α ▸ x)) →
121+ CEtaFunctions : (@0 x : Name) (f : Term α) (b : Term (α ▸ x)) →
122122 let
123- depPairX = ⟨ x ⟩ (Zero ⟨ IsZero refl ⟩)
124123 subsetProof = (subWeaken subRefl)
125124 in
126- b ≅ (TApp (weakenTerm subsetProof f) (TVar depPairX ))
125+ b ≅ (TApp (weakenTerm subsetProof f) (TVar (VZero x) ))
127126 → f ≅ (TLam x b)
128127
129128
Original file line number Diff line number Diff line change @@ -119,6 +119,8 @@ data Defn : Set where
119119 FunctionDefn : (funBody : Term mempty) → Defn
120120 DatatypeDefn : (@0 d : NameData) → Datatype d → Defn
121121 ConstructorDefn : (@0 d : NameData) (@0 c : NameCon d) → Constructor c → Defn
122+ -- TODO (diode-lang) : add record defn
123+ -- RecordDefn : (@0 d : NameData) → {!!} → Defn
122124{-# COMPILE AGDA2HS Defn #-}
123125
124126
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ data Term α where
3131 → (TermS α (fieldScope c)) → Term α
3232 TLam : (@0 x : Name) (v : Term (α ▸ x)) → Term α
3333 TApp : (u : Term α) (v : Term α) → Term α
34+ -- TODO (diode-lang) : Add record terms
35+ -- TRec : (d : NameData) → {!!} → Term α
3436 TProj : (u : Term α) (x : NameIn defScope) → Term α
3537 TCase : {@0 x : Name}
3638 → (d : NameData) -- Datatype of the variable we are splitting on
You can’t perform that action at this time.
0 commit comments