Logs: freenode/#haskell
| 2020-11-24 17:54:32 | <kuribas> | dsal: yeah, linear on the amount that you evaluate. |
| 2020-11-24 17:55:07 | <texasmynsted> | dsal: is your project open? |
| 2020-11-24 17:55:14 | <dsal> | texasmynsted: right, you'd end up with overlapping instances |
| 2020-11-24 17:55:17 | <texasmynsted> | It sounds really neat |
| 2020-11-24 17:55:32 | <monochrom> | Yes, it takes a bit more sophistication to state computation costs when laziness is involved. It is a function of both input size and demand size. |
| 2020-11-24 17:55:32 | <kuribas> | texasmynsted: you normally want typeclass instances to be unique. |
| 2020-11-24 17:55:33 | <dsal> | texasmynsted: I have... Several at github.com/dustin |
| 2020-11-24 17:56:05 | <monochrom> | But a simplifying convention is that if you only talk about input size, then you assume full evaluation. |
| 2020-11-24 17:56:15 | ← | kuribas parts (~user@ptr-25vy0i9hk5zsklfgprx.18120a2.ip6.access.telenet.be) ("ERC (IRC client for Emacs 26.3)") |
| 2020-11-24 17:56:18 | <texasmynsted> | There is a module that I use, from somebody else. I want to modify how it works. I think my only option is to fork it. |
| 2020-11-24 17:56:39 | <texasmynsted> | Forking it would likely not be worth the effort for the change I want. |
| 2020-11-24 17:57:04 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection) |
| 2020-11-24 17:57:11 | → | ericsagnes joins (~ericsagne@2405:6580:0:5100:2b3f:f80d:4d07:855c) |
| 2020-11-24 17:58:22 | <dsal> | What's the class? Can you just newtype? |
| 2020-11-24 17:58:33 | <monochrom> | The least surgical solution is you endow your own newtype wrapper. Then you can pin your favourite instance code to your newtype wrapper. |
| 2020-11-24 17:58:49 | <monochrom> | But this is also the most annoying. :) |
| 2020-11-24 17:59:00 | <texasmynsted> | What I want to do is really simple: I will show you. |
| 2020-11-24 18:00:02 | <texasmynsted> | See the text block at the end of this page? https://jaspervdj.be/hakyll/reference/src/Hakyll.Web.Redirect.html#createRedirects |
| 2020-11-24 18:00:17 | <texasmynsted> | I want to change 'redirectToHtml' |
| 2020-11-24 18:00:41 | <texasmynsted> | I should easily be able to do that if I replace 'instance Writable Redirect' |
| 2020-11-24 18:01:15 | × | chele quits (~chele@91.65.110.162) (Remote host closed the connection) |
| 2020-11-24 18:01:22 | <dsal> | Yeah, a newtype of Redirect is probably straightforward. |
| 2020-11-24 18:01:50 | × | royal_screwup213 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 2020-11-24 18:02:10 | × | hseg quits (~gesh@185.120.126.113) (Quit: WeeChat 2.9) |
| 2020-11-24 18:02:34 | → | royal_screwup213 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2020-11-24 18:02:41 | <texasmynsted> | Thank you. It sounds like I need to try this. |
| 2020-11-24 18:03:43 | <monochrom> | This leads me to the crazy idea of advocating maximally orphaned instances! |
| 2020-11-24 18:04:00 | × | reallymemorable quits (~quassel@2601:180:8300:8fd0:4ce1:c8ee:d3b9:46c5) (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
| 2020-11-24 18:04:33 | <monochrom> | If every instance is in its own module, you can now freely mix and match, you can freely refuse to import whichever instance you don't want. |
| 2020-11-24 18:06:01 | <texasmynsted> | so Scala style then |
| 2020-11-24 18:07:05 | <monochrom> | Then again there can be a subtle problem. Some instances assume you have already accepted some other instances, lest there would be unpleasant surprises. |
| 2020-11-24 18:07:07 | <dsal> | Can we get compiler warnings telling us our instances aren't orphans? |
| 2020-11-24 18:07:24 | → | Jeanne-Kamikaze joins (~Jeanne-Ka@66.115.189.237) |
| 2020-11-24 18:08:00 | × | MarcelineVQ quits (~anja@198.254.202.72) (Ping timeout: 260 seconds) |
| 2020-11-24 18:08:00 | <monochrom> | However, my really favourite idea is named instances. |
| 2020-11-24 18:08:21 | × | st8less quits (~st8less@2603:a060:11fd:0:b11b:e5d8:ecef:8990) (Ping timeout: 272 seconds) |
| 2020-11-24 18:08:21 | <texasmynsted> | so actually Idris style? |
| 2020-11-24 18:08:27 | <monochrom> | Yeah |
| 2020-11-24 18:08:30 | hackage | hakyll-contrib-i18n 0.1.0.0 - A Hakyll library for internationalization. https://hackage.haskell.org/package/hakyll-contrib-i18n-0.1.0.0 (pcoves) |
| 2020-11-24 18:08:55 | <monochrom> | The part I'm most proud of is how I maximized the puns in naming it: https://mail.haskell.org/pipermail/haskell-cafe/2017-May/127147.html |
| 2020-11-24 18:09:05 | <dolio> | Idris and scala are the same style, possibly aside from idris having fewer weird rules for what automatically gets used. |
| 2020-11-24 18:09:37 | → | st8less joins (~st8less@2603:a060:11fd:0:b8c0:f26a:7cc8:b52d) |
| 2020-11-24 18:09:57 | <texasmynsted> | Knowing which instance is used, with Scala, can be an issue. |
| 2020-11-24 18:12:06 | → | Cale_ joins (~cale@cpef48e38ee8583-cm0c473de9d680.cpe.net.cable.rogers.com) |
| 2020-11-24 18:13:15 | <monochrom> | I hope you see how I managed to make "tl;dr" a legit acronym for this :) |
| 2020-11-24 18:14:39 | → | adm_ joins (~adm@43.229.88.197) |
| 2020-11-24 18:16:48 | × | nuncanada quits (~dude@179.235.160.168) (Ping timeout: 260 seconds) |
| 2020-11-24 18:17:59 | × | woodpecker-with- quits (3e0497aa@62.4.151.170) (Ping timeout: 245 seconds) |
| 2020-11-24 18:19:02 | × | adm_ quits (~adm@43.229.88.197) (Ping timeout: 256 seconds) |
| 2020-11-24 18:19:16 | × | ubert quits (~Thunderbi@p200300ecdf1e53ebe6b318fffe838f33.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 2020-11-24 18:19:17 | × | NieDzejkob quits (~quassel@188.123.215.55) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 2020-11-24 18:22:16 | × | Cale quits (~cale@cpef48e38ee8583-cm0c473de9d680.cpe.net.cable.rogers.com) (Disconnected by services) |
| 2020-11-24 18:22:24 | Cale_ | is now known as Cale |
| 2020-11-24 18:22:44 | → | Cale_ joins (~cale@cpef48e38ee8583-cm0c473de9d680.cpe.net.cable.rogers.com) |
| 2020-11-24 18:23:23 | → | alp joins (~alp@2a01:e0a:58b:4920:4935:6a51:5926:c53d) |
| 2020-11-24 18:23:39 | × | Cale_ quits (~cale@cpef48e38ee8583-cm0c473de9d680.cpe.net.cable.rogers.com) (Remote host closed the connection) |
| 2020-11-24 18:24:26 | × | conal quits (~conal@66.115.157.138) (Quit: Computer has gone to sleep.) |
| 2020-11-24 18:26:50 | × | cads quits (~cads@ip-64-72-99-232.lasvegas.net) (Ping timeout: 265 seconds) |
| 2020-11-24 18:26:57 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 2020-11-24 18:27:32 | → | Sheilong joins (uid293653@gateway/web/irccloud.com/x-yowroavlostcpsuo) |
| 2020-11-24 18:27:37 | <dminuoso> | hekkaidekapus, ski: Thanks again for your insight on the tree building. The intermediate step and then building a trie is the way to go here. :) |
| 2020-11-24 18:28:00 | hackage | nix-thunk 0.2.0.2 - Lightweight dependency management with Nix https://hackage.haskell.org/package/nix-thunk-0.2.0.2 (abrar) |
| 2020-11-24 18:28:03 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection) |
| 2020-11-24 18:28:19 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 2020-11-24 18:31:02 | → | conal joins (~conal@66.115.157.138) |
| 2020-11-24 18:33:39 | → | NieDzejkob joins (~quassel@188.123.215.55) |
| 2020-11-24 18:36:14 | <sshine> | did you see Java 15 almost has ADTs? |
| 2020-11-24 18:38:11 | <gentauro> | sshine: like `sum types`? Hold my beer |
| 2020-11-24 18:38:14 | <koz_> | sshine: 'Almost has X' for all X is a good description of Java as a language. |
| 2020-11-24 18:38:39 | <koz_> | (well, 'Almost has X, but ten times as long with twice the caveats' might be more accurate) |
| 2020-11-24 18:38:45 | <sshine> | gentauro, https://openjdk.java.net/jeps/360 |
| 2020-11-24 18:38:49 | × | Df quits (5fa448e7@95.164.72.231) (Ping timeout: 245 seconds) |
| 2020-11-24 18:39:57 | <dminuoso> | With Haskell I learned the value of ADTs. I cant see myself programming in a language without. |
| 2020-11-24 18:40:01 | <gentauro> | koz_: «COBOL was… …and that’s bad enough.» replace COBOL with any language that is not Haskell. Source: https://sigkill.dk/writings/languages.html (Athas blog) |
| 2020-11-24 18:40:08 | <sshine> | dminuoso, now you can code Java! |
| 2020-11-24 18:40:15 | <koz_> | gentauro: Lol. |
| 2020-11-24 18:40:18 | → | htmnc joins (~James@2600:1700:4ca1:7640:ec8e:65af:cdd0:9671) |
| 2020-11-24 18:40:19 | <gentauro> | dminuoso: for me it's the `sum types` |
| 2020-11-24 18:40:34 | <gentauro> | at the moment «I'm trapped» in a C# freelance gig |
| 2020-11-24 18:40:45 | <koz_> | gentauro: I am so, so sorry. |
| 2020-11-24 18:40:47 | <dminuoso> | sshine: Mind my asking, why aren't they full sum types? |
| 2020-11-24 18:40:49 | × | lpy quits (~nyd@unaffiliated/elysian) (Quit: lpy) |
| 2020-11-24 18:40:49 | <dminuoso> | What's their limitation? |
| 2020-11-24 18:40:50 | <gentauro> | I want to sigkill myself for every key stroke xD |
| 2020-11-24 18:40:59 | <sshine> | dminuoso, they're made in a funny way. |
| 2020-11-24 18:41:06 | <dminuoso> | Also, do you get depressed when discriminating Java sum types? Do you get refinement? |
| 2020-11-24 18:41:20 | <dminuoso> | Can we have full blown GADTs? |
| 2020-11-24 18:41:42 | <gentauro> | sshine: thx for the link, but my eyes began to bleed as soon as they saw the Java syntax |
| 2020-11-24 18:42:19 | <sshine> | dminuoso, sealed classes are a way to whitelist which sub-classes are allowed to inherit. so for an 'Expr' class you can have 'Add', 'Mul', etc. Since you have a fixed list known at compile-time, you can now do pattern matching on instanceof. but since it's still made in such a sketchy way on top, limitations apply. |
| 2020-11-24 18:42:48 | <koz_> | sshine: Does this allow compile-time exhaustiveness checking? |
| 2020-11-24 18:42:54 | <gentauro> | sshine: did they went for the .NET (C#) "way of doing it"? |
| 2020-11-24 18:42:54 | <koz_> | I'm going to assume 'no'. |
| 2020-11-24 18:43:00 | <gentauro> | cos that's really really bad |
| 2020-11-24 18:43:11 | <dminuoso> | sshine: Oh so the switch/case construct is just a bit of syntax sugar around multi-way if instanceof? |
| 2020-11-24 18:43:15 | dminuoso | sighs |
| 2020-11-24 18:43:40 | <gentauro> | you test for "types". So you need to check if it's a `int`, a `char` a … (any `type` that is not nullable goes) |
| 2020-11-24 18:43:48 | <gentauro> | I can't make myself use that |
| 2020-11-24 18:43:54 | <dminuoso> | I see, so you cant have `char + char`? |
| 2020-11-24 18:44:12 | <sshine> | dminuoso, I'm pretty sure that's how it must be. |
| 2020-11-24 18:44:32 | <dminuoso> | So it's a union and not disjoint union of types... |
All times are in UTC.