[Haskell-cafe] Difference between div and /

Aaron D. Ball aarondball+haskell at gmail.com
Tue Jun 1 15:20:27 EDT 2010


> What does (stdin + stderr) `mod` stdout mean (result will be stdin).

In my GHCi (6.12.1) with System.IO, this fails because Handle is not a
numeric type.  What implementation are you using?

The underlying object here is a Unix file descriptor, which is just a
number.  In that sense, stdin is 0, stdout is 1, and stderr is 2, so
this would be (0 + 2) (mod 1) = 0.


More information about the Haskell-Cafe mailing list