@@ -1,4 +1,4 @@
1−{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
1+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, PatternGuards #-}
3{- Implements a proof state, some primitive tactics for manipulating
3{- Implements a proof state, some primitive tactics for manipulating
4 proofs, and some high level commands for introducing new theorems,
4 proofs, and some high level commands for introducing new theorems,
@@ -144,12 +144,12 @@ tactic h f = do ps <- get
144 atH c env binder@(Bind n b sc)
144 atH c env binder@(Bind n b sc)
145 | hole b && same h n = f c env binder
145 | hole b && same h n = f c env binder
146 | otherwise
146 | otherwise
147− = pure Bind <*> pure n <*> atHb c env b <*> atH c ((n,b) : env) sc
147+ = liftM2 (Bind n) (atHb c env b) (atH c ((n, b) : env) sc)
148− atH c env (App f a) = pure App <*> atH c env f <*> atH c env a
148+ atH c env (App f a) = liftM2 App (atH c env f) (atH c env a)
149 atH c env t = return t
149 atH c env t = return t
151− atHb c env (Let t v) = pure Let <*> atH c env t <*> atH c env v
151+ atHb c env (Let t v) = liftM2 Let (atH c env t) (atH c env v)
152− atHb c env (Guess t v) = pure Guess <*> atH c env t <*> atH c env v
152+ atHb c env (Guess t v) = liftM2 Guess (atH c env t) (atH c env v)
153 atHb c env t = do ty' <- atH c env (binderTy t)
153 atHb c env t = do ty' <- atH c env (binderTy t)
154 return $ t { binderTy = ty' }
154 return $ t { binderTy = ty' }