Skip to content

Instantly share code, notes, and snippets.

@spacekitteh
Created July 31, 2015 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spacekitteh/7a4f23b0512a2be821b1 to your computer and use it in GitHub Desktop.
Save spacekitteh/7a4f23b0512a2be821b1 to your computer and use it in GitHub Desktop.
newtype TermFormerID = TermFormerID Natural deriving (Eq, Show)
-- Used for dynamic sequences of name usage. For example, memory locations in an imperitive program. Models binding arities.
data BindingToken a = Create Name
| Destroy Name
| RawTerm a
| Constant a deriving (Eq, Show, Functor, Foldable, Traversable)
data NominalTerm a = Atom Name
| Variable Permutation Name
| BindingSequence [BindingToken a]
| TermFormer TermFormerID [NominalTerm a] deriving (Eq, Show, Functor, Foldable, Traversable)
makeClassy ''BindingToken
makeClassyPrisms ''BindingToken
makeClassy ''NominalTerm
makeClassyPrisms ''NominalTerm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment