Newest at the top
| 2026-02-05 20:22:45 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn |
| 2026-02-05 20:21:18 +0100 | tromp | (~textual@2001:1c00:3487:1b00:4842:24c6:bd5c:fe37) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 2026-02-05 20:16:59 +0100 | <Clint> | i did not read it differently, ftr |
| 2026-02-05 20:16:07 +0100 | <[exa]> | yap. :] |
| 2026-02-05 20:15:49 +0100 | <int-e> | [exa]: Ah. FWIW to me it sounded like you did google it out of curiosity and shared the result and method, without judgement. I could see it being read differently of course. |
| 2026-02-05 20:15:02 +0100 | <Clint> | i was just reading https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/pattern_synonyms.html |
| 2026-02-05 20:14:39 +0100 | <[exa]> | int-e: nah the original sentence I wrote sounded a bit too much like "oh lemme google that for you" which I didn't intend |
| 2026-02-05 20:14:30 +0100 | <tomsmeding> | "I want to modify constructors of a data type without modifying the API" is one of the design usecases of pattern synonyms |
| 2026-02-05 20:14:06 +0100 | <Clint> | Morj: the whole point is that i want to add a field to the type without breaking the API |
| 2026-02-05 20:14:02 +0100 | <int-e> | [exa]: it's fine, you can google (most) things with DuckDuckGo :P |
| 2026-02-05 20:13:45 +0100 | <[exa]> | e.g. add a few constructors that don't actually have the `a` |
| 2026-02-05 20:13:16 +0100 | <[exa]> | Morj: I assume the main issue is that the types would get more complex |
| 2026-02-05 20:12:52 +0100 | <[exa]> | ( s/google/find/ ) |
| 2026-02-05 20:12:38 +0100 | <haskellbridge> | <Morj> Should I suggest to instead encode the thingy as data Thingy = Thingy a (Maybe b)? |
| 2026-02-05 20:11:55 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 250 seconds) |
| 2026-02-05 20:11:47 +0100 | <[exa]> | Clint: btw if you didn't google it yet, this probably does it https://stackoverflow.com/a/43839121 |
| 2026-02-05 20:09:11 +0100 | <tomsmeding> | perhaps not all, but many |
| 2026-02-05 20:09:05 +0100 | <tomsmeding> | essentially all interesting usecases of a pattern synonym require a view pattern to define the synonym |
| 2026-02-05 20:08:37 +0100 | <[exa]> | can one do such a multi-target pattern synonym without going through a view pattern? |
| 2026-02-05 20:06:55 +0100 | hellwolf | (~user@13cd-fe1e-a030-6e4e-0f00-4d40-07d0-2001.sta.estpak.ee) hellwolf |
| 2026-02-05 20:06:06 +0100 | akegalj | (~akegalj@173-245.dsl.iskon.hr) (Quit: leaving) |
| 2026-02-05 20:05:37 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn |
| 2026-02-05 20:05:27 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) (Quit: sord937) |
| 2026-02-05 20:01:32 +0100 | <Clint> | i'll give it a shot, thanks |
| 2026-02-05 20:00:24 +0100 | <[exa]> | yeah, view patterns or pattern synonyms |
| 2026-02-05 19:59:50 +0100 | Clint | reads. |
| 2026-02-05 19:59:04 +0100 | <tomsmeding> | have ConstructorV{1,2} actually be pattern synonyms that do whatever you want with the underlying Thingy definition |
| 2026-02-05 19:58:45 +0100 | <tomsmeding> | pattern synonyms? |
| 2026-02-05 19:58:35 +0100 | <EvanR> | o_O |
| 2026-02-05 19:58:11 +0100 | <Clint> | speaking of getting wild, is there any type magic which would let me do something like data Thingy = ConstructorV1 a | ConstructorV2 a b and be able to pattern-match a ConstructorV2 value with (ConstructorV1 a)? |
| 2026-02-05 19:58:06 +0100 | <tomsmeding> | I like how I get the most agreement here when I post the stupidest suggestions |
| 2026-02-05 19:57:54 +0100 | __monty__ | (~toonn@user/toonn) (Ping timeout: 244 seconds) |
| 2026-02-05 19:57:40 +0100 | <[exa]> | tomsmeding: I love that |
| 2026-02-05 19:57:21 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) lisbeths |
| 2026-02-05 19:56:55 +0100 | <EvanR> | tomsmeding, now you're talking |
| 2026-02-05 19:56:36 +0100 | <[exa]> | EvanR: not really; you add instance Monad and overloaded lists and strings and labels, and you're generating this for free |
| 2026-02-05 19:56:30 +0100 | <tomsmeding> | it's all a function! Why throw an error if you pass 5 to a function expecting a Maybe String? It will just... do something! |
| 2026-02-05 19:56:01 +0100 | <tomsmeding> | may need to embed in `newtype X = X (X -> X)` for proper typelessness |
| 2026-02-05 19:55:57 +0100 | <EvanR> | oh? |
| 2026-02-05 19:55:43 +0100 | <tomsmeding> | EvanR: we have our own brand of that, try church encodings |
| 2026-02-05 19:55:37 +0100 | <EvanR> | would seem to expand the code vs idiomatic haskell.... maybe |
| 2026-02-05 19:54:07 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
| 2026-02-05 19:54:01 +0100 | <[exa]> | well anyway you can go `data Scheme = Cons Scheme Scheme | Num Int | Symbol String | Nil | ...` and get wild |
| 2026-02-05 19:52:44 +0100 | <[exa]> | ah yes the List Technology |
| 2026-02-05 19:52:18 +0100 | <EvanR> | ["Just", "five"] vs ["Nothing"] |
| 2026-02-05 19:52:15 +0100 | Tuplanolla | (~Tuplanoll@85-156-32-207.elisa-laajakaista.fi) Tuplanolla |
| 2026-02-05 19:51:05 +0100 | <EvanR> | ok it's not a great start |
| 2026-02-05 19:51:00 +0100 | <EvanR> | I guess ("Nothing", undefined) xD |
| 2026-02-05 19:50:24 +0100 | <[exa]> | EvanR: you mean like, ("Just", "five") and ("Nothing", "") |
| 2026-02-05 19:47:55 +0100 | <EvanR> | (more code) |