mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
Define a function to close a term.
This commit is contained in:
parent
8371475e43
commit
a83cdffa73
@ -2,6 +2,7 @@
|
||||
module Data.Scope
|
||||
( Incr(..)
|
||||
, incr
|
||||
, closed
|
||||
, Scope(..)
|
||||
, fromScope
|
||||
, toScope
|
||||
@ -44,6 +45,10 @@ incr :: (a -> c) -> (b -> c) -> Incr a b -> c
|
||||
incr z s = \case { Z a -> z a ; S b -> s b }
|
||||
|
||||
|
||||
closed :: Traversable f => f a -> Maybe (f b)
|
||||
closed = traverse (const Nothing)
|
||||
|
||||
|
||||
newtype Scope a f b = Scope { unScope :: f (Incr a (f b)) }
|
||||
deriving (Foldable, Functor, Traversable)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user