Created
February 24, 2020 16:04
-
-
Save chrisdone/8d4cd1f8c12475a6b688a53c6ba71322 to your computer and use it in GitHub Desktop.
Applicative TH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
applicative :: Q Exp -> [Q Exp] -> Q Exp | |
applicative cons [] = [| pure $(cons) |] | |
applicative cons (x:ys) = foldl (\inner y -> [| $(inner) <*> $(y) |]) [|$(cons) <$> $(x)|] ys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment