Convert pointfree to pointful Being a Haskell hacker, I prefer pointfree notation over pointful. Unfortunately some people find pointfree notation hard to read, and I find it hard to get the correct number of parentheses when I write in pointful.
Help me convert code written in pointfree to pointful notation!

About

In pointfree notation we use points (yes, really) to feed the output of one function into another. Say, if you had a function succ that takes a number and adds 1 to it, and you wanted to make a function that adds 3 to a number, instead of doing this:

\x -&gt; succ(succ(succ(x)))


you could do this:

succ.succ.succ


Pointfree only works with functions that take a single parameter however (in this challenge anyway), so if our function wasn't succ but rather add which take 2 numbers and adds them together, we would have to feed it arguments until there is only one left:

pointful:  \x -&gt; add 1(add 1(add 1 x)) 
pointfree: add 1 . add 1 . add 1


Lastly, functions may take other functions as arguments:

Pointfree: map (f a . f b) . id
Pointful:  \x -&gt; map (\x -&gt; f a (f b x)) (id x)

Javascript equivalent: x =&gt; map (x =&gt; f(a,f(b,x)), id(x))


Input and expected output

f . f . f
\x -&gt; f (f (f x))

f a . f b . f c
\x -&gt; f a (f b (f c x))

f (f a . f b) . f c
\x -&gt; f (\x -&gt; f a (f b x)) (f c x)

a b c . d e . f g h i . j k l . m
\x -&gt; a b c (d e (f g h i (j k l (m x))))

a.b(c.d)e.f g(h)(i j.k).l(m(n.o).p)
\x-&gt;a(b(\y-&gt;c(d y))e(f g h(\z-&gt;i j(k z))(l(\q-&gt;m(\w-&gt;n(o w))(p q))x)))


Rules


Your output may have more spaces or parentheses than required, as long as they are balanced
You don't have to make sure that the name of the variable you create \x isn't already used somewhere else in the code
It is your choice whether to create a function or a full program
This is codegolf, shortest code in bytes win!


You might find blunt useful, it converts between the two notations (but also factorizes the code when possible): https://blunt.herokuapp.com
Haskell, 163 142 133 bytes

p(x:r)|[a,b]&lt;-p r=case[x]of&quot;(&quot;-&gt;[&quot;(\\x-&gt;&quot;++a++p b!!0,&quot;&quot;];&quot;.&quot;-&gt;['(':a++&quot;)&quot;,b];&quot;)&quot;-&gt;[&quot; x)&quot;,r];_-&gt;[x:a,b]
p r=[r,r]
f s=p('(':s++&quot;)&quot;)!!0

Try it on Ideone.
Ungolfed:
p('(':r)|(a,b)&lt;-p r = (&quot;(\\x-&gt;&quot;++a++(fst(p b)),&quot;&quot;)
p('.':r)|(a,b)&lt;-p r = ('(':a++&quot;)&quot;,              b)
p(')':r)            = (&quot; x)&quot;,                   r)
p(x  :r)|(a,b)&lt;-p r = (x:a,                     b)
p _                 = (&quot;&quot;,                     &quot;&quot;)

f s=fst(p('(':s++&quot;)&quot;))