parse/unparse test
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
{-# LANGUAGE OverloadedStrings, LambdaCase, GeneralisedNewtypeDeriving #-}
|
||||
module CoreSyntax
|
||||
( ProgramSrc(..)
|
||||
, (~==)
|
||||
, congruentSrc
|
||||
, unparseCoreProg
|
||||
)
|
||||
@@ -203,12 +202,8 @@ ws1 = elements [" ", " "]
|
||||
|
||||
-- | Two bodies of source code are considered congruent iff the parser produces
|
||||
-- identical ASTs for both.
|
||||
(~==) :: ProgramSrc -> ProgramSrc -> Bool
|
||||
(~==) = (==) `on` (justParseSrc . T.unpack . coerce)
|
||||
|
||||
-- | Prefix synonym for @(~==)@
|
||||
congruentSrc :: ProgramSrc -> ProgramSrc -> Bool
|
||||
congruentSrc = (~==)
|
||||
congruentSrc = (==) `on` (justParseSrc . T.unpack . coerce)
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user