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:
parent
49baa468f9
commit
2743895e78
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user