mirror of
https://github.com/github/semantic.git
synced 2024-12-29 09:55:52 +03:00
Concretize records.
This commit is contained in:
parent
cb2a9959ce
commit
76c56e387d
@ -265,9 +265,10 @@ instance ( Alternative m
|
||||
k (Alg (Record (Map.fromList fields')))
|
||||
|
||||
alg (L (Concretize t k)) = case t of
|
||||
Alg Unit -> k Intro.Unit
|
||||
Alg Bool -> k (Intro.Bool True) <|> k (Intro.Bool False)
|
||||
Alg String -> k (Intro.String mempty)
|
||||
Alg (_ :-> b) -> concretize @term b >>= k . Intro.Lam . Named (Name mempty) . lift . send
|
||||
Alg Unit -> k Intro.Unit
|
||||
Alg Bool -> k (Intro.Bool True) <|> k (Intro.Bool False)
|
||||
Alg String -> k (Intro.String mempty)
|
||||
Alg (_ :-> b) -> concretize @term b >>= k . Intro.Lam . Named (Name mempty) . lift . send
|
||||
Alg (Record t) -> traverse (traverse concretize) (Map.toList t) >>= k . Intro.Record . map (fmap send)
|
||||
t -> fail ("can’t concretize " <> show t)
|
||||
alg (R other) = DomainC (send (handleCoercible other))
|
||||
|
Loading…
Reference in New Issue
Block a user