Skip to content

Commit

Permalink
Comments with clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
SophieBosio committed Apr 7, 2024
1 parent 1854445 commit 81580c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Analysis/Unification.hs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ instance Monoid (Substitution meta a) where
substitutes :: Pattern a -> Pattern a -> Substitution Pattern a
substitutes p x = Substitution $ return $ x `mapsTo` p


-- Subsitution helpers
substituteName :: Show a => X -> Term a -> (Term a -> Term a)
substituteName x t v = -- computes t[v/x]
case t of
Expand Down
2 changes: 1 addition & 1 deletion src/Semantics/PartialEvaluator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ partial ns (Let p t1 t2 a) =
NoMatch -> error $ "Couldn't unify '" ++ show p ++
"' against '" ++ show t1 ++ "'."
else return $ Let p' t1' t2 a
-- Specialise named function
-- Specialise named function (denoted by a variable name)
partial ns (Application t1@(Pattern (Variable x _)) t2 a) =
do t2' <- partial ns t2
env <- ask
Expand Down

0 comments on commit 81580c4

Please sign in to comment.