1
1
mirror of https://github.com/github/semantic.git synced 2025-01-04 21:47:07 +03:00

🔥 guardTerm.

This commit is contained in:
Rob Rix 2019-10-18 18:52:34 -04:00
parent 694164d3d4
commit 0065b0d99a
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -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)