Related to a question asked in #haskell, where all the answers flowed but basically none was really right, i post the question here.
Is there any function f (possibly without involving TemplateHaskell) such as:
f (+) == "+"
f f == "f"
f putStrLn == "putStrLn"
ie, a function that, given a function in the scope as an input, retrieves the name of that function.
In Text.Show.Functions, there is:
instance Show (a -> b)
But here's the only thing it does:
λ show (+)
"<function>"
λ show show
"<function>"
λ show putStrLn
"<function>"