Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You cannot “window.print” in a Float32→Float32 function. It just won’t compile.


But of course, the function in question isn’t Math.Round. It’s “interpretDotNetFunction”. Which is, necessarily, “string -> IO ()” (forgive my syntax).


You could make it compile in Haskell. You just shouldn't:

f x = unsafePerformIO $ print "boom" >> return (pi * x)


In what language?


Haskell


You can't console.log either...


There is Debug.Trace.trace which does the trick with unsafePerformIO (which is a special non-type-safe escape hatch for IO)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: