2025/02/12

Newest at the top

2025-02-12 22:49:40 +0100takuan(~takuan@d8D86B601.access.telenet.be) (Remote host closed the connection)
2025-02-12 22:49:05 +0100 <tomsmeding> merijn: euouae: https://github.com/tomsmeding/cabal/commit/e1faaf097cb8e78a5736f176e5e9542396d278e2 what do you think?
2025-02-12 22:49:04 +0100Spawns_Carpeting(~mobile@user/spawns-carpeting/x-6969421) (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in)
2025-02-12 22:45:56 +0100alfiee(~alfiee@user/alfiee) alfiee
2025-02-12 22:42:36 +0100 <tomsmeding> something like `map`, which polymorphic but not a typeclass method, can be rewritten as-is
2025-02-12 22:42:19 +0100tnt2tnt1
2025-02-12 22:42:19 +0100tnt1(~Thunderbi@user/tnt1) (Ping timeout: 260 seconds)
2025-02-12 22:42:09 +0100 <EvanR> the definition depends crucially on the type
2025-02-12 22:42:01 +0100 <EvanR> justsomeguy, only in the case of typeclass "methods" like fmap
2025-02-12 22:41:29 +0100tnt2(~Thunderbi@user/tnt1) tnt1
2025-02-12 22:41:01 +0100 <justsomeguy> I think I got so into the habit of just plugging in definitions when evaluating by hand, that I forgot that I have to do type resolution during each step. Most of what I was desk-checking before was monomorphic.
2025-02-12 22:40:49 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2025-02-12 22:40:12 +0100 <haskellbridge> <magic_rb> but ignoring optparse, i actually need this in tomland
2025-02-12 22:39:44 +0100 <haskellbridge> <magic_rb> but with optparse-applicative i couldnt get it to work because i couldnt put the different alternatives in subparsers, only commands and optparse wouldnt backtrack through <|> just by itself
2025-02-12 22:39:24 +0100michalz(~michalz@185.246.207.203) (Remote host closed the connection)
2025-02-12 22:39:09 +0100 <merijn> you just need to have a (static) parser for the tag inside the subparser
2025-02-12 22:39:04 +0100 <haskellbridge> <magic_rb> merijn: i think it can work if you rely on failure and backtracking
2025-02-12 22:38:51 +0100 <EvanR> merijn, yeah this is how I expected it
2025-02-12 22:38:51 +0100 <merijn> I think it can work, though
2025-02-12 22:38:40 +0100 <tomsmeding> that handles "tagged unions" somehow
2025-02-12 22:38:36 +0100remedan_(~remedan@ip-62-245-108-153.bb.vodafone.cz) remedan
2025-02-12 22:38:35 +0100 <tomsmeding> this would need to be a primitive parser
2025-02-12 22:38:30 +0100 <haskellbridge> <magic_rb> yeah...
2025-02-12 22:38:22 +0100 <tomsmeding> that's monadic
2025-02-12 22:38:21 +0100remedan(~remedan@ip-62-245-108-153.bb.vodafone.cz) (Ping timeout: 252 seconds)
2025-02-12 22:38:14 +0100 <tomsmeding> magic_rb: that sounds plausible, you want parsing to depend on the result of some other part of the parser
2025-02-12 22:37:47 +0100 <merijn> Scala is surprisingly ok as functional language, but implicits are the bane of my existence >.>
2025-02-12 22:37:06 +0100 <merijn> EvanR: Having to debug implicits in scala :p
2025-02-12 22:37:03 +0100 <EvanR> because I've been noticing the same thing
2025-02-12 22:37:03 +0100 <tomsmeding> merijn: in the .rst docs, can I refer to an option documented in a different file?
2025-02-12 22:36:52 +0100 <EvanR> merijn, what's this in relation to
2025-02-12 22:36:49 +0100 <justsomeguy> Ah, I see it now. Thanks mauke
2025-02-12 22:36:44 +0100 <haskellbridge> <magic_rb> so im trying to use either optparse-applicative or tomland to deserialize what i would call a tagged union, essentially this JSON: { type: one, something: foo } or { type: two, else: bar } where "type" must equal "one" or "two". But im struggling to make either work, i suspect its an inherent thing of both being based on applicatives?
2025-02-12 22:36:08 +0100 <mauke> justsomeguy: the last `(->) e a` should be `(->) e b`
2025-02-12 22:35:51 +0100 <tomsmeding> ... without that "maybe"
2025-02-12 22:35:38 +0100 <tomsmeding> so you get outer_fmap :: maybe (Maybe a -> b) -> (a -> Maybe a) -> (a -> b)
2025-02-12 22:35:19 +0100tnt2tnt1
2025-02-12 22:35:19 +0100tnt1(~Thunderbi@user/tnt1) (Ping timeout: 260 seconds)
2025-02-12 22:35:14 +0100 <monochrom> You have a typo but I think you are right.
2025-02-12 22:35:06 +0100 <tomsmeding> in your expression `fmap (fmap sum) Just [1,2,3]`, the second argument to the outer fmap is Just, which has type `a -> Maybe a`
2025-02-12 22:34:57 +0100 <justsomeguy> Sorry, you're right. I'll use a pastebin next time.
2025-02-12 22:34:46 +0100 <euouae> justsomeguy: you can paste with <https://paste.tomsmeding.com>
2025-02-12 22:34:44 +0100tri(~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 260 seconds)
2025-02-12 22:34:36 +0100 <tomsmeding> looks similar? :)
2025-02-12 22:34:21 +0100 <euouae> Yeah but don't do that justsomeguy
2025-02-12 22:34:18 +0100 <lambdabot> (b -> c) -> (a -> b) -> a -> c
2025-02-12 22:34:17 +0100 <tomsmeding> :t (.)
2025-02-12 22:34:13 +0100 <justsomeguy> I just tried to paste a few lines for the type signature evalation of the outer fmap, did it go through?
2025-02-12 22:34:12 +0100tnt2(~Thunderbi@user/tnt1) tnt1
2025-02-12 22:33:51 +0100 <justsomeguy> y