mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 00:13:12 +03:00
king: properly mark named I hope in th
This commit is contained in:
parent
0c96d9d6e8
commit
11d18a7026
@ -107,12 +107,14 @@ addErrTag :: String -> Exp -> Exp
|
||||
addErrTag tag exp =
|
||||
-- This spurious let is inserted so we can get better cost center data
|
||||
-- during heap profiling.
|
||||
LetE [ValD (VarP nom) (NormalB bod) []] (VarE nom)
|
||||
LetE [ValD (VarP nom) (NormalB nam) []]
|
||||
$ InfixE (Just $ VarE nom) (VarE (mkName ".")) (Just exp)
|
||||
where
|
||||
-- XX arguably we should use newName rather than mkName here
|
||||
nom = mkName $ "named_" ++ filter C.isAlphaNum tag
|
||||
str = LitE $ StringL tag
|
||||
bod = InfixE (Just $ AppE (VarE 'named) str) (VarE (mkName ".")) (Just exp)
|
||||
nam = LamE [VarP $ mkName "x"] $ AppE (AppE (VarE 'named) str)
|
||||
$ VarE (mkName "x")
|
||||
|
||||
deriveFromNoun :: Name -> Q [Dec]
|
||||
deriveFromNoun tyName = do
|
||||
|
Loading…
Reference in New Issue
Block a user