Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit a83cdff

Browse files
committed
Define a function to close a term.
1 parent 8371475 commit a83cdff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

semantic-core/src/Data/Scope.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
module Data.Scope
33
( Incr(..)
44
, incr
5+
, closed
56
, Scope(..)
67
, fromScope
78
, toScope
@@ -44,6 +45,10 @@ incr :: (a -> c) -> (b -> c) -> Incr a b -> c
4445
incr z s = \case { Z a -> z a ; S b -> s b }
4546

4647

48+
closed :: Traversable f => f a -> Maybe (f b)
49+
closed = traverse (const Nothing)
50+
51+
4752
newtype Scope a f b = Scope { unScope :: f (Incr a (f b)) }
4853
deriving (Foldable, Functor, Traversable)
4954

0 commit comments

Comments
 (0)