1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

🔥 the Syntax instance for Core.

This commit is contained in:
Rob Rix 2019-07-18 14:44:10 -04:00
parent 49baa468f9
commit 2743895e78
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -199,21 +199,3 @@ stripAnnotations (Var v) = Var v
stripAnnotations (Term t)
| Just c <- prj t, Ann _ b <- c = stripAnnotations b
| otherwise = Term (hmap stripAnnotations t)
instance Syntax Core where
foldSyntax go k h = \case
Let a -> Let a
a :>> b -> go h a :>> go h b
Lam u b -> Lam u (foldSyntax go k h b)
a :$ b -> go h a :$ go h b
Unit -> Unit
Bool b -> Bool b
If c t e -> If (go h c) (go h t) (go h e)
String s -> String s
Load t -> Load (go h t)
Edge e t -> Edge e (go h t)
Frame -> Frame
a :. b -> go h a :. go h b
a := b -> go h a := go h b
Ann loc t -> Ann loc (go h t)