Filter out results of type "A = A"
This commit is contained in:
parent
60c2c2fe6d
commit
10ab319620
2 changed files with 6 additions and 2 deletions
|
|
@ -36,4 +36,8 @@ displayDefs :: [Def T.Text] -> T.Text
|
||||||
displayDefs = T.intercalate "\n" . map displayDef
|
displayDefs = T.intercalate "\n" . map displayDef
|
||||||
|
|
||||||
displayResult :: Map.Map T.Text (Term T.Text) -> T.Text
|
displayResult :: Map.Map T.Text (Term T.Text) -> T.Text
|
||||||
displayResult = T.intercalate "\n" . map (\(k, v) -> k <> " = " <> displayTerm v) . Map.assocs
|
displayResult
|
||||||
|
= T.intercalate "\n"
|
||||||
|
. map (\(k, v) -> k <> " = " <> displayTerm v)
|
||||||
|
. filter (\(k, v) -> v /= Var k)
|
||||||
|
. Map.assocs
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import qualified Data.Text as T
|
||||||
data Term a
|
data Term a
|
||||||
= Var a
|
= Var a
|
||||||
| Stat T.Text [Term a]
|
| Stat T.Text [Term a]
|
||||||
deriving (Show)
|
deriving (Show, Eq)
|
||||||
|
|
||||||
instance Functor Term where
|
instance Functor Term where
|
||||||
fmap f (Var a) = Var $ f a
|
fmap f (Var a) = Var $ f a
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue