Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
lelf
on June 20, 2019
|
parent
|
context
|
favorite
| on:
Math.Round opens the browser print dialog
You cannot “window.print” in a Float32→Float32 function. It just won’t compile.
jakear
on June 20, 2019
|
next
[–]
But of course, the function in question isn’t Math.Round. It’s “interpretDotNetFunction”. Which is, necessarily, “string -> IO ()” (forgive my syntax).
gmfawcett
on June 20, 2019
|
prev
|
next
[–]
You could make it compile in Haskell. You just shouldn't:
f x = unsafePerformIO $ print "boom" >> return (pi * x)
H8crilA
on June 20, 2019
|
prev
|
next
[–]
In what language?
pathikrit
on June 20, 2019
|
parent
|
next
[–]
Haskell
tedunangst
on June 20, 2019
|
prev
[–]
You can't console.log either...
drdaeman
on June 20, 2019
|
parent
[–]
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: