mirror of
https://github.com/github/semantic.git
synced 2025-01-04 21:47:07 +03:00
🔥 guardTerm.
This commit is contained in:
parent
694164d3d4
commit
0065b0d99a
@ -1,7 +1,6 @@
|
||||
{-# LANGUAGE FunctionalDependencies, RankNTypes, ScopedTypeVariables, TypeFamilies, TypeOperators #-}
|
||||
module Data.Term
|
||||
( Term(..)
|
||||
, guardTerm
|
||||
, TermF(..)
|
||||
, termSize
|
||||
, hoistTerm
|
||||
@ -28,11 +27,6 @@ import Text.Show
|
||||
-- | A Term with an abstract syntax tree and an annotation.
|
||||
newtype Term syntax ann = Term { unTerm :: TermF syntax ann (Term syntax ann) }
|
||||
|
||||
guardTerm :: (f :< syntax, Alternative m)
|
||||
=> Term (Sum syntax) ann
|
||||
-> m (f (Term (Sum syntax) ann))
|
||||
guardTerm = Sum.projectGuard . termOut
|
||||
|
||||
data TermF syntax ann recur = In { termFAnnotation :: ann, termFOut :: syntax recur }
|
||||
deriving (Eq, Ord, Foldable, Functor, Show, Traversable, Generic1)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user