fork download
  1. dec2bin n = if n<=1 then 1 else dec2bin(div n 2)*10+(mod n 2)
  2.  
  3. main = do
  4.  
  5. print(dec2bin 6)
Success #stdin #stdout 0s 5320KB
stdin
1
2
10
42
11
stdout
110