3 ms·
This example is very contrived, but challenge accepted.. main = do let print = putStr . (++ " ") in do print "happy" print "holidays
by joeyh 9y ago
This example is very contrived, but challenge accepted..
main = do
let print = putStr . (++ " ") in do
print "happy"
print "holidays" -- indentation sensitive
putStrLn "!"
De-indenting the marked line by 2 spaces exposes some scroogey irony.
(Note that compiler warnings give a hint about the bad idea in this code, but nested do's can have this problem without warnings also.)
- avmich 9y agoI'm not sure that's what GP meant. I understood what he said as "it's hard to write code which correct in logic, types, and which passes correct beautifier which changes logic", and I'd think this is impossible. The example you gave requires to change logic - because indentation is a part of the logic here.