@@ -817,8 +817,8 @@ data PTerm = PQuote Raw -- ^ Inclusion of a core term into the high-level langua
817 | PInferRef FC Name -- ^ A name to be defined later
817 | PInferRef FC Name -- ^ A name to be defined later
818 | PPatvar FC Name -- ^ A pattern variable
818 | PPatvar FC Name -- ^ A pattern variable
819 | PLam FC Name FC PTerm PTerm -- ^ A lambda abstraction. Second FC is name span.
819 | PLam FC Name FC PTerm PTerm -- ^ A lambda abstraction. Second FC is name span.
820− | PPi Plicity Name FC PTerm PTerm -- ^ (n : t1) -> t2, where the FC is for the variable
820+ | PPi Plicity Name FC PTerm PTerm -- ^ (n : t1) -> t2, where the FC is for the precise location of the variable
821− | PLet FC Name PTerm PTerm PTerm -- ^ A let binding
821+ | PLet FC Name FC PTerm PTerm PTerm -- ^ A let binding (second FC is precise name location)
822 | PTyped PTerm PTerm -- ^ Term with explicit type
822 | PTyped PTerm PTerm -- ^ Term with explicit type
823 | PApp FC PTerm [PArg] -- ^ e.g. IO (), List Char, length x
823 | PApp FC PTerm [PArg] -- ^ e.g. IO (), List Char, length x
824 | PAppImpl PTerm [ImplicitInfo] -- ^ Implicit argument application (introduced during elaboration only)
824 | PAppImpl PTerm [ImplicitInfo] -- ^ Implicit argument application (introduced during elaboration only)
@@ -869,7 +869,7 @@ mapPT :: (PTerm -> PTerm) -> PTerm -> PTerm
869mapPT f t = f (mpt t) where
869mapPT f t = f (mpt t) where
870 mpt (PLam fc n nfc t s) = PLam fc n nfc (mapPT f t) (mapPT f s)
870 mpt (PLam fc n nfc t s) = PLam fc n nfc (mapPT f t) (mapPT f s)
871 mpt (PPi p n nfc t s) = PPi p n nfc (mapPT f t) (mapPT f s)
871 mpt (PPi p n nfc t s) = PPi p n nfc (mapPT f t) (mapPT f s)
872− mpt (PLet fc n ty v s) = PLet fc n (mapPT f ty) (mapPT f v) (mapPT f s)
872+ mpt (PLet fc n nfc ty v s) = PLet fc n nfc (mapPT f ty) (mapPT f v) (mapPT f s)
873 mpt (PRewrite fc t s g) = PRewrite fc (mapPT f t) (mapPT f s)
873 mpt (PRewrite fc t s g) = PRewrite fc (mapPT f t) (mapPT f s)
874 (fmap (mapPT f) g)
874 (fmap (mapPT f) g)
875 mpt (PApp fc t as) = PApp fc (mapPT f t) (map (fmap (mapPT f)) as)
875 mpt (PApp fc t as) = PApp fc (mapPT f t) (map (fmap (mapPT f)) as)
@@ -959,7 +959,7 @@ type PTactic = PTactic' PTerm
959data PDo' t = DoExp FC t
959data PDo' t = DoExp FC t
960 | DoBind FC Name FC t -- ^ second FC is precise name location
960 | DoBind FC Name FC t -- ^ second FC is precise name location
961 | DoBindP FC t t [(t,t)]
961 | DoBindP FC t t [(t,t)]
962− | DoLet FC Name t t
962+ | DoLet FC Name FC t t -- ^ second FC is precise name location
963 | DoLetP FC t t
963 | DoLetP FC t t
964 deriving (Eq, Functor, Data, Typeable)
964 deriving (Eq, Functor, Data, Typeable)
@@ -971,7 +971,7 @@ instance Sized a => Sized (PDo' a) where
971 size (DoExp fc t) = 1 + size fc + size t
971 size (DoExp fc t) = 1 + size fc + size t
972 size (DoBind fc nm nfc t) = 1 + size fc + size nm + size nfc + size t
972 size (DoBind fc nm nfc t) = 1 + size fc + size nm + size nfc + size t
973 size (DoBindP fc l r alts) = 1 + size fc + size l + size r + size alts
973 size (DoBindP fc l r alts) = 1 + size fc + size l + size r + size alts
974− size (DoLet fc nm l r) = 1 + size fc + size nm + size l + size r
974+ size (DoLet fc nm nfc l r) = 1 + size fc + size nm + size l + size r
975 size (DoLetP fc l r) = 1 + size fc + size l + size r
975 size (DoLetP fc l r) = 1 + size fc + size l + size r
977type PDo = PDo' PTerm
977type PDo = PDo' PTerm
@@ -1028,7 +1028,7 @@ highestFC (PInferRef fc _) = Just fc
1028highestFC (PPatvar fc _) = Just fc
1028highestFC (PPatvar fc _) = Just fc
1029highestFC (PLam fc _ _ _ _) = Just fc
1029highestFC (PLam fc _ _ _ _) = Just fc
1030highestFC (PPi _ _ _ _ _) = Nothing
1030highestFC (PPi _ _ _ _ _) = Nothing
1031−highestFC (PLet fc _ _ _ _) = Just fc
1031+highestFC (PLet fc _ _ _ _ _) = Just fc
1032highestFC (PTyped tm ty) = highestFC tm <|> highestFC ty
1032highestFC (PTyped tm ty) = highestFC tm <|> highestFC ty
1033highestFC (PApp fc _ _) = Just fc
1033highestFC (PApp fc _ _) = Just fc
1034highestFC (PAppBind fc _ _) = Just fc
1034highestFC (PAppBind fc _ _) = Just fc
@@ -1061,7 +1061,7 @@ highestFC (PDoBlock lines) =
1061 getDoFC (DoExp fc t) = fc
1061 getDoFC (DoExp fc t) = fc
1062 getDoFC (DoBind fc nm nfc t) = fc
1062 getDoFC (DoBind fc nm nfc t) = fc
1063 getDoFC (DoBindP fc l r alts) = fc
1063 getDoFC (DoBindP fc l r alts) = fc
1064− getDoFC (DoLet fc nm l r) = fc
1064+ getDoFC (DoLet fc nm nfc l r) = fc
1065 getDoFC (DoLetP fc l r) = fc
1065 getDoFC (DoLetP fc l r) = fc
1067highestFC (PIdiom fc _) = Just fc
1067highestFC (PIdiom fc _) = Just fc
@@ -1455,7 +1455,7 @@ pprintPTerm ppo bnd docArgs infixes = prettySe startPrec bnd
1455 bracket p startPrec . group . align . hang 2 $
1455 bracket p startPrec . group . align . hang 2 $
1456 text "\\" <> prettyBindingOf n False <+> text "=>" <$>
1456 text "\\" <> prettyBindingOf n False <+> text "=>" <$>
1457 prettySe startPrec ((n, False):bnd) sc
1457 prettySe startPrec ((n, False):bnd) sc
1458− prettySe p bnd (PLet fc n ty v sc) =
1458+ prettySe p bnd (PLet fc n nfc ty v sc) =
1459 bracket p startPrec . group . align $
1459 bracket p startPrec . group . align $
1460 kwd "let" <+> (group . align . hang 2 $ prettyBindingOf n False <+> text "=" <$> prettySe startPrec bnd v) </>
1460 kwd "let" <+> (group . align . hang 2 $ prettyBindingOf n False <+> text "=" <$> prettySe startPrec bnd v) </>
1461 kwd "in" <+> (group . align . hang 2 $ prettySe startPrec ((n, False):bnd) sc)
1461 kwd "in" <+> (group . align . hang 2 $ prettySe startPrec ((n, False):bnd) sc)
@@ -1874,7 +1874,7 @@ instance Sized PTerm where
1874 size (PRef fc name) = size name
1874 size (PRef fc name) = size name
1875 size (PLam fc name _ ty bdy) = 1 + size ty + size bdy
1875 size (PLam fc name _ ty bdy) = 1 + size ty + size bdy
1876 size (PPi plicity name fc ty bdy) = 1 + size ty + size fc + size bdy
1876 size (PPi plicity name fc ty bdy) = 1 + size ty + size fc + size bdy
1877− size (PLet fc name ty def bdy) = 1 + size ty + size def + size bdy
1877+ size (PLet fc name nfc ty def bdy) = 1 + size ty + size def + size bdy
1878 size (PTyped trm ty) = 1 + size trm + size ty
1878 size (PTyped trm ty) = 1 + size trm + size ty
1879 size (PApp fc name args) = 1 + size args
1879 size (PApp fc name args) = 1 + size args
1880 size (PAppBind fc name args) = 1 + size args
1880 size (PAppBind fc name args) = 1 + size args
@@ -1949,7 +1949,7 @@ boundNamesIn tm = S.toList (ni S.empty tm)
1949 ni set (PCase _ c os) = niTms (ni set c) (map snd os)
1949 ni set (PCase _ c os) = niTms (ni set c) (map snd os)
1950 ni set (PIfThenElse _ c t f) = niTms set [c, t, f]
1950 ni set (PIfThenElse _ c t f) = niTms set [c, t, f]
1951 ni set (PLam fc n _ ty sc) = S.insert n $ ni (ni set ty) sc
1951 ni set (PLam fc n _ ty sc) = S.insert n $ ni (ni set ty) sc
1952− ni set (PLet fc n ty val sc) = S.insert n $ ni (ni (ni set ty) val) sc
1952+ ni set (PLet fc n nfc ty val sc) = S.insert n $ ni (ni (ni set ty) val) sc
1953 ni set (PPi p n _ ty sc) = niTacImp (S.insert n $ ni (ni set ty) sc) p
1953 ni set (PPi p n _ ty sc) = niTacImp (S.insert n $ ni (ni set ty) sc) p
1954 ni set (PEq _ _ _ l r) = ni (ni set l) r
1954 ni set (PEq _ _ _ l r) = ni (ni set l) r
1955 ni set (PRewrite _ l r _) = ni (ni set l) r
1955 ni set (PRewrite _ l r _) = ni (ni set l) r