2025-03-13 00:03:24 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds) |
2025-03-13 00:03:49 +0100 | tabaqui | (~root@167.71.80.236) (Quit: WeeChat 4.5.1) |
2025-03-13 00:04:38 +0100 | tabaqui1 | (~root@87.200.129.102) (Quit: WeeChat 4.5.1) |
2025-03-13 00:04:42 +0100 | tabaqui | (~root@167.71.80.236) tabaqui |
2025-03-13 00:11:34 +0100 | tabaqui1 | (~root@87.200.129.102) tabaqui |
2025-03-13 00:14:01 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 00:15:53 +0100 | tabaqui1 | (~root@87.200.129.102) (Client Quit) |
2025-03-13 00:17:26 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 00:17:37 +0100 | tabaqui1 | (~root@167.71.80.236) tabaqui |
2025-03-13 00:18:16 +0100 | tabaqui | (~root@167.71.80.236) (Quit: WeeChat 4.5.1) |
2025-03-13 00:18:24 +0100 | tuxpaint | (~a@2600:3c06::f03c:93ff:fea6:ef0e) (Ping timeout: 252 seconds) |
2025-03-13 00:18:40 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-03-13 00:21:36 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
2025-03-13 00:29:23 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 00:31:33 +0100 | tabaqui | (~root@167.71.80.236) tabaqui |
2025-03-13 00:34:06 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
2025-03-13 00:36:50 +0100 | tabaqui1 | (~root@167.71.80.236) (Quit: WeeChat 4.5.1) |
2025-03-13 00:36:52 +0100 | tabaqui | (~root@167.71.80.236) (Quit: WeeChat 4.5.1) |
2025-03-13 00:38:11 +0100 | tabaqui | (~tabaqui@167.71.80.236) tabaqui |
2025-03-13 00:38:51 +0100 | tabaqui1 | (~root@167.71.80.236) tabaqui |
2025-03-13 00:40:39 +0100 | tabaqui1 | (~root@167.71.80.236) (Client Quit) |
2025-03-13 00:40:53 +0100 | tabaqui1 | (~root@167.71.80.236) tabaqui |
2025-03-13 00:41:02 +0100 | <Leary> | Noinia: `Fold` does a silly thing where it quantifies over `f` both `Functor` and `Contravariant`, hence restricting to `f` phantom in `s`. The role system doesn't understand this, however; `coerce` alone won't work, but you can take solace in the fact that `fmap`/`contramap` will be trivial at runtime. |
2025-03-13 00:43:04 +0100 | tabaqui1 | (~root@167.71.80.236) (Client Quit) |
2025-03-13 00:44:39 +0100 | <jackdk> | Noinia: is https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-Functor-Contravariant.html#v:phantom any use to you here? |
2025-03-13 00:44:46 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 00:45:27 +0100 | <jackdk> | Ah, `phantom` is still implemented as `() <$ x $< ()`. I had hoped it would be an unsafeCoerce in a wrapper |
2025-03-13 00:45:30 +0100 | tabaqui1 | (~root@167.71.80.236) tabaqui |
2025-03-13 00:46:19 +0100 | tabaqui1 | (~root@167.71.80.236) (Client Quit) |
2025-03-13 00:47:18 +0100 | tabaqui1 | (~root@167.71.80.236) tabaqui |
2025-03-13 00:49:06 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-03-13 00:58:07 +0100 | tusko | (uid478376@user/tusko) (Quit: Connection closed for inactivity) |
2025-03-13 01:00:09 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 01:02:43 +0100 | tuxpaint | (~a@2600:3c06::f03c:93ff:fea6:ef0e) |
2025-03-13 01:03:39 +0100 | ljdarj1 | (~Thunderbi@user/ljdarj) ljdarj |
2025-03-13 01:03:50 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 01:06:04 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 265 seconds) |
2025-03-13 01:06:04 +0100 | ljdarj1 | ljdarj |
2025-03-13 01:07:02 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
2025-03-13 01:08:06 +0100 | ystael | (~ystael@user/ystael) ystael |
2025-03-13 01:08:07 +0100 | <jackdk> | Noinia: Have you considered `coerceFold theFold = coerced . theFold`? `Control.Lens.Iso.coerced` uses the `.#` stuff from `Data.Profunctor.Unsafe` which should be zero-cost |
2025-03-13 01:08:09 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
2025-03-13 01:09:04 +0100 | <jackdk> | (or at least very cheap - I don't quite know how it all works, but IIRC edwardk considered .# and #. very important, at least one point) |
2025-03-13 01:11:22 +0100 | xkuru | (~xkuru@user/xkuru) (Quit: Unvirtualizing) |
2025-03-13 01:11:40 +0100 | xkuru | (~xkuru@user/xkuru) xkuru |
2025-03-13 01:13:52 +0100 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
2025-03-13 01:18:11 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 01:20:51 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich |
2025-03-13 01:22:45 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-03-13 01:23:34 +0100 | Square | (~Square@user/square) (Ping timeout: 252 seconds) |
2025-03-13 01:27:11 +0100 | sprotte24 | (~sprotte24@p200300d16f4b7200116db6fce964005a.dip0.t-ipconnect.de) (Quit: Leaving) |
2025-03-13 01:32:53 +0100 | acidjnk_new | (~acidjnk@p200300d6e7283f52eca5d8b1f7f6f1d4.dip0.t-ipconnect.de) (Ping timeout: 245 seconds) |
2025-03-13 01:33:33 +0100 | acidjnk_new | (~acidjnk@p200300d6e7283f85b10ad2147dd4d665.dip0.t-ipconnect.de) acidjnk |
2025-03-13 01:33:33 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 01:34:18 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds) |
2025-03-13 01:34:18 +0100 | ystael | (~ystael@user/ystael) (Ping timeout: 252 seconds) |
2025-03-13 01:37:48 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
2025-03-13 01:37:55 +0100 | izzyfalco | (~jake_pers@user/izzyfalco) izzyfalco |
2025-03-13 01:48:55 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 01:49:34 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 01:53:37 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 248 seconds) |
2025-03-13 01:53:50 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 272 seconds) |
2025-03-13 01:58:13 +0100 | Smiles | (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2025-03-13 01:58:28 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 02:02:48 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-03-13 02:04:48 +0100 | tabaqui | (~tabaqui@167.71.80.236) (Ping timeout: 276 seconds) |
2025-03-13 02:05:14 +0100 | xff0x | (~xff0x@2405:6580:b080:900:7a6d:e986:6f30:4a1b) (Ping timeout: 272 seconds) |
2025-03-13 02:06:24 +0100 | xkuru | (~xkuru@user/xkuru) (Quit: Unvirtualizing) |
2025-03-13 02:09:12 +0100 | mange | (~user@user/mange) mange |
2025-03-13 02:13:48 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 02:15:16 +0100 | izzyfalco | (~jake_pers@user/izzyfalco) (Ping timeout: 252 seconds) |
2025-03-13 02:15:46 +0100 | JuanDaugherty | (~juan@user/JuanDaugherty) JuanDaugherty |
2025-03-13 02:16:01 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection) |
2025-03-13 02:18:34 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
2025-03-13 02:26:26 +0100 | ethantwardy | (user@user/ethantwardy) (Quit: WeeChat 4.4.2) |
2025-03-13 02:28:09 +0100 | ethantwardy | (user@user/ethantwardy) ethantwardy |
2025-03-13 02:29:10 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 02:32:42 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2025-03-13 02:34:04 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds) |
2025-03-13 02:34:59 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 02:39:06 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
2025-03-13 02:42:46 +0100 | machinedgod | (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 252 seconds) |
2025-03-13 02:43:36 +0100 | califax | (~califax@user/califx) califx |
2025-03-13 02:44:33 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 02:51:10 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
2025-03-13 02:56:14 +0100 | xff0x | (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) |
2025-03-13 03:00:28 +0100 | JuanDaugherty | (~juan@user/JuanDaugherty) (Quit: praxis.meansofproduction.biz (juan@acm.org)) |
2025-03-13 03:02:36 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 03:07:13 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds) |
2025-03-13 03:17:58 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 03:20:43 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 03:22:13 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds) |
2025-03-13 03:24:01 +0100 | messewix | (~jmc@user/messewix) messewix |
2025-03-13 03:24:45 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 244 seconds) |
2025-03-13 03:33:20 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 03:38:19 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
2025-03-13 03:41:42 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 265 seconds) |
2025-03-13 03:44:11 +0100 | messewix | (~jmc@user/messewix) (Quit: Konversation terminated!) |
2025-03-13 03:44:29 +0100 | messewix | (~jmc@user/messewix) messewix |
2025-03-13 03:44:34 +0100 | messewix | (~jmc@user/messewix) (Remote host closed the connection) |
2025-03-13 03:48:44 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 03:53:54 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
2025-03-13 03:54:38 +0100 | j1n37 | (~j1n37@user/j1n37) (Ping timeout: 252 seconds) |
2025-03-13 03:55:24 +0100 | j1n37 | (~j1n37@user/j1n37) j1n37 |
2025-03-13 04:04:04 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 04:06:27 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 04:08:34 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds) |
2025-03-13 04:10:46 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
2025-03-13 04:15:09 +0100 | yegorc | (~yegorc@user/yegorc) (Ping timeout: 252 seconds) |
2025-03-13 04:19:28 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 04:26:14 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
2025-03-13 04:35:29 +0100 | TheCoffeMaker_ | (~TheCoffeM@186.136.173.70) |
2025-03-13 04:36:26 +0100 | TheCoffeMaker | (~TheCoffeM@user/thecoffemaker) (Ping timeout: 252 seconds) |
2025-03-13 04:37:31 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 04:42:03 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds) |
2025-03-13 04:47:03 +0100 | euouae | (~euouae@user/euouae) euouae |
2025-03-13 04:47:06 +0100 | <euouae> | Hello |
2025-03-13 04:47:58 +0100 | <euouae> | I'm using megaparsec and I have a `ParsecT Void Text (St.State Int) Text`. I want to use `modify (+1)` inside the do block. I know I have to lift it. |
2025-03-13 04:48:32 +0100 | <euouae> | I want to ask if there is such an operation already defined in megaparsec? I.e. what's a good way to discover such lifts? Would this info be visible in `:i ParsecT` at the instance declarations? |
2025-03-13 04:48:41 +0100 | <euouae> | Maybe an instance of MonadTrans from transformers? |
2025-03-13 04:49:31 +0100 | <c_wraith> | It's visible in the haddocks |
2025-03-13 04:49:39 +0100 | <c_wraith> | https://hackage.haskell.org/package/megaparsec-9.7.0/docs/Text-Megaparsec.html#t:ParsecT look at that huge instance list |
2025-03-13 04:50:09 +0100 | <jackdk> | Specifically, it's the instance `(Stream s, MonadState st m) => MonadState st (ParsecT e s m)`, which should let you use `modify` etc from `mtl` |
2025-03-13 04:50:37 +0100 | <euouae> | Yeah you're right. It was not visible in GHCi |
2025-03-13 04:51:11 +0100 | <euouae> | Why is it not visible in GHCi? Is it because I haven't imported these packages? |
2025-03-13 04:52:11 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 04:52:18 +0100 | <euouae> | jackdk: isn't that inverse of what I have in terms of the monadic stack? |
2025-03-13 04:52:55 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 04:52:58 +0100 | <c_wraith> | yeah, ghci only shows you instances for classes that it has in scope |
2025-03-13 04:53:08 +0100 | <jackdk> | euouae: I had to `:m + Control.Monad.State` to see it |
2025-03-13 04:53:22 +0100 | izzyfalco | (~jake_pers@user/izzyfalco) izzyfalco |
2025-03-13 04:53:34 +0100 | <c_wraith> | so if nothing you've imported re-exports the class, the instance won't be listed |
2025-03-13 04:54:56 +0100 | <euouae> | somewhat frustrating to always have to run to haddock online |
2025-03-13 04:55:29 +0100 | <jackdk> | euouae: And no, you have `ParsecT Void Text (St.State Int)` which matches the instance `MonadState (ParsecT e s m)` with `e ~ Void`, `s ~ Text`, `m ~ St.State Int`, and this instance is usable because you have the instances `Stream s` and `MonadState Int (St.StateT Int Identity)` (expanding the alias for `St.State`) |
2025-03-13 04:55:53 +0100 | <euouae> | oh wait, right. thank you jackdk. |
2025-03-13 04:56:33 +0100 | <euouae> | I misread it because I saw "MonadState" followed by "ParsecT" and I didn't realize what I was reading |
2025-03-13 04:56:48 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 268 seconds) |
2025-03-13 04:58:02 +0100 | izzyfalco | (~jake_pers@user/izzyfalco) (Ping timeout: 268 seconds) |
2025-03-13 04:58:02 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
2025-03-13 04:58:10 +0100 | <jackdk> | Yes, the idea is to provide `MonadState st (ParsecT e s m)` by lifting the state actions from the inner `m` in a way that doesn't affect the `ParsecT`. |
2025-03-13 04:58:25 +0100 | <euouae> | yup I follow |
2025-03-13 05:08:16 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 05:08:33 +0100 | veryfungi | (~veryfungi@user/veryfungi) veryfungi |
2025-03-13 05:13:09 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds) |
2025-03-13 05:18:58 +0100 | <euouae> | hm... I'm sort of bothered by this megaparsec thing |
2025-03-13 05:19:49 +0100 | <euouae> | they suggest to use takeWhile1P and so on for fast parsing into Text. But it does not allow the predicate to have any state, e.g. I'd like to parse "at most 10" digits, or so; I don't want a list of 10 characters, I want it as a string |
2025-03-13 05:20:28 +0100 | <euouae> | I thought I was getting somewhere by writing a parser with a stateful counter, but then I realized I have nowhere to plug that parser in, there's no combinator in megaparsec that accepts a parser and spits out a Text "fast". |
2025-03-13 05:22:48 +0100 | tavare | (~tavare@user/tavare) tavare |
2025-03-13 05:23:38 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 05:25:18 +0100 | <jackdk> | `takeP` is also described as "fast" in the haddocks |
2025-03-13 05:25:58 +0100 | <euouae> | yeah but that returns number of tokens |
2025-03-13 05:26:46 +0100 | <euouae> | say I'm trying to parse a phone number and I have some optional stuff like (xxx)-yyy-zzzz or xxxyyy zzzz etc |
2025-03-13 05:27:24 +0100 | <euouae> | I could have a parser that reads a single digit plus optional junk, and I want to apply it 10 times, it doesn't seem a possibility to do "fast" at least with my limited understanding |
2025-03-13 05:27:49 +0100 | <jackdk> | I would profile and be sure you actually have a problem here, too, and potentially consider the libphonenumber bindings |
2025-03-13 05:28:14 +0100 | <euouae> | I'm not actually doing phone numbers. It's not a profiling matter, I was trying to learn more about megaparsec and haskell in general |
2025-03-13 05:28:31 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
2025-03-13 05:28:44 +0100 | <euouae> | That's why I took that deep dive into mtl heh. But now I'm realizing there's nowhere for me to plug that parser into :P |
2025-03-13 05:29:13 +0100 | <euouae> | well, thanks anyway. I'll take the direction of your advice "just do the easy thing, e.g. T.pack on a list, and move on" |
2025-03-13 05:29:53 +0100 | euouae | TIL google/libphonenumber |
2025-03-13 05:30:07 +0100 | <jackdk> | Yeah ok I wouldn't put your control flow info in your monadic state then. If you need to run a thing optionally up to 10 times, I would look at `count'` from package `parser-combinators`. |
2025-03-13 05:30:21 +0100 | <jackdk> | (and then yeah, `fmap Text.pack`) |
2025-03-13 05:31:12 +0100 | <euouae> | What I imagined I would be doing is a `takeWhileFailure` (I made this up) plus my stateful parser |
2025-03-13 05:31:24 +0100 | veryfungi | (~veryfungi@user/veryfungi) (Quit: veryfungi) |
2025-03-13 05:31:46 +0100 | <euouae> | I was hoping a `takeWhileFailure` existed that was /fast/ meaning it crafted the Text string optimally instead of packing from a list |
2025-03-13 05:32:27 +0100 | <euouae> | Perhaps I can write this myself? Is it too low-level to try to have efficient Text operations on my own? |
2025-03-13 05:33:51 +0100 | <jackdk> | I don't know the guts of megaparsec well enough to say, but when I think back to my experience learning Haskell and the library ecosystem, I found iterative deepening search much more rewarding than deep dives on individual libraries. Do what's most rewarding for you, of course. |
2025-03-13 05:37:35 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 05:39:00 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 05:39:12 +0100 | <euouae> | Sounds good, thank you |
2025-03-13 05:39:25 +0100 | <jackdk> | You're welcome. Best of luck. |
2025-03-13 05:42:33 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 276 seconds) |
2025-03-13 05:43:51 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds) |
2025-03-13 05:49:16 +0100 | tusko | (uid478376@user/tusko) tusko |
2025-03-13 05:54:00 +0100 | k_hachig | (~k_hachig@2607:fea8:351d:ef0:a56d:37e8:f63c:429c) (Ping timeout: 246 seconds) |
2025-03-13 05:54:22 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 05:58:20 +0100 | ensyde | (~ensyde@2601:5c6:c200:6dc0::b413) ensyde |
2025-03-13 06:01:33 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
2025-03-13 06:07:48 +0100 | k_hachig_ | (~k_hachig@2607:fea8:351d:ef0:a56d:37e8:f63c:429c) k_hachig |
2025-03-13 06:08:39 +0100 | <euouae> | I don't understand this error |
2025-03-13 06:09:06 +0100 | <euouae> | I'm using text-2.0.2. I am trying to use `toLazyText :: Builder > Text` (supposedly... <https://hackage.haskell.org/package/text-2.0.2/docs/Data-Text-Lazy-Builder.html#v:toLazyText>) |
2025-03-13 06:09:25 +0100 | <euouae> | but the typechecker complains about "Couldn't match type ‘Data.Text.Internal.Lazy.Text’ with ‘Text’" |
2025-03-13 06:09:56 +0100 | <euouae> | :t toLazyText |
2025-03-13 06:09:57 +0100 | <lambdabot> | error: Variable not in scope: toLazyText |
2025-03-13 06:10:13 +0100 | <euouae> | :m Data.Text.Lazy.Builder |
2025-03-13 06:10:18 +0100 | <euouae> | :t toLazyText |
2025-03-13 06:10:19 +0100 | <lambdabot> | error: Variable not in scope: toLazyText |
2025-03-13 06:10:37 +0100 | <jackdk> | Without a code sample I can't be sure, but I think the thing you're passing to wants a strict text (as in `Data.Text.Text`) and you might want to consider `toStrict` on the result. |
2025-03-13 06:11:31 +0100 | <euouae> | But how can there be a type issue? I don't quite get what's going on here, I'm somewhat familiar with strictness and laziness |
2025-03-13 06:12:26 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 06:12:27 +0100 | <jackdk> | Because there are two `Text` types with the same unqualified name. `Data.Text.Text` is not `Data.Text.Lazy.Text` and haddocks do not make this at all clear. |
2025-03-13 06:12:33 +0100 | <euouae> | and by the way you were right, that's what the issue was. I didn't want lazy text, I just didn't know how to force it |
2025-03-13 06:12:54 +0100 | <euouae> | wow... really? this sucks. |
2025-03-13 06:12:59 +0100 | <jackdk> | "lazy text" is a value representing a chain of strict text chunks |
2025-03-13 06:13:20 +0100 | <euouae> | basically there's situations where haddock is more information complete and there's situations where ghci is more information complete |
2025-03-13 06:13:48 +0100 | <euouae> | e.g. `:i Foo` will only show you instances of imported modules (as opposed to haddock, full listing) but haddock will confuse different types for the same? |
2025-03-13 06:14:15 +0100 | k_hachig_ | (~k_hachig@2607:fea8:351d:ef0:a56d:37e8:f63c:429c) (Ping timeout: 252 seconds) |
2025-03-13 06:14:39 +0100 | <jackdk> | haddock shows the type names absent any qualification AIUI, and this can be quite confusing. |
2025-03-13 06:15:12 +0100 | <euouae> | ah actually -- if you hover over the name, it shows it complete |
2025-03-13 06:15:25 +0100 | <euouae> | e.g. Text says Data.Text.Lazy for its module on hover-over |
2025-03-13 06:15:55 +0100 | <euouae> | a footgun here and there, but thank God for IRC |
2025-03-13 06:16:01 +0100 | <euouae> | we made it through unharmed |
2025-03-13 06:16:54 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-03-13 06:17:25 +0100 | <euouae> | by the way, I found a good enough solution for me, I didn't need complicated monads |
2025-03-13 06:18:32 +0100 | <euouae> | I changed `digitChar` to `Text.Builder.singleton <$> digitChar` which returns a [Builder] instead of a [String] or [Char], and then I mconcat over the list, so there's no intermediate String |
2025-03-13 06:18:58 +0100 | infohazards | (~user@user/fmira) fmira |
2025-03-13 06:19:03 +0100 | euouae | wonders if that made a difference from T.pack xs where xs :: [Char] |
2025-03-13 06:19:27 +0100 | <euouae> | probably for the worse. oh well. time to sign off |
2025-03-13 06:19:29 +0100 | euouae | (~euouae@user/euouae) () |
2025-03-13 06:23:19 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 06:27:46 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 06:27:59 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 260 seconds) |
2025-03-13 06:32:09 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds) |
2025-03-13 06:36:35 +0100 | ensyde | (~ensyde@2601:5c6:c200:6dc0::b413) (Quit: WeeChat 4.5.2) |
2025-03-13 06:38:21 +0100 | infohazards | (~user@user/fmira) (Remote host closed the connection) |
2025-03-13 06:38:29 +0100 | user_ | (~user@user/fmira) fmira |
2025-03-13 06:38:58 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich |
2025-03-13 06:39:18 +0100 | user_ | (~user@user/fmira) (Remote host closed the connection) |
2025-03-13 06:40:10 +0100 | infohazards | (~user@user/fmira) fmira |
2025-03-13 06:43:10 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 06:47:21 +0100 | Human3748 | (~Human32@155.2.190.68) |
2025-03-13 06:47:29 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds) |
2025-03-13 06:54:33 +0100 | Sgeo | (~Sgeo@user/sgeo) (Ping timeout: 245 seconds) |
2025-03-13 06:58:30 +0100 | Sgeo | (~Sgeo@user/sgeo) Sgeo |
2025-03-13 06:58:33 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 07:03:06 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-03-13 07:03:11 +0100 | hgolden | (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363) (Remote host closed the connection) |
2025-03-13 07:03:36 +0100 | Sgeo_ | (~Sgeo@user/sgeo) Sgeo |
2025-03-13 07:05:18 +0100 | Sgeo | (~Sgeo@user/sgeo) (Ping timeout: 252 seconds) |
2025-03-13 07:06:55 +0100 | fantom | (~fantom@2.219.56.221) (Ping timeout: 244 seconds) |
2025-03-13 07:07:47 +0100 | michalz | (~michalz@185.246.207.215) |
2025-03-13 07:09:04 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 07:11:10 +0100 | takuan | (~takuan@d8D86B601.access.telenet.be) |
2025-03-13 07:11:38 +0100 | hgolden | (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363) hgolden |
2025-03-13 07:13:06 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 248 seconds) |
2025-03-13 07:13:42 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 268 seconds) |
2025-03-13 07:13:55 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 07:18:17 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
2025-03-13 07:28:41 +0100 | fantom | (~fantom@2.219.56.221) |
2025-03-13 07:29:17 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 07:34:33 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-03-13 07:38:33 +0100 | a_fantom | (~fantom@2.219.56.221) |
2025-03-13 07:39:59 +0100 | fantom | (~fantom@2.219.56.221) (Ping timeout: 244 seconds) |
2025-03-13 07:45:21 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 07:47:51 +0100 | CiaoSen | (~Jura@2a02:8071:64e1:7180::ac59) CiaoSen |
2025-03-13 07:50:36 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds) |
2025-03-13 07:54:28 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 07:55:13 +0100 | Human3748 | (~Human32@155.2.190.68) (Ping timeout: 248 seconds) |
2025-03-13 07:55:26 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 07:58:49 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
2025-03-13 07:59:59 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds) |
2025-03-13 08:00:03 +0100 | caconym | (~caconym@user/caconym) (Quit: bye) |
2025-03-13 08:01:01 +0100 | caconym | (~caconym@user/caconym) caconym |
2025-03-13 08:05:41 +0100 | jmcantrell | (~weechat@user/jmcantrell) (Quit: WeeChat 4.5.2) |
2025-03-13 08:10:46 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 08:13:30 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds) |
2025-03-13 08:13:43 +0100 | Lord_of_Life_ | (~Lord@user/lord-of-life/x-2819915) Lord_of_Life |
2025-03-13 08:15:07 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
2025-03-13 08:15:07 +0100 | Lord_of_Life_ | Lord_of_Life |
2025-03-13 08:20:31 +0100 | baivab85 | (~baivab85@2402:3a80:42e4:2d1f:ed95:878a:c23a:175b) |
2025-03-13 08:21:14 +0100 | <baivab85> | Hi Everyone |
2025-03-13 08:23:01 +0100 | <baivab85> | My name is Baivab Mukherjee. I'm a gsoc aspirant |
2025-03-13 08:23:24 +0100 | baivab85 | (~baivab85@2402:3a80:42e4:2d1f:ed95:878a:c23a:175b) (Client Quit) |
2025-03-13 08:26:09 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 08:30:44 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
2025-03-13 08:37:57 +0100 | jjhoo | (jahakala@user/jjhoo) (Ping timeout: 248 seconds) |
2025-03-13 08:39:30 +0100 | jjhoo | (jahakala@user/jjhoo) jjhoo |
2025-03-13 08:39:51 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 08:41:30 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 08:41:51 +0100 | jle` | (~jle`@2603:8001:3b00:11:dc30:beb5:de14:fd6) (Ping timeout: 265 seconds) |
2025-03-13 08:42:38 +0100 | jle` | (~jle`@2603:8001:3b00:11:ad81:3a03:5eb:774) jle` |
2025-03-13 08:42:49 +0100 | ft | (~ft@p508db291.dip0.t-ipconnect.de) (Quit: leaving) |
2025-03-13 08:43:43 +0100 | infohazards | (~user@user/fmira) (Remote host closed the connection) |
2025-03-13 08:44:11 +0100 | infohazards | (~user@user/fmira) fmira |
2025-03-13 08:44:29 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 260 seconds) |
2025-03-13 08:48:34 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds) |
2025-03-13 08:51:30 +0100 | Sgeo_ | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2025-03-13 08:55:39 +0100 | jjhoo | (jahakala@user/jjhoo) (Ping timeout: 246 seconds) |
2025-03-13 08:56:23 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 08:56:24 +0100 | machinedgod | (~machinedg@d108-173-18-100.abhsia.telus.net) machinedgod |
2025-03-13 08:57:37 +0100 | jjhoo | (~jahakala@user/jjhoo) jjhoo |
2025-03-13 08:58:52 +0100 | tusko | (uid478376@user/tusko) (Quit: Connection closed for inactivity) |
2025-03-13 09:00:48 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
2025-03-13 09:01:45 +0100 | ljdarj | (~Thunderbi@user/ljdarj) ljdarj |
2025-03-13 09:03:52 +0100 | plitter | (~plitter@user/plitter) (Ping timeout: 272 seconds) |
2025-03-13 09:10:37 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 244 seconds) |
2025-03-13 09:11:44 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-13 09:15:05 +0100 | infohazards | (~user@user/fmira) (Remote host closed the connection) |
2025-03-13 09:16:11 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) sord937 |
2025-03-13 09:16:13 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds) |
2025-03-13 09:24:54 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) lisbeths |
2025-03-13 09:25:06 +0100 | chele | (~chele@user/chele) chele |
2025-03-13 09:29:29 +0100 | tzh | (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz) |
2025-03-13 09:35:07 +0100 | mange | (~user@user/mange) (Quit: Quittin' time!) |
2025-03-13 09:42:14 +0100 | tavare | (~tavare@user/tavare) (Ping timeout: 260 seconds) |
2025-03-13 09:46:29 +0100 | plitter | (~plitter@user/plitter) plitter |
2025-03-13 09:47:17 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 09:51:24 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
2025-03-13 09:52:11 +0100 | merijn | (~merijn@77.242.116.146) merijn |
2025-03-13 09:56:30 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) |
2025-03-13 09:56:31 +0100 | tavare | (~tavare@150.129.88.189) |
2025-03-13 09:56:31 +0100 | tavare | (~tavare@150.129.88.189) (Changing host) |
2025-03-13 09:56:31 +0100 | tavare | (~tavare@user/tavare) tavare |
2025-03-13 09:58:15 +0100 | k_hachig_ | (~k_hachig@2607:fea8:351d:ef0:a56d:37e8:f63c:429c) k_hachig |
2025-03-13 10:02:09 +0100 | zlqrvx_ | (~zlqrvx@101.175.150.247) |
2025-03-13 10:03:16 +0100 | zlqrvx | (~zlqrvx@2001:8003:8c8b:e00:374a:bdcb:457c:d1e3) (Read error: Connection reset by peer) |
2025-03-13 10:03:41 +0100 | hgolden_ | (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363) hgolden |
2025-03-13 10:04:49 +0100 | k_hachig_ | (~k_hachig@2607:fea8:351d:ef0:a56d:37e8:f63c:429c) (Ping timeout: 248 seconds) |
2025-03-13 10:05:48 +0100 | hgolden | (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363) (Ping timeout: 276 seconds) |
2025-03-13 10:09:03 +0100 | kuribas | (~user@ip-188-118-57-242.reverse.destiny.be) kuribas |
2025-03-13 10:19:28 +0100 | Smiles | (uid551636@id-551636.lymington.irccloud.com) Smiles |
2025-03-13 10:19:31 +0100 | infohazards | (~user@user/fmira) fmira |
2025-03-13 10:20:18 +0100 | infohazards | (~user@user/fmira) (Remote host closed the connection) |
2025-03-13 10:23:11 +0100 | infohazards | (~user@user/fmira) fmira |
2025-03-13 10:26:54 +0100 | dhil | (~dhil@2a0c:b381:52e:3600:e62:5586:6568:9198) dhil |
2025-03-13 10:27:15 +0100 | zlqrvx_ | (~zlqrvx@101.175.150.247) (Read error: Connection reset by peer) |
2025-03-13 10:27:56 +0100 | zlqrvx | (~zlqrvx@2001:8003:8c8b:e00:374a:bdcb:457c:d1e3) |
2025-03-13 10:33:00 +0100 | econo_ | (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity) |
2025-03-13 10:33:01 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 10:36:49 +0100 | merijn | (~merijn@77.242.116.146) (Ping timeout: 248 seconds) |
2025-03-13 10:37:36 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 272 seconds) |
2025-03-13 10:44:27 +0100 | <cheater> | hi baivab |
2025-03-13 10:44:28 +0100 | <cheater> | welcome |
2025-03-13 10:48:59 +0100 | <mauke> | talking to ghosts |
2025-03-13 10:50:27 +0100 | merijn | (~merijn@77.242.116.146) merijn |
2025-03-13 11:00:41 +0100 | tavare | (~tavare@user/tavare) (Ping timeout: 252 seconds) |
2025-03-13 11:01:19 +0100 | Square2 | (~Square4@user/square) Square |
2025-03-13 11:02:34 +0100 | Square | (~Square@user/square) Square |
2025-03-13 11:06:46 +0100 | <cheater> | ghosts are people too |
2025-03-13 11:07:25 +0100 | Square | (~Square@user/square) (Ping timeout: 268 seconds) |
2025-03-13 11:09:44 +0100 | MyNetAz | (~MyNetAz@user/MyNetAz) (Remote host closed the connection) |
2025-03-13 11:16:44 +0100 | MyNetAz | (~MyNetAz@user/MyNetAz) MyNetAz |
2025-03-13 11:18:25 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 11:18:27 +0100 | xff0x | (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 246 seconds) |
2025-03-13 11:23:09 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 260 seconds) |
2025-03-13 11:34:10 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2025-03-13 11:37:12 +0100 | ubert | (~Thunderbi@2a02:8109:ab8a:5a00:7723:d0df:3da6:a135) ubert |
2025-03-13 11:37:33 +0100 | __monty__ | (~toonn@user/toonn) toonn |
2025-03-13 11:38:49 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 252 seconds) |
2025-03-13 11:44:13 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) lortabac |
2025-03-13 12:00:04 +0100 | caconym | (~caconym@user/caconym) (Quit: bye) |
2025-03-13 12:00:24 +0100 | tabaqui | (~tabaqui@167.71.80.236) tabaqui |
2025-03-13 12:02:14 +0100 | caconym | (~caconym@user/caconym) caconym |
2025-03-13 12:04:09 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 12:06:20 +0100 | jespada | (~jespada@2800:a4:22a9:8000:65f8:4b81:436a:cdbf) jespada |
2025-03-13 12:08:48 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 272 seconds) |
2025-03-13 12:11:06 +0100 | mange | (~user@user/mange) mange |
2025-03-13 12:24:22 +0100 | xff0x | (~xff0x@2405:6580:b080:900:2020:1277:8563:d3ac) |
2025-03-13 12:27:13 +0100 | CiaoSen | (~Jura@2a02:8071:64e1:7180::ac59) (Ping timeout: 248 seconds) |
2025-03-13 12:33:25 +0100 | <Square2> | I need to maintain multiple versions of Aeson To-/FromJSON for the same types. What do you think is the easiest path for this. Careful module/import management. Use newtype trickery? |
2025-03-13 12:35:03 +0100 | mange | (~user@user/mange) (Quit: Zzz...) |
2025-03-13 12:41:38 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 248 seconds) |
2025-03-13 12:49:53 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-03-13 12:54:34 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 260 seconds) |
2025-03-13 12:59:17 +0100 | infohazards | (~user@user/fmira) (Remote host closed the connection) |
2025-03-13 13:00:04 +0100 | infohazards | (~user@user/fmira) fmira |
2025-03-13 13:03:34 +0100 | comerijn | (~merijn@77.242.116.146) merijn |
2025-03-13 13:04:38 +0100 | <haskellbridge> | <Jack> Square2: I’d suggest newtype trickery. |
2025-03-13 13:06:30 +0100 | merijn | (~merijn@77.242.116.146) (Ping timeout: 276 seconds) |
2025-03-13 13:06:44 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) lortabac |
2025-03-13 13:06:49 +0100 | <Square2> | Jack, Oh thanks. Just curious, why? Too hard to keep all imports in your head? |
2025-03-13 13:07:03 +0100 | __monty__ | (~toonn@user/toonn) (Ping timeout: 245 seconds) |
2025-03-13 13:09:59 +0100 | weary-traveler | (~user@user/user363627) user363627 |
2025-03-13 13:13:34 +0100 | k_hachig_ | (~k_hachig@2607:fea8:351d:ef0:a56d:37e8:f63c:429c) k_hachig |
2025-03-13 13:14:30 +0100 | bradparker | (sid262931@id-262931.uxbridge.irccloud.com) (Read error: Connection reset by peer) |
2025-03-13 13:14:32 +0100 | geekosaur | (sid609282@xmonad/geekosaur) (Read error: Connection reset by peer) |
2025-03-13 13:14:35 +0100 | SethTisue | (sid14912@id-14912.ilkley.irccloud.com) (Read error: Connection reset by peer) |
2025-03-13 13:14:42 +0100 | bradparker | (sid262931@id-262931.uxbridge.irccloud.com) bradparker |
2025-03-13 13:14:42 +0100 | geekosaur | (sid609282@xmonad/geekosaur) geekosaur |
2025-03-13 13:14:44 +0100 | SethTisue | (sid14912@id-14912.ilkley.irccloud.com) |
2025-03-13 13:14:53 +0100 | igemnace | (~igemnace@user/igemnace) (Remote host closed the connection) |
2025-03-13 13:14:59 +0100 | jakesyl_____ | (sid56879@id-56879.hampstead.irccloud.com) (Ping timeout: 260 seconds) |
2025-03-13 13:15:03 +0100 | <tomsmeding> | Square2: instances are viral -- you can't choose to _not_ export them, and if you import them, you inherit them automatically |
2025-03-13 13:15:06 +0100 | rune_ | (sid21167@id-21167.ilkley.irccloud.com) (Read error: Connection reset by peer) |
2025-03-13 13:15:06 +0100 | astra | (sid289983@user/amish) (Read error: Connection reset by peer) |
2025-03-13 13:15:08 +0100 | meinside | (uid24933@id-24933.helmsley.irccloud.com) (Read error: Connection reset by peer) |
2025-03-13 13:15:08 +0100 | unlucy | (sid572875@user/unlucy) (Read error: Connection reset by peer) |
2025-03-13 13:15:11 +0100 | <tomsmeding> | (and also re-export them automatically) |
2025-03-13 13:15:14 +0100 | rune_ | (sid21167@id-21167.ilkley.irccloud.com) |
2025-03-13 13:15:19 +0100 | meinside | (uid24933@id-24933.helmsley.irccloud.com) meinside |
2025-03-13 13:15:23 +0100 | astra | (sid289983@id-289983.hampstead.irccloud.com) |
2025-03-13 13:15:27 +0100 | <tomsmeding> | having two different instances of the same class for the same type in different modules is a recipe for trouble |
2025-03-13 13:15:29 +0100 | jakesyl_____ | (sid56879@id-56879.hampstead.irccloud.com) |
2025-03-13 13:15:39 +0100 | unlucy | (sid572875@user/unlucy) unlucy |
2025-03-13 13:16:03 +0100 | <tomsmeding> | and furthermore it breaks the general assumption in haskell that typeclass instances are confluent, which is precisely the assumption that any particular class - type combination has at most _one_ instance |
2025-03-13 13:16:21 +0100 | <Square2> | Ah ok. I thought it could work with careful arrangement of things, but I could see it becoming real troublesome |
2025-03-13 13:16:35 +0100 | <tomsmeding> | this is what makes the Data.Set / Data.Map API work, for example: if you could pass the same Map between different modules with different Ord instances on the key in scope, you'll severly break the internal invariants of the Map data structure |
2025-03-13 13:16:38 +0100 | <dminuoso> | Square2: You are not forced to use FromJSON/ToJSON |
2025-03-13 13:16:44 +0100 | df | (~ben@justworks.xyz) (Ping timeout: 260 seconds) |
2025-03-13 13:16:46 +0100 | <dminuoso> | Just dont use typeclass machinery. |
2025-03-13 13:17:02 +0100 | <dminuoso> | They are a rather poor fit for de/-serialization precisely for reasons like you just encountered. |
2025-03-13 13:17:17 +0100 | df | (~ben@justworks.xyz) |
2025-03-13 13:17:38 +0100 | <tomsmeding> | dminuoso: what to do instead? |
2025-03-13 13:17:47 +0100 | <Square2> | dminuoso, what do you suggest instead? I use the OpenApi dependency which seems to require me to use Aeson instances. |
2025-03-13 13:17:50 +0100 | __monty__ | (~toonn@user/toonn) toonn |
2025-03-13 13:18:18 +0100 | igemnace | (~igemnace@user/igemnace) igemnace |
2025-03-13 13:18:50 +0100 | <tomsmeding> | especially if some external dependency requires you to use the classes, use newtype wrappers |
2025-03-13 13:19:10 +0100 | <tomsmeding> | you can even have only one newtype, and give it a phantom parameter that indicates the particular (de)serialisation you want ;) |
2025-03-13 13:19:12 +0100 | <dminuoso> | tomsmeding: `toJSON :: YourThing -> Value` - you do not have to attach this to a typeclass for this to work. |
2025-03-13 13:19:41 +0100 | <tomsmeding> | dminuoso: toJSON is a method of ToJSON. |
2025-03-13 13:19:51 +0100 | <dminuoso> | Yes, so? |
2025-03-13 13:20:00 +0100 | <tomsmeding> | you can only use it on types that implement the class anyway? |
2025-03-13 13:20:04 +0100 | <dminuoso> | `turnMyThingToJSON :: Thing -> Value` |
2025-03-13 13:20:17 +0100 | <dminuoso> | I feel like this is a strange blindness issue. |
2025-03-13 13:20:20 +0100 | <tomsmeding> | right, you can manually turn the thing into a Value, of course |
2025-03-13 13:20:23 +0100 | <tomsmeding> | and manually parse it from a Value |
2025-03-13 13:20:30 +0100 | <dminuoso> | What do you mean by "manually"? |
2025-03-13 13:20:48 +0100 | <tomsmeding> | but then you miss out on the combinators that aeson provides in 'Parser' |
2025-03-13 13:21:01 +0100 | <dminuoso> | Most of them are usable without typeclasses. |
2025-03-13 13:21:40 +0100 | <dminuoso> | Or well, you can reroll them with minimal effort. |
2025-03-13 13:21:48 +0100 | <tomsmeding> | right |
2025-03-13 13:22:07 +0100 | <tomsmeding> | the documentation rather heavily steers you towards writing instances, though |
2025-03-13 13:22:26 +0100 | <tomsmeding> | and hence other libraries are going to expect you to have used the instance style |
2025-03-13 13:22:31 +0100 | <dminuoso> | Oh yes, the documentation is not clear. Especially at the border where you need to turn this Value into a Text or vice versa. |
2025-03-13 13:22:39 +0100 | <dminuoso> | The API is there, just not easily found/documented. |
2025-03-13 13:22:54 +0100 | <tomsmeding> | also I guess (from the docs) that one would rather use Encoding instead of Value? |
2025-03-13 13:23:13 +0100 | <dminuoso> | Depends on what is more comfortable. |
2025-03-13 13:23:18 +0100 | <dminuoso> | (Or whether you have a performance constraint) |
2025-03-13 13:23:26 +0100 | <dminuoso> | But sure |
2025-03-13 13:26:35 +0100 | <dminuoso> | Though even if you cant find the API bits, you can just conjure some `data Decoder a = Decoder (Value -> Parser a)` (and equivalently for ToJSON) |
2025-03-13 13:26:54 +0100 | <dminuoso> | Which you could even use in a pinch |
2025-03-13 13:27:04 +0100 | <dminuoso> | (Well, make it a newtype of course) |