mirror of
https://github.com/github/semantic.git
synced 2024-12-25 16:02:43 +03:00
Define instantiation of Core terms.
This commit is contained in:
parent
bde447c040
commit
9790468ada
@ -11,6 +11,7 @@ module Data.Core
|
||||
, block
|
||||
, ann
|
||||
, annWith
|
||||
, instantiate
|
||||
) where
|
||||
|
||||
import Control.Applicative (Alternative (..))
|
||||
@ -139,3 +140,7 @@ gfoldT var let' seq' lam app unit bool if' string load edge frame dot assign ann
|
||||
-- | Bind occurrences of a name in a 'Core' term, producing a 'Core' in which the name is bound.
|
||||
bind :: Eq a => a -> Core a -> Core (Incr a)
|
||||
bind name = fmap (match name)
|
||||
|
||||
-- | Substitute a 'Core' term for the free variable in a given 'Core', producing a closed 'Core' term.
|
||||
instantiate :: Core a -> Core (Incr a) -> Core a
|
||||
instantiate t b = b >>= subst t . fmap pure
|
||||
|
Loading…
Reference in New Issue
Block a user