mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
ArbitraryTerm → Term eliminator.
This commit is contained in:
parent
bc47d2743f
commit
fda61b074f
@ -7,7 +7,7 @@ import Split
|
||||
import Syntax
|
||||
import Term
|
||||
import Control.Comonad.Cofree
|
||||
import Control.Monad.Free
|
||||
import Control.Monad.Free hiding (unfold)
|
||||
import qualified Data.Map as Map
|
||||
import qualified Data.Set as Set
|
||||
import Test.Hspec
|
||||
@ -17,6 +17,10 @@ import Test.QuickCheck
|
||||
newtype ArbitraryTerm a annotation = ArbitraryTerm (annotation, (Syntax a (ArbitraryTerm a annotation)))
|
||||
deriving (Show, Eq)
|
||||
|
||||
unTerm :: ArbitraryTerm a annotation -> Term a annotation
|
||||
unTerm arbitraryTerm = unfold unpack arbitraryTerm
|
||||
where unpack (ArbitraryTerm (annotation, syntax)) = (annotation, syntax)
|
||||
|
||||
newtype ArbitrarySyntax a f = ArbitrarySyntax { unSyntax :: Syntax a f }
|
||||
deriving (Show, Eq)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user