
6 Jan
2009
6 Jan
'09
3:33 a.m.
Nice. Good solution. ``imperative style'' is not a bad idea when I'm not used to the ``pure functional style''
E.g.
filename <- return $ combine filename "Makefile"
Similar to the other imperative language
filename = joinPath(filename,"Makefile")
I wouldn't consider it particularly imperative, it's just variable shadowing. It desugars to calling a function with a parameter that shadows the old variable. Of course, you could say a more functional way would be to use pointfree style or just nested calls to avoid naming the intermediate values. Then you can't intersperse IO actions... but it's good to avoid doing that anyway.