Logs: liberachat/#haskell
| 2021-07-25 16:05:39 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 2021-07-25 16:06:22 | → | drd joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) |
| 2021-07-25 16:07:21 | × | zebrag quits (~chris@user/zebrag) (Remote host closed the connection) |
| 2021-07-25 16:09:41 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds) |
| 2021-07-25 16:10:03 | → | zaquest joins (~notzaques@5.128.210.178) |
| 2021-07-25 16:10:13 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 2021-07-25 16:11:05 | × | drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Ping timeout: 268 seconds) |
| 2021-07-25 16:11:34 | → | zmt01 joins (~zmt00@user/zmt00) |
| 2021-07-25 16:11:44 | → | drd joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) |
| 2021-07-25 16:13:15 | → | slycelote joins (~slycelote@user/slycelote) |
| 2021-07-25 16:13:56 | → | zebrag joins (~chris@user/zebrag) |
| 2021-07-25 16:14:37 | × | drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Read error: Connection reset by peer) |
| 2021-07-25 16:16:30 | × | zebrag quits (~chris@user/zebrag) (Remote host closed the connection) |
| 2021-07-25 16:17:20 | × | dajoer quits (~david@user/gvx) (Quit: leaving) |
| 2021-07-25 16:18:55 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) |
| 2021-07-25 16:19:07 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-07-25 16:20:19 | → | drd joins (~drd@93-39-151-19.ip76.fastwebnet.it) |
| 2021-07-25 16:20:55 | <monochrom> | Type-aware optimizer may end up being two optimizers that are similar-yet-different enough that you have to write twice. |
| 2021-07-25 16:21:27 | × | drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Read error: Connection reset by peer) |
| 2021-07-25 16:21:45 | → | drd joins (~drd@93-39-151-19.ip76.fastwebnet.it) |
| 2021-07-25 16:21:55 | <monochrom> | There is something nice about "the optimizer for pure code works for IO code too if it sees a fictional data dependency". |
| 2021-07-25 16:21:58 | → | dunkeln joins (~dunkeln@94.129.69.87) |
| 2021-07-25 16:22:12 | <monochrom> | or code generator |
| 2021-07-25 16:22:41 | × | drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Client Quit) |
| 2021-07-25 16:24:46 | → | drd joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) |
| 2021-07-25 16:32:04 | × | lambdap quits (~lambdap@static.167.190.119.168.clients.your-server.de) (Quit: lambdap) |
| 2021-07-25 16:32:22 | → | lambdap joins (~lambdap@static.167.190.119.168.clients.your-server.de) |
| 2021-07-25 16:33:48 | × | curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 250 seconds) |
| 2021-07-25 16:34:39 | <arkanoid> | [x**2 | x <- [1,2,3,4,5]] returns floats. I see that ** accepts Fractional typeclass. Is there a pow operator for Integers? |
| 2021-07-25 16:34:59 | <monochrom> | ^ |
| 2021-07-25 16:35:12 | <arkanoid> | thanks! |
| 2021-07-25 16:37:22 | × | gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 2021-07-25 16:39:46 | × | dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 272 seconds) |
| 2021-07-25 16:40:59 | × | jespada quits (~jespada@90.254.247.46) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-07-25 16:41:14 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 2021-07-25 16:46:20 | × | nth quits (~LukeHoers@user/lukehoersten) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-07-25 16:46:26 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 2021-07-25 16:47:36 | × | drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Quit: ZNC 1.8.2 - https://znc.in) |
| 2021-07-25 16:48:23 | → | drd joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) |
| 2021-07-25 16:49:22 | × | drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Read error: Connection reset by peer) |
| 2021-07-25 16:49:34 | → | burnsidesLlama joins (~burnsides@client-8-87.eduroam.oxuni.org.uk) |
| 2021-07-25 16:49:58 | → | drd joins (~drd@93-39-151-19.ip76.fastwebnet.it) |
| 2021-07-25 16:54:37 | <arkanoid> | How to deal with overflow errors when using Int? "let foo :: Int -> Int; foo x = x^1000", "foo 7" returns -5479429532463080511 . I'm learning haskell to do scientific calculations, and I'd like to ensure that these kind of problems would arise at least as warnings when importing libs |
| 2021-07-25 16:55:18 | × | burnsidesLlama quits (~burnsides@client-8-87.eduroam.oxuni.org.uk) (Ping timeout: 276 seconds) |
| 2021-07-25 16:55:31 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-07-25 16:56:22 | ← | abbie parts (~abbie@offtopia/offtopian/abbie) (Bye!) |
| 2021-07-25 16:56:58 | <arkanoid> | I mean, I would use Integer for my own functions, but what about if external module uses Int and returned values overflows without a warning? |
| 2021-07-25 16:57:46 | <jumper149> | arkanoid: Well, if it's an external module I don't see any way to fix it. |
| 2021-07-25 16:57:47 | × | Maxdamantus quits (~Maxdamant@user/maxdamantus) (Ping timeout: 255 seconds) |
| 2021-07-25 16:58:41 | → | mr-red joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) |
| 2021-07-25 16:59:24 | <nitrix> | You cannot deal with the overflow once it happened. You have to check for the _would be_ overflow before hand. |
| 2021-07-25 16:59:26 | × | mr-red quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Client Quit) |
| 2021-07-25 16:59:33 | <arkanoid> | this is surprising |
| 2021-07-25 16:59:56 | → | mr-red joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) |
| 2021-07-25 17:00:15 | <nitrix> | What were your expectations? You seem to be fairly aware of that behavior. |
| 2021-07-25 17:00:30 | × | drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 276 seconds) |
| 2021-07-25 17:00:43 | <lbseale> | Would the Scientific type help you? https://hackage.haskell.org/package/scientific-0.3.7.0/docs/Data-Scientific.html |
| 2021-07-25 17:01:24 | → | dunkeln joins (~dunkeln@94.129.69.87) |
| 2021-07-25 17:01:48 | × | turlando quits (~turlando@user/turlando) (Remote host closed the connection) |
| 2021-07-25 17:02:17 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 2021-07-25 17:02:41 | <arkanoid> | I'm aware of it, and I can deal with it within my own code, but this lack of error control or warning makes importing modules unsafe unless checking every internal machinery |
| 2021-07-25 17:05:07 | → | jespada joins (~jespada@90.254.247.46) |
| 2021-07-25 17:05:58 | <Cale> | Hecate: I'm not even really opposed to undecidable instances, it's the overlapping ones where things start to get bad. Undecidable ones, the worst that will happen is your build won't finish. |
| 2021-07-25 17:06:13 | <Cale> | (but the cat is funny :) |
| 2021-07-25 17:06:39 | → | drd joins (~drd@93-39-151-19.ip76.fastwebnet.it) |
| 2021-07-25 17:06:54 | <davean> | Cale: Its troubling when it might be non-determistic, but yah |
| 2021-07-25 17:06:56 | × | pera quits (~pera@user/pera) (Ping timeout: 256 seconds) |
| 2021-07-25 17:07:53 | → | aliosablack joins (~chomwitt@ppp-94-67-193-120.home.otenet.gr) |
| 2021-07-25 17:07:59 | × | drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Client Quit) |
| 2021-07-25 17:08:04 | × | xff0x_ quits (~xff0x@port-92-195-69-103.dynamic.as20676.net) (Ping timeout: 256 seconds) |
| 2021-07-25 17:08:36 | <nitrix> | It's the behavior chosen for Int and also what distinguishes it from Integer. If the libraries have been using Int, then they presumably think that edge case wont happen or they're satisfied with the behavior. |
| 2021-07-25 17:08:46 | → | drd joins (~drd@93-39-151-19.ip76.fastwebnet.it) |
| 2021-07-25 17:09:47 | → | Maxdamantus joins (~Maxdamant@user/maxdamantus) |
| 2021-07-25 17:09:56 | × | chomwitt quits (~chomwitt@2a02:587:dc0e:ef00:12c3:7bff:fe6d:d374) (Ping timeout: 255 seconds) |
| 2021-07-25 17:10:15 | × | mr-red quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Ping timeout: 276 seconds) |
| 2021-07-25 17:11:33 | <arkanoid> | nitrix: but that's very unsafe |
| 2021-07-25 17:11:52 | → | aerona joins (~aerona@2600:6c54:4600:f300:2418:37e9:50f:bf32) |
| 2021-07-25 17:12:33 | <arkanoid> | also, have a look at https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic , the page is proving my point. It says |
| 2021-07-25 17:12:42 | <arkanoid> | Some programming languages such as Lisp, Python, Perl, Haskell and Ruby use, or have an option to use, arbitrary-precision numbers for all integer arithmetic. Although this reduces performance, it eliminates the possibility of incorrect results (or exceptions) due to simple overflow. |
| 2021-07-25 17:12:58 | <monochrom> | You know what, asm programmers have access to the "carry flag", they can know that overflow has happened if they want to. |
| 2021-07-25 17:13:00 | <nitrix> | What is unsafe about it? There aren't side-effects and the program isn't halting. The arithmetic is defined to behave that way, it's predictable. |
| 2021-07-25 17:13:24 | <monochrom> | Then C goes on to throw away that information and starts a great tradition. |
| 2021-07-25 17:13:30 | <Cale> | Maybe we could have an erroring-Int |
| 2021-07-25 17:13:43 | <geekosaur> | also as I read that I think someone misunderstood "integer-simple" |
| 2021-07-25 17:13:45 | <Cale> | But Int is Z/2^kZ for some k |
| 2021-07-25 17:14:23 | <monochrom> | OTOH you look at the floating point world, they do have floating-point exceptions. Then people go on to suppress it and turn it into NaN. It's a mess either way. |
| 2021-07-25 17:14:38 | <arkanoid> | nitrix: not predictable, as overflow is not sign-checked. "let foo :: Int -> Int; foo x = x^1000", "foo 7" returns -5479429532463080511 |
| 2021-07-25 17:14:45 | <Cale> | The fact that k is unspecified and you have to look at maxBound or similar to figure out which ring you're working in is a bit silly. |
| 2021-07-25 17:15:04 | <nitrix> | arkanoid, Your argument boils down to "other languages have the option to ...", but ignore that Haskell has that option as well. |
| 2021-07-25 17:15:09 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-07-25 17:15:35 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 2021-07-25 17:16:11 | <Cale> | arkanoid: 7^1000 = -5479429532463080511 (mod 2^64) |
| 2021-07-25 17:17:45 | <Cale> | There is a bit of tension here though, I get where you're coming from. People use Int as though it were Integer but faster. |
| 2021-07-25 17:18:48 | <nitrix> | Choosing Int implies giving away the arbitrary precision and accepting the overflow behavior. |
| 2021-07-25 17:19:13 | <arkanoid> | Cale: I'm ok with using Integer in all my code, but I'm not ok in importing libraries that could return overflows without warnings or errors. |
| 2021-07-25 17:19:25 | <Cale> | Probably most users of Int don't really want modular arithmetic |
| 2021-07-25 17:19:37 | <Cale> | But that is indeed what they get |
| 2021-07-25 17:19:41 | <c_wraith> | Int is definitely *way* overused |
| 2021-07-25 17:20:35 | <nitrix> | The libraries where it matters don't make that mistake. I think arkanoid is hunting witches. |
| 2021-07-25 17:20:38 | <Cale> | On the other hand, I'm not sure I'd be happy if Int just threw exceptions. That's almost scarier. |
All times are in UTC.