Make lambdaArgs query return full arguments and not just names.
diff --git a/src/Lambda.hs b/src/Lambda.hs
index 93b7381..77e5861 100644
--- a/src/Lambda.hs
+++ b/src/Lambda.hs
@@ -32,8 +32,13 @@
------------------------------------------------------------------------------
lambdaArgs :: String -> String
lambdaArgs code = case parseExp code of
- ParseOk ast -> extractLambdaArgs ast
+ ParseOk ast -> prettyLambdaArgs ast
_ -> "[]"
+ where
+ prettyLambdaArgs = trim
+ . takeWhile (/= '-')
+ . dropWhile (== '\\')
+ . prettyPrint
------------------------------------------------------------------------------
extractLambdaArgs :: Exp -> String
@@ -88,3 +93,17 @@
pkgConfigPath
cabalFilePath
buildTargetName
+
+
+------------------------------------------------------------------------------
+
+trim :: [Char] -> [Char]
+trim xs = dropSpaceTail "" $ dropWhile isSpace xs
+
+dropSpaceTail :: [Char] -> [Char] -> [Char]
+dropSpaceTail _ "" = ""
+dropSpaceTail maybeStuff (x:xs)
+ | isSpace x = dropSpaceTail (x:maybeStuff) xs
+ | null maybeStuff = x : dropSpaceTail "" xs
+ | otherwise = reverse maybeStuff ++ x : dropSpaceTail "" xs
+