Logs: freenode/#haskell
| 2021-03-26 14:55:21 | <merijn> | https://scholar.google.com/scholar?q=extensible+exceptions |
| 2021-03-26 14:55:37 | × | cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 3.1) |
| 2021-03-26 14:55:47 | × | azure1 quits (~azure@103.154.230.130) (Ping timeout: 248 seconds) |
| 2021-03-26 14:56:01 | × | bahamas quits (~lucian@unaffiliated/bahamas) (Quit: leaving) |
| 2021-03-26 14:56:07 | <merijn> | You can also try reverse engineering my example in https://github.com/merijn/Belewitte/blob/master/benchmark-analysis/src/Exceptions/Class.hs and the corresponding Exceptions.hs, but that comes with 0 warranties and could use some fixing |
| 2021-03-26 14:56:34 | <L29Ah> | We use cookies to ensure that we give you the best experience on our website. |
| 2021-03-26 14:56:35 | → | azure1 joins (~azure@103.154.230.130) |
| 2021-03-26 14:56:35 | <L29Ah> | Learn more |
| 2021-03-26 14:56:36 | <L29Ah> | It seems your browser doesn't support them and this affects the site functionality. |
| 2021-03-26 14:56:37 | <L29Ah> | lol thanks ACM |
| 2021-03-26 14:56:45 | <merijn> | L29Ah: Oh |
| 2021-03-26 14:56:50 | <merijn> | L29Ah: Never click the main link |
| 2021-03-26 14:56:54 | <L29Ah> | yeah |
| 2021-03-26 14:56:58 | <merijn> | Those always go to academic publishers and paywalls |
| 2021-03-26 14:57:07 | <merijn> | You want the PDF links on the right instead |
| 2021-03-26 14:57:27 | <merijn> | (or click all versions and scan those for pdfs) |
| 2021-03-26 14:57:32 | → | Neuromancer joins (~Neuromanc@unaffiliated/neuromancer) |
| 2021-03-26 14:58:13 | <dminuoso> | Exception hierarchies like Simon Marlow described is an art only few libraries seem to contain./. |
| 2021-03-26 14:58:29 | <dminuoso> | It seems, that Haskellers in general are not very good at IO exceptions. |
| 2021-03-26 14:58:33 | <dminuoso> | Perhaps we have given them too much power? |
| 2021-03-26 14:58:53 | <merijn> | dminuoso: Reading is hard :( |
| 2021-03-26 14:59:06 | <L29Ah> | thanks, just the thing i needed |
| 2021-03-26 14:59:13 | → | Sorny joins (~Sornaensi@79.142.232.102.static.router4.bolignet.dk) |
| 2021-03-26 14:59:39 | <dminuoso> | merijn: Perhaps there is something to be said about exception hierarchies as a first-class language feature.. |
| 2021-03-26 14:59:59 | <dminuoso> | If you have to read a paper to learn about the idiom, then that makes adoption much harder.. |
| 2021-03-26 15:00:05 | <c_wraith> | The utility isn't that high in general. 99% of the time, a single exception type per library suffices. I'm not going to dig into internals of your library to care why it failed in most cases. I just want to know what library failed. |
| 2021-03-26 15:00:27 | <Lycurgus> | semantic clash between practical computing and purism |
| 2021-03-26 15:00:56 | <Lycurgus> | result in the typical antipattern of simple thing fuggled |
| 2021-03-26 15:01:49 | <Lycurgus> | verwickelt, flubbed, usw |
| 2021-03-26 15:01:53 | × | Sorna quits (~Sornaensi@077213203030.dynamic.telenor.dk) (Ping timeout: 246 seconds) |
| 2021-03-26 15:02:02 | <c_wraith> | If calling show on your exception gives me some text that's useful to log, my needs are covered. |
| 2021-03-26 15:02:09 | <Lycurgus> | *resulting |
| 2021-03-26 15:03:06 | × | haritz quits (~hrtz@unaffiliated/haritz) (Ping timeout: 240 seconds) |
| 2021-03-26 15:03:15 | → | acarrico joins (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) |
| 2021-03-26 15:06:26 | × | __minoru__shirae quits (~shiraeesh@109.166.56.243) (Ping timeout: 246 seconds) |
| 2021-03-26 15:06:30 | × | azure1 quits (~azure@103.154.230.130) (Ping timeout: 260 seconds) |
| 2021-03-26 15:07:24 | → | azure1 joins (~azure@103.154.230.130) |
| 2021-03-26 15:08:53 | → | apeyroux joins (~alex@78.20.138.88.rev.sfr.net) |
| 2021-03-26 15:09:58 | <mananamenos> | hi, so im browsing internet with people opinions about when to use or not use your own type classes and there are a lot of opinions :) When you have some domain pattern and there are at least 2 types which will use shared funcionality, isn't this an good enough argument to have a typeclass? Other way would be to pass that typeclass's method as an explicit argument along but this seems inferior as I may need to manually |
| 2021-03-26 15:09:59 | <mananamenos> | pass many times and with typeclass implementation I get it done implicitly. |
| 2021-03-26 15:10:30 | <dminuoso> | mananamenos: This is a tough and old question. One common answer you might get, is that typeclasses are best used when they have some laws attached to them. |
| 2021-03-26 15:11:00 | <mananamenos> | dminuoso, yeah, I've read that in many places |
| 2021-03-26 15:11:27 | <mananamenos> | I see, that's why I asked, cause reading a bit I could not get any good conclusion for this question |
| 2021-03-26 15:11:38 | <dminuoso> | As a general rule of thumb, Id avoid typeclasses as much as you can. |
| 2021-03-26 15:11:40 | <merijn> | mananamenos: I think the tagless final approach is good/useful |
| 2021-03-26 15:12:14 | <merijn> | mananamenos: See, for example: https://serokell.io/blog/tagless-final |
| 2021-03-26 15:12:20 | → | vilpan joins (~0@212.117.1.172) |
| 2021-03-26 15:12:24 | <dminuoso> | The reason is, overusing typeclasses leads to hard-to-follow code (and it can make error diagnostics much worse) |
| 2021-03-26 15:12:32 | <dminuoso> | But underusing them has little downsides |
| 2021-03-26 15:13:33 | <mananamenos> | thank you |
| 2021-03-26 15:20:23 | nshepperd2 | . o O (https://paste.zlkj.in/uploads/a9122d639308be0b/ExceptionSynonyms.hs) |
| 2021-03-26 15:21:26 | × | acidjnk_new quits (~acidjnk@p200300d0c72b951261ba2baa5d07e392.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 2021-03-26 15:21:52 | → | acidjnk_new joins (~acidjnk@p200300d0c72b951261ba2baa5d07e392.dip0.t-ipconnect.de) |
| 2021-03-26 15:22:18 | <dminuoso> | nshepperd2: neat! |
| 2021-03-26 15:23:43 | <nshepperd2> | oh wait, it has a bug, whnfEither isn't the right function |
| 2021-03-26 15:24:03 | <nshepperd2> | but the basic idea should work :) |
| 2021-03-26 15:24:48 | <L29Ah> | unsafePerformIO is slow :( |
| 2021-03-26 15:25:37 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-109-157.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 2021-03-26 15:25:45 | <nshepperd2> | is it? |
| 2021-03-26 15:26:00 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-109-157.w86-212.abo.wanadoo.fr) |
| 2021-03-26 15:26:25 | <merijn> | Depends how you define slow :p |
| 2021-03-26 15:26:58 | × | Lycurgus quits (~niemand@98.4.119.196) (Quit: Exeunt) |
| 2021-03-26 15:26:59 | <merijn> | nshepperd2: That's just reinventing spoon, btw |
| 2021-03-26 15:27:15 | <merijn> | @hackage spoon |
| 2021-03-26 15:27:15 | <lambdabot> | https://hackage.haskell.org/package/spoon |
| 2021-03-26 15:27:50 | × | vilpan quits (~0@212.117.1.172) (Ping timeout: 252 seconds) |
| 2021-03-26 15:28:14 | <shapr> | as opposed to fork? |
| 2021-03-26 15:29:27 | <merijn> | Probably a matrix reference :p |
| 2021-03-26 15:30:46 | × | acidjnk_new quits (~acidjnk@p200300d0c72b951261ba2baa5d07e392.dip0.t-ipconnect.de) (Ping timeout: 276 seconds) |
| 2021-03-26 15:30:51 | × | raid quits (macbookpro@irc-1.coding4.coffee) (Quit: I was eaten by zombies) |
| 2021-03-26 15:30:59 | × | PyroLagus quits (PyroLagus@i.have.ipv6.on.coding4coffee.org) (Quit: ZNC / WeeChat) |
| 2021-03-26 15:31:03 | × | haasn quits (~nand@mpv/developer/haasn) (Remote host closed the connection) |
| 2021-03-26 15:31:16 | × | gehmehgeh quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Quit: Leaving) |
| 2021-03-26 15:31:37 | → | PyroLagus joins (PyroLagus@i.have.ipv6.on.coding4coffee.org) |
| 2021-03-26 15:32:46 | × | yushyin quits (krIxGtPfeq@karif.server-speed.net) (Ping timeout: 240 seconds) |
| 2021-03-26 15:32:54 | <nshepperd2> | https://paste.zlkj.in/uploads/1507248b13fd5e06/ExceptionSynonyms.v2.hs works |
| 2021-03-26 15:33:28 | → | haasn joins (~nand@mpv/developer/haasn) |
| 2021-03-26 15:33:56 | <nshepperd2> | merijn: yes but more fun because PATTERNS |
| 2021-03-26 15:34:46 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:1cfc:5265:7008:dc13) |
| 2021-03-26 15:35:11 | × | titusg quits (~user@158.229.6.51.dyn.plus.net) (Ping timeout: 240 seconds) |
| 2021-03-26 15:35:12 | × | zaquest quits (~notzaques@5.128.210.178) (Remote host closed the connection) |
| 2021-03-26 15:35:42 | → | raid joins (macbookpro@irc-1.coding4.coffee) |
| 2021-03-26 15:36:03 | × | toorevitimirp quits (~tooreviti@117.182.181.200) (Remote host closed the connection) |
| 2021-03-26 15:39:19 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:1cfc:5265:7008:dc13) (Ping timeout: 258 seconds) |
| 2021-03-26 15:39:53 | → | zaquest joins (~notzaques@5.128.210.178) |
| 2021-03-26 15:40:06 | <L29Ah> | 18:25:45]<nshepperd2> is it? |
| 2021-03-26 15:40:07 | <L29Ah> | i recall it taking tens of milliseconds and stopping all other threads while it works |
| 2021-03-26 15:40:29 | → | myShoggoth joins (~myShoggot@75.164.81.55) |
| 2021-03-26 15:41:00 | <ski> | nshepperd2 : reminds me of "Exceptional syntax" by Nick Benton,Andrew Kennedy in 2001. see e.g. <http://lambda-the-ultimate.org/node/1193>. OCaml implements this as being able to match on an exception in `match' (their `case'). as if one could match on `throw <pat>' in Haskell |
| 2021-03-26 15:41:46 | × | xourt quits (d4c620ea@212-198-32-234.rev.numericable.fr) (Quit: Connection closed) |
| 2021-03-26 15:41:56 | → | alx741 joins (~alx741@186.178.108.68) |
| 2021-03-26 15:42:05 | <ski> | the paper also suggests that not only having `try :: Exception e => IO a -> IO (Either e a)' and `catch :: Exception e => IO a -> (e -> IO a) -> IO a', but also an operation `catchBind :: Exception e => IO a -> (e -> IO b) -> (a -> IO b) -> IO b' would likely be useful |
| 2021-03-26 15:42:56 | → | vilpan joins (~0@212.117.1.172) |
| 2021-03-26 15:44:03 | <ski> | the point is to allow the `a -> IO b' part (which might contain a tail-recursive calle, e.g.) to stay out of the exception handler, while avoiding needing to construct a `Maybe' or `Either' (or thunk, in Haskell that'd be having an action that produces an action) inside the handler, only to take it apart / use it up, once outside, in the best case perhaps hoping for fusion |
| 2021-03-26 15:44:26 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:1cfc:5265:7008:dc13) |
| 2021-03-26 15:44:47 | <nshepperd2> | oh, good point the IsException pattern should be called Throw |
| 2021-03-26 15:44:49 | <ski> | (they also argue for such an operation, on the grounds that it makes more sense to state the semantics, and laws, in terms of such an operation) |
| 2021-03-26 15:44:59 | <nshepperd2> | foo (Throw (e :: ArithException)) = ... :) |
| 2021-03-26 15:45:05 | ski | nods |
| 2021-03-26 15:45:42 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
All times are in UTC.