@@ -35,7 +35,7 @@ import qualified Data.Text as T
36import Debug.Trace
36import Debug.Trace
38−data ElabMode = ETyDecl | ELHS | ERHS
38+data ElabMode = ETyDecl | ETransLHS | ELHS | ERHS
39 deriving Eq
39 deriving Eq
@@ -220,7 +220,7 @@ elab ist info emode opts fn tm
220 sequence_ (get_delayed_elab est)
220 sequence_ (get_delayed_elab est)
221 end_unify
221 end_unify
222 ptm <- get_term
222 ptm <- get_term
223− when pattern -- convert remaining holes to pattern vars
223+ when (pattern || intransform) -- convert remaining holes to pattern vars
224 (do update_term orderPats
224 (do update_term orderPats
225 unify_all
225 unify_all
226 matchProblems False -- only the ones we matched earlier
226 matchProblems False -- only the ones we matched earlier
@@ -228,7 +228,8 @@ elab ist info emode opts fn tm
230 pattern = emode == ELHS
230 pattern = emode == ELHS
231+ intransform = emode == ETransLHS
231− bindfree = emode == ETyDecl || emode == ELHS
232+ bindfree = emode == ETyDecl || emode == ELHS || emode == ETransLHS
233 get_delayed_elab est =
234 get_delayed_elab est =
234 let ds = delayed_elab est in
235 let ds = delayed_elab est in
@@ -489,7 +490,7 @@ elab ist info emode opts fn tm
489 = lift $ tfail $ Msg ("No explicit types on left hand side: " ++ show tm)
490 = lift $ tfail $ Msg ("No explicit types on left hand side: " ++ show tm)
490 | pattern && not reflection && not (e_qq ec) && e_nomatching ec
491 | pattern && not reflection && not (e_qq ec) && e_nomatching ec
491 = lift $ tfail $ Msg ("Attempting concrete match on polymorphic argument: " ++ show tm)
492 = lift $ tfail $ Msg ("Attempting concrete match on polymorphic argument: " ++ show tm)
492− | (pattern || (bindfree && bindable n)) && not (inparamBlock n) && not (e_qq ec)
493+ | (pattern || intransform || (bindfree && bindable n)) && not (inparamBlock n) && not (e_qq ec)
493 = do let ina = e_inarg ec
494 = do let ina = e_inarg ec
494 guarded = e_guarded ec
495 guarded = e_guarded ec
495 inty = e_intype ec
496 inty = e_intype ec
@@ -500,7 +501,7 @@ elab ist info emode opts fn tm
500 _ -> True
501 _ -> True
501 -- this is to stop us resolve type classes recursively
502 -- this is to stop us resolve type classes recursively
502 -- trace (show (n, guarded)) $
503 -- trace (show (n, guarded)) $
503− if (tcname n && ina)
504+ if (tcname n && ina && not intransform)
504 then erun fc $
505 then erun fc $
505 do patvar n
506 do patvar n
506 update_term liftPats
507 update_term liftPats
@@ -611,7 +612,7 @@ elab ist info emode opts fn tm
611 ivs' <- get_instances
612 ivs' <- get_instances
612 env <- get_env
613 env <- get_env
613 elabE (ina { e_inarg = True }) (Just fc) sc
614 elabE (ina { e_inarg = True }) (Just fc) sc
614− when (not pattern) $
615+ when (not (pattern || intransform)) $
615 mapM_ (\n -> do focus n
616 mapM_ (\n -> do focus n
616 g <- goal
617 g <- goal
617 hs <- get_holes
618 hs <- get_holes
@@ -799,7 +800,7 @@ elab ist info emode opts fn tm
799 -- to be needed.
800 -- to be needed.
800 implicitApp :: ElabD [ImplicitInfo] -> ElabD ()
801 implicitApp :: ElabD [ImplicitInfo] -> ElabD ()
801 implicitApp elab
802 implicitApp elab
802− | pattern = do elab; return ()
803+ | pattern || intransform = do elab; return ()
803 | otherwise
804 | otherwise
804 = do s <- get
805 = do s <- get
805 imps <- elab
806 imps <- elab