
Ah, yes. That's more than I could take on now, but sounds like the right way to do lifting. / Emil Den 2018-01-12 kl. 13:17, skrev Simon Peyton Jones:
Indeed. Moreover there is nothing unsafe about this, so I'd like to see this done without using unsafe-anything.
To do this, the Lift class would need to change, from
class Lift t where lift :: t -> Q Exp
to
class Lift t where lift :: t -> Q (TExp t)
This would take a bit of work, but it looks to me as if it would be a Good Thing. Maybe someone could write up a design?
Simon
| -----Original Message----- | From: Libraries [mailto:libraries-bounces@haskell.org] On Behalf Of | Emil Axelsson | Sent: 12 January 2018 10:48 | To: Haskell Libraries
| Subject: Proposal: Lifting to TExpQ | | Hi! | | I wasn't able to find a function like this anywhere: | | liftT :: Lift a => a -> TExpQ a | liftT = unsafeTExpCoerce . lift | | It seems like a nice addition that would reduce the need for | `unsafeTExpCoerce` in user code. | | Should it be added? | | / Emil | _______________________________________________ | Libraries mailing list | Libraries@haskell.org | https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.h | askell.org%2Fcgi- | bin%2Fmailman%2Flistinfo%2Flibraries&data=02%7C01%7Csimonpj%40microsof | t.com%7C3f68f4551f724d2d8cfa08d559a9f13b%7C72f988bf86f141af91ab2d7cd01 | 1db47%7C1%7C0%7C636513508787847030&sdata=FUvPD77GrLn%2Bkc3ZUwfinQacU8p | s00oXFvfI6VhoD1Q%3D&reserved=0