Skip to content

Instantly share code, notes, and snippets.

@echatav
Created December 12, 2023 18:32
Show Gist options
  • Save echatav/4cb4f19a9c29d477b9a903e2857d7e92 to your computer and use it in GitHub Desktop.
Save echatav/4cb4f19a9c29d477b9a903e2857d7e92 to your computer and use it in GitHub Desktop.
Grammar
newtype Grammar a b = Grammar
(Loop (String := Production) () (Production a b))
type Production = DistAlt (ChooseMon (Token Char Char))
newtype Loop p a b = Loop
{ runLoop
:: forall q. ArrowLoop q
=> (forall x y. p x y -> q x y)
-> q a b
}
data (:=) e p a b = (:=) e (p a b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment