1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 09:55:52 +03:00

Concretize records.

This commit is contained in:
Rob Rix 2019-12-19 11:59:39 -05:00
parent cb2a9959ce
commit 76c56e387d
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -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 ("cant concretize " <> show t)
alg (R other) = DomainC (send (handleCoercible other))