on master help sign in
Add a specialized version of (>>) in type unification

But it does not seem like it's a big deal.

commit0d548908743cc7c96c135fb74b19b1b5d52c93df authorEvan Czaplicki <evancz@users.noreply.github.com> dateWed 5 Jun 2019, 11:11 (7 years ago) parent9d20d60
1 file changed+8
compiler/src/Type/Unify.hs+8
compiler/src/Type/Unify.hs+8
@@ -90,6 +90,7 @@ instance Applicative Unify where
9090
9191
9292instance Monad Unify where
93+ -- TODO PERF add INLINE here?
9394 return a =
9495 Unify $ \vars ok _ ->
9596 ok vars a
@@ -103,6 +104,13 @@ instance Monad Unify where
103104 in
104105 ka vars ok1 err
105106
107+ (>>) (Unify ka) (Unify kb) =
108+ Unify $ \vars ok err ->
109+ let
110+ ok1 vars1 _ = kb vars1 ok err
111+ in
112+ ka vars ok1 err
113+
106114
107115register :: IO Variable -> Unify Variable
108116register mkVar =