Is there a way of shortening fat-arrow functions?
Use Recursion

I've found that recursion is (almost) always shorter than eval+for. The general way to convert from for to eval is:

for(a=n;b;c);d
(f=a=&gt;b?f(c):d)(n)


So let's see your example:

b=&gt;{m=b;for(a=1;~-m;)--m,a*=m*m;return a%b}


We can first simplify it to:

for(m=b,a=1;~-m;--m,a*=m*m)a%b;


What did we do here? Well we simply moved everything inside the for statement, this helps us reduce the amount of semicolons which is not directly better but almost always leads to some golf.



Let's put this in eval and compare it to the recursion version:

b=&gt;{m=b;for(a=1;~-m;)--m,a*=m*m;return a%b}
b=&gt;eval('for(m=b,a=1;~-m;--m,a*=m*m)a%b')
b=&gt;(f=a=&gt;~-m?(--m,f(a*=m*m)):a%b)(1,m=b)


The first part of the for loop (a=n), we can start that off by passing those variables in as arguments. The condition is simply: b?(c,f(a)):d where d is the return value. Usually c just modifies a so it can be merged into it. So we can golf it even more using what I've mentioned:

b=&gt;(f=a=&gt;~-m?(--m,f(a*=m*m)):a%b)(1,m=b)
b=&gt;(f=a=&gt;~-m?f(a*=--m*m):a%b)(1,m=b) // --m moved into a*=
b=&gt;(f=a=&gt;--m?f(a*=m*m):a%b)(1,m=b) // --m moved to condition


That said, as noted by @Niel is simplifying your algorithm. An algorithm golfy in one language may not be golfy in another so make sure to try different algoriths and compare them.