Skip to content

Commit d34a60d

Browse files
committed
cleanup
1 parent 49c039b commit d34a60d

File tree

2 files changed

+6
-52
lines changed

2 files changed

+6
-52
lines changed

src/Core/Reflect.idr

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -890,50 +890,6 @@ Reflect a => Reflect (WithFC a) where
890890
val' <- reflect fc defs lhs env value.val
891891
appCon fc defs (reflectiontt "MkFCVal") [Erased fc Placeholder, loc', val']
892892

893-
-- -- Records are reflected into Data.List.Quantifier.All
894-
-- export
895-
-- (refs : All (Reflect . LabelledValue) fields) => Reflect (Record fields) where
896-
-- reflect fc defs lhs env [] = appCon fc defs (listAll "Nil") [Erased fc Placeholder]
897-
-- reflect fc defs lhs env (x :: xs) {refs = r :: rs}
898-
-- = do x' <- reflect @{r} fc defs lhs env x
899-
-- xs' <- reflect fc defs lhs env xs
900-
-- appCon fc defs (listAll "::") [Erased fc Placeholder, x', xs']
901-
--
902-
-- -- Records are reified from Data.List.Quantifier.All the labels are inferred from the type
903-
-- export
904-
-- {fields : _} -> (rei : All (Reify . LabelledValue) fields) => Reify (Record fields) where
905-
-- reify defs val@(NDCon _ n _ _ args) {fields = []}
906-
-- = case (dropAllNS !(full (gamma defs) n)) of
907-
-- (UN (Basic "Nil")) => pure []
908-
-- _ => cantReify val "expected empty fields"
909-
-- reify defs val@(NDCon _ n _ _ args) {fields = f :: fs} {rei = r :: rs}
910-
-- = case (dropAllNS !(full (gamma defs) n), map snd args) of
911-
-- (UN (Basic "::"), [_, x, xs]) => do
912-
-- x' <- reify defs !(evalClosure defs x)
913-
-- xs' <- reify defs !(evalClosure defs xs)
914-
-- pure (x' :: xs')
915-
-- (_, args) => cantReify val "fields : \{show (map label (f :: fs))}, args: \{show (length args)}"
916-
-- reify defs val {fields} = cantReify val "fields : \{show (map label fields)}"
917-
918-
-- export
919-
-- All (Reflect . LabelledValue) fields => Reflect a => Reflect (WithData fields a) where
920-
-- reflect fc defs lhs env (MkWithData metadata val)
921-
-- = do m' <- reflect fc defs lhs env metadata
922-
-- val' <- reflect fc defs lhs env val
923-
-- appCon fc defs (reflectiontt "MkWithData") [m', val']
924-
--
925-
-- export
926-
-- {fields : _} -> All (Reify . LabelledValue) fields => Reify a => Reify (WithData fields a) where
927-
-- reify defs val@(NDCon _ n _ _ args) {fields}
928-
-- = case (dropAllNS !(full (gamma defs) n), map snd args) of
929-
-- (UN (Basic "MkWithData"), [_, m, val]) => do
930-
-- m' <- reify defs !(evalClosure defs m)
931-
-- v' <- reify defs !(evalClosure defs val)
932-
-- pure (MkWithData m' v')
933-
-- (_, args) => cantReify val "WithData : \{show (map label fields)}, args : \{show (length args)}"
934-
-- reify defs val {fields} = cantReify val "WithData : \{show (map label fields)}"
935-
936-
937893
export
938894
Reflect BindingModifier where
939895
reflect fc defs lhs env NotBinding = getCon fc defs (reflectiontt "NotBinding")

src/Core/WithData.idr

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,12 @@ public export
199199
TyName' : KeyVal
200200
TyName' = "name" :-: FCBind Name
201201

202-
namespace TypeName
203-
||| Extract the "tyname" value from the metadata record
204-
export
205-
(.tyName) : {n : Nat} ->
206-
(inRange : NameInRange "name" fields === Just (n, FCBind Name)) =>
207-
WithData fields a -> FCBind Name
208-
(.tyName) = WithData.get "name" @{inRange}
209-
202+
||| Extract the "tyname" value from the metadata record
203+
export
204+
(.tyName) : {n : Nat} ->
205+
(inRange : NameInRange "name" fields === Just (n, FCBind Name)) =>
206+
WithData fields a -> FCBind Name
207+
(.tyName) = WithData.get "name" @{inRange}
210208

211209
||| Attach documentation, binding and location information to a type
212210
public export

0 commit comments

Comments
 (0)