Add some comments
This commit is contained in:
parent
659f1a9d33
commit
adebcdd26c
1 changed files with 3 additions and 0 deletions
|
|
@ -110,6 +110,8 @@ unifyTerms t1 t2 = do
|
||||||
lift $ guard $ length t1 == length t2
|
lift $ guard $ length t1 == length t2
|
||||||
sequenceA_ $ zipWith unify t1 t2
|
sequenceA_ $ zipWith unify t1 t2
|
||||||
|
|
||||||
|
-- Figuring out how to display the result of the unification
|
||||||
|
|
||||||
varNames :: [T.Text]
|
varNames :: [T.Text]
|
||||||
varNames = do
|
varNames = do
|
||||||
num <- "" : map (T.pack . show) [(1::Integer)..]
|
num <- "" : map (T.pack . show) [(1::Integer)..]
|
||||||
|
|
@ -139,6 +141,7 @@ resolveVars t = do
|
||||||
args2 <- traverse resolveVars args
|
args2 <- traverse resolveVars args
|
||||||
pure $ Stat name args2
|
pure $ Stat name args2
|
||||||
|
|
||||||
|
-- | Helper type so I can resolve variables in multiple terms simultaneously.
|
||||||
newtype Terms a = Terms { unTerms :: [Term a] }
|
newtype Terms a = Terms { unTerms :: [Term a] }
|
||||||
|
|
||||||
instance Functor Terms where
|
instance Functor Terms where
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue