Could this be improved using template haskell quasi-quotes/splices/etc without changing the type?

predFuse :: Exp -> Exp -> Exp
predFuse p' q' = let
x = mkName "x"
p = mkName "p"
q = mkName "q"
l = LamE [VarP p,VarP q,VarP x] (InfixE (Just (AppE (VarE p) (VarE x))) (VarE '(&&)) (Just (AppE (VarE q) (VarE x))))
in AppE (AppE l p') q'

I’m now fairly sure this is impossible. I must bow down and accept Q into my heart

Show thread

Someone on Reddit pointed out there’s always unsafePerformIO

Sign in to participate in the conversation social after-party social