Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,803,981 events total
2025-09-29 11:05:01 <merijn> Leary: Right, but that can't be valid Haskell to begin with
2025-09-29 11:05:21 <merijn> You have to bind the partial application to a name, then
2025-09-29 11:05:29 justache parts (~justache@user/justache) (bye?)
2025-09-29 11:05:54 <merijn> > let (☃) = liftA2 (+) in Just 2 ☃ Just 3
2025-09-29 11:05:55 <lambdabot> Just 5
2025-09-29 11:06:11 <merijn> And if you're gonna bind a name, then you can easily to whatever infix you want
2025-09-29 11:06:24 <Leary> It worked, didn't it?
2025-09-29 11:08:00 × chromoblob quits (~chromoblo@user/chromob1ot1c) (Read error: Connection reset by peer)
2025-09-29 11:08:00 <merijn> Leary: I mean, that $ and & hack is approximately infinitely less readable than the prefix `liftA2` call, so I would argue no, it's also 2 operators + 1 a function, not a single infix thing :p
2025-09-29 11:08:21 chromoblob joins (~chromoblo@user/chromob1ot1c)
2025-09-29 11:09:31 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 255 seconds)
2025-09-29 11:09:40 <yin> maybe you're right after all
2025-09-29 11:13:15 arandombit joins (~arandombi@user/arandombit)
2025-09-29 11:18:06 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 256 seconds)
2025-09-29 11:19:10 <sshine> yin, at least `on` reads nicely.
2025-09-29 11:22:24 × Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
2025-09-29 11:22:41 arandombit joins (~arandombi@user/arandombit)
2025-09-29 11:26:34 Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542)
2025-09-29 11:28:39 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 250 seconds)
2025-09-29 11:28:52 xff0x joins (~xff0x@2405:6580:b080:900:fe2c:68a3:b199:389f)
2025-09-29 11:33:37 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 264 seconds)
2025-09-29 11:35:17 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
2025-09-29 11:37:37 <yin> > (+) `liftA2` (Just 1) $ (Just 2)
2025-09-29 11:37:39 <lambdabot> Just 3
2025-09-29 11:38:15 <yin> in my mind, we would ideally bind the infix operator more tightly than function application, but that's not possible
2025-09-29 11:38:50 <yin> so we need the $
2025-09-29 11:39:45 <yin> sshine: i am vehemently agains the idea that logic languages should emulate natural language
2025-09-29 11:41:47 <yin> ... "logical languages"?
2025-09-29 11:42:09 <yin> programming languages at least
2025-09-29 11:42:32 arandombit joins (~arandombi@user/arandombit)
2025-09-29 11:44:38 <yin> i don't care which symbols we use, as long as it's consistent. in the case of `on`, the use of `` i find it's inelegant
2025-09-29 11:45:58 × tromp quits (~textual@2001:1c00:3487:1b00:5d4:dfa6:7d7:2af3) (Quit: My iMac has gone to sleep. ZZZzzz…)
2025-09-29 11:46:33 <yin> not because of the ` symbol but because of its semantics
2025-09-29 11:50:59 <chromoblob> i want following syntax: Just 1 `(liftA2 (+))` Just 2
2025-09-29 11:53:57 <[exa]> chromoblob: parser developers wish for backtick disambiguation tools
2025-09-29 11:54:24 <merijn> chromoblob: That'd be nice, but thinking about ramification on parsing makes me throw that right out :p
2025-09-29 11:54:48 × divlamir quits (~divlamir@user/divlamir) (Read error: Connection reset by peer)
2025-09-29 11:54:59 <merijn> In practice I find it a nonissue, since you can trivially locally bind it infix for readability
2025-09-29 11:55:08 [exa] wishes for back-backtick, the foretick, like ´ but worse
2025-09-29 11:55:10 divlamir joins (~divlamir@user/divlamir)
2025-09-29 11:55:50 <yin> [exa]: at least that wouldn't trip markdown up
2025-09-29 11:56:01 <chromoblob> i also want pattern syntax ("abc" ++ s) - like n+k patterns, but for strings
2025-09-29 11:56:28 <[exa]> chromoblob: you can do that pretty well with prisms
2025-09-29 11:59:56 <[exa]> as in, it's not gonna be a pattern without some extra work, but you can stash it somewhere in guards: | Just arg <- preview (prefixed "hahaha") arg = ...
2025-09-29 12:05:20 <yin> in the language J, (h f g) is (liftA2 f h g), a "monadic fork" they call it, as a basic syntax feature, which is GREAT
2025-09-29 12:06:03 <[exa]> yin: what's wrong with (+) <$> Just 1 <*> Just 2 ?
2025-09-29 12:06:17 <yin> :t liftA2 @((->) _)
2025-09-29 12:06:18 <lambdabot> error: parse error on input ‘->’
2025-09-29 12:06:31 <yin> hmm
2025-09-29 12:06:59 <yin> [exa]: liftA2 implementation can be more performant for some Applicatives
2025-09-29 12:07:25 <probie> yin: Is it that great? It works because verbs and nouns are distinct, and long trains are pretty hard to read
2025-09-29 12:07:33 <yin> % liftA2 @((->) _)
2025-09-29 12:07:33 <yahb2> <interactive>:19:1: error: [GHC-39999] ; • No instance for ‘Show ; ((a0 -> b0 -> c0) -> (w0 -> a0) -> (w0 -> b0) -> w0 -> c0)’ ; arising from a use of ‘Yahb2Def...
2025-09-29 12:08:15 <yin> I never know how to do this here
2025-09-29 12:08:50 <probie> % :t liftA2 @((->) _)
2025-09-29 12:08:51 <yahb2> liftA2 @((->) _) ; :: Applicative ((->) w) => ; (a -> b -> c) -> (w -> a) -> (w -> b) -> w -> c
2025-09-29 12:10:48 lisq joins (~quassel@lis.moe)
2025-09-29 12:11:34 × APic quits (apic@apic.name) (Ping timeout: 260 seconds)
2025-09-29 12:17:33 APic joins (apic@chiptune.apic.name)
2025-09-29 12:17:51 <[exa]> yin: ah okay
2025-09-29 12:26:00 × trickard quits (~trickard@cpe-50-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-09-29 12:26:13 trickard_ joins (~trickard@cpe-50-98-47-163.wireline.com.au)
2025-09-29 12:29:48 <yin> probie: i like it. i agree with you though, for some definition of "hard to read"
2025-09-29 12:32:15 <[exa]> yin: btw in my code I usually do this with shortcuts like (<+>) = liftA2 (+). Most frequently with <:> I'd say.
2025-09-29 12:35:24 × mulk quits (~mulk@pd95144c3.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
2025-09-29 12:37:13 xdej joins (~xdej@quatramaran.salle-s.org)
2025-09-29 12:38:39 craunts79 joins (~craunts@136.158.7.194)
2025-09-29 12:40:02 <ncf> just don't do that with ($) or (*) and you'll be fine :)
2025-09-29 12:40:49 <ncf> (<*>) = liftA2 ($); (<$>) = liftA1
2025-09-29 12:41:37 <yin> ok listen up
2025-09-29 12:42:03 <yin> lift f a b = liftA2 f (pure a) b
2025-09-29 12:42:20 <yin> no have <f> mean (lift f)
2025-09-29 12:42:25 <yin> s/no/now
2025-09-29 12:42:38 <ncf> you just want idiom brackets
2025-09-29 12:42:45 <yin> ncf: yes
2025-09-29 12:43:12 phm joins (~peter@user/phm)
2025-09-29 12:47:18 <yin> ncf: wait are you talking about this? https://wiki.haskell.org/Idiom_brackets
2025-09-29 12:48:31 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 255 seconds)
2025-09-29 12:48:49 <yin> not quite
2025-09-29 12:48:51 <yin> i want
2025-09-29 12:49:17 <ncf> well, i'm talking about the notation mcbride came up with, not that weird typeclass encoding. agda has this: https://agda.readthedocs.io/en/stable/language/syntactic-sugar.html#idiom-brackets
2025-09-29 12:49:22 × ThePenguin quits (~ThePengui@cust-95-80-28-221.csbnet.se) (Remote host closed the connection)
2025-09-29 12:49:26 <yin> a <f> b = f <$> a <*> b
2025-09-29 12:50:11 <yin> or rather (pure a)?
2025-09-29 12:50:14 <yin> i don't know
2025-09-29 12:51:01 <yin> ncf oh that's nice
2025-09-29 12:51:14 ThePenguin joins (~ThePengui@cust-95-80-28-221.csbnet.se)
2025-09-29 12:53:55 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 255 seconds)
2025-09-29 12:59:51 × Googulator40 quits (~Googulato@2a01-036d-0106-03fa-f110-0864-c42c-107f.pool6.digikabel.hu) (Quit: Client closed)
2025-09-29 13:00:27 Googulator40 joins (~Googulato@193-226-241-153.pool.digikabel.hu)
2025-09-29 13:02:41 <kaol> I feel ridiculous after composing six fmaps in a row. If it works it works.
2025-09-29 13:03:43 <merijn> kaol: Maybe you need Compose?
2025-09-29 13:04:51 × mange quits (~mange@user/mange) (Quit: Zzz...)
2025-09-29 13:06:46 ttybitnik joins (~ttybitnik@user/wolper)
2025-09-29 13:07:42 × trickard_ quits (~trickard@cpe-50-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-09-29 13:07:56 trickard_ joins (~trickard@cpe-50-98-47-163.wireline.com.au)
2025-09-29 13:08:00 tromp joins (~textual@2001:1c00:3487:1b00:5d4:dfa6:7d7:2af3)
2025-09-29 13:08:32 <yin> or maybe you need to study the art of origami
2025-09-29 13:09:31 <yin> i want a language based uniquely on folds
2025-09-29 13:11:19 <kaol> I stacked that many maybes, eithers, lists and 2-tuples together. I'm just amused by it, that's all.

All times are in UTC.