2024/08/29

2024-08-29 00:03:44 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 00:04:08 +0200 <dmj`> Bowuigi: I bet lambda sets could be added to Haskell syntax, then you could just desugar into a first order language
2024-08-29 00:08:29 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds)
2024-08-29 00:09:23 +0200 <haskellbridge> <thirdofmay18081814goya> can I check whether a type is a subtype of another in the repl?
2024-08-29 00:09:59 +0200 <geekosaur> last I checked Haskell didn't have subtypes
2024-08-29 00:10:32 +0200 <haskellbridge> <thirdofmay18081814goya> geekosaur: isn't "Functor f => f Int" a subtype of "Maybe Int"?
2024-08-29 00:10:59 +0200 <davean> No but it does unify.
2024-08-29 00:11:08 +0200 <geekosaur> type theoretically, but Haskell is not type theory
2024-08-29 00:12:02 +0200 <haskellbridge> <thirdofmay18081814goya> davean: is there a way to check whether two types unify?
2024-08-29 00:12:26 +0200 <haskellbridge> <thirdofmay18081814goya> geekosaur: hm right
2024-08-29 00:16:07 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2024-08-29 00:17:27 +0200 <davean> thirdofmay18081814goya: Thats exactly what type checking is.
2024-08-29 00:19:09 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 00:22:29 +0200az181(~az181@bmly-12-b2-v4wan-164596-cust791.vm4.cable.virginm.net)
2024-08-29 00:22:43 +0200gmg(~user@user/gehmehgeh) (Quit: Leaving)
2024-08-29 00:23:46 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
2024-08-29 00:23:54 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 260 seconds)
2024-08-29 00:24:48 +0200mreh(~matthew@host86-160-168-12.range86-160.btcentralplus.com) (Ping timeout: 246 seconds)
2024-08-29 00:25:36 +0200 <EvanR> can you construct a Functor f => f Int ?
2024-08-29 00:25:58 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
2024-08-29 00:28:24 +0200Square(~Square@user/square) (Ping timeout: 260 seconds)
2024-08-29 00:30:45 +0200sawilagar(~sawilagar@user/sawilagar) (Ping timeout: 246 seconds)
2024-08-29 00:33:34 +0200justsomeguy(~justsomeg@user/justsomeguy)
2024-08-29 00:34:33 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 00:35:29 +0200Tuplanolla(~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.)
2024-08-29 00:38:17 +0200 <haskellbridge> <thirdofmay18081814goya> we can get something like that by using
2024-08-29 00:38:17 +0200 <haskellbridge> ... long message truncated: https://kf8nh.com/_matrix/media/v3/download/kf8nh.com/syRpstTSDKPDUYCofoigqgqd (3 lines)
2024-08-29 00:38:51 +0200 <EvanR> well that is something else
2024-08-29 00:39:04 +0200 <EvanR> there you are hypothesizing it exists
2024-08-29 00:39:17 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
2024-08-29 00:39:19 +0200 <EvanR> if someone gives it to you what could be done with it
2024-08-29 00:39:33 +0200 <EvanR> but doesn't address how to really create it
2024-08-29 00:39:43 +0200 <haskellbridge> <thirdofmay18081814goya> right I'm stating it exists and the compiler should tell me whether I've stated a contradiction
2024-08-29 00:39:54 +0200 <haskellbridge> <thirdofmay18081814goya> on the type-level
2024-08-29 00:39:56 +0200 <EvanR> no...
2024-08-29 00:40:12 +0200 <EvanR> hypothetical arguments are valid
2024-08-29 00:40:34 +0200 <EvanR> e.g. id :: Void -> Void, not an error
2024-08-29 00:40:49 +0200son0p(~ff@186.121.18.131)
2024-08-29 00:42:36 +0200 <haskellbridge> <thirdofmay18081814goya> whoops I meant
2024-08-29 00:42:36 +0200 <haskellbridge> ... long message truncated: https://kf8nh.com/_matrix/media/v3/download/kf8nh.com/pBYplRwmwndSGsCIaLsIlPRZ (3 lines)
2024-08-29 00:43:34 +0200 <EvanR> that's the same thing
2024-08-29 00:43:42 +0200 <EvanR> equivalent
2024-08-29 00:43:46 +0200 <haskellbridge> <thirdofmay18081814goya> no this one actually typechecks
2024-08-29 00:44:27 +0200 <haskellbridge> <thirdofmay18081814goya> the other one was "haskell f :: forall f. (Functor f => f Int -> Maybe Int)"
2024-08-29 00:44:59 +0200 <EvanR> oh
2024-08-29 00:45:27 +0200 <EvanR> ok within the context, unknown f can't be proved equal to Maybe
2024-08-29 00:48:12 +0200 <haskellbridge> <thirdofmay18081814goya> am a bit puzzled about their relationship however, the one with "f :: (forall f. Functor f => f Int) -> Maybe Int" does have the desired behaviour of telling us when the types unify but I don't understand why. I do understand that "f :: forall f. (Functor f => f Int -> Maybe Int)" with "f = id" is saying that ALL functors taking "Int" unify with "Maybe Int", which is false and doesn't typecheck
2024-08-29 00:49:19 +0200 <haskellbridge> <thirdofmay18081814goya> whoops meant to use different symbols for the function and the functor
2024-08-29 00:49:59 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 00:50:31 +0200 <ncf> id :: A → B iff you can implicitly coerce an A into a B iff A is a subtype of B. not rocket science
2024-08-29 00:50:53 +0200 <EvanR> the first one uses higher order polymorphism
2024-08-29 00:51:08 +0200 <ncf> well A and B stand for polytypes here
2024-08-29 00:53:41 +0200 <EvanR> anyway my intuition says you can't possibly create a forall f . Functor f => f Int
2024-08-29 00:53:42 +0200 <EvanR> xD
2024-08-29 00:54:21 +0200 <dolio> Pick f = Const Void
2024-08-29 00:55:03 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)
2024-08-29 00:55:03 +0200 <ncf> the first-order one tells you that, in context (f : Type, Functor f), f Int is not a subtype of Maybe Int
2024-08-29 00:56:39 +0200 <haskellbridge> <thirdofmay18081814goya> ncf: which one is the first-order one?
2024-08-29 00:56:53 +0200 <ncf> the one that's not higher-order
2024-08-29 00:57:11 +0200 <haskellbridge> <thirdofmay18081814goya> EvanR: why does "[Int]" fail?
2024-08-29 00:59:17 +0200Sgeo(~Sgeo@user/sgeo)
2024-08-29 00:59:38 +0200 <EvanR> that's either not a value or is a string
2024-08-29 01:00:30 +0200 <haskellbridge> <thirdofmay18081814goya> ncf: need a couple of keywords to read up on this, is the technical term "first-order polymorphism" vs "higher-order polymorphism"?
2024-08-29 01:00:52 +0200 <ncf> higher-rank is more common
2024-08-29 01:00:57 +0200 <haskellbridge> <thirdofmay18081814goya> EvanR: ah right I understand what you meant now
2024-08-29 01:03:46 +0200 <haskellbridge> <thirdofmay18081814goya> ncf: ok i see thanks! and we say "(forall f. Functor f => f Int) -> Maybe Int" uses higher-rank polymorphism while "forall f. (Functor f => f Int -> Maybe Int)" involves a rank 1 type instead?
2024-08-29 01:04:30 +0200 <ncf> yes
2024-08-29 01:04:52 +0200 <haskellbridge> <thirdofmay18081814goya> great thanks a lot!
2024-08-29 01:05:25 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 01:09:57 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2024-08-29 01:12:44 +0200toys(~toys@user/toys)
2024-08-29 01:15:10 +0200raehik(~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Ping timeout: 252 seconds)
2024-08-29 01:20:50 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 01:21:55 +0200 <haskellbridge> <thirdofmay18081814goya> hm any good references on rank 1 types and higher-rank polymorphism? books covering these maybe
2024-08-29 01:25:49 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds)
2024-08-29 01:27:54 +0200poscat(~poscat@user/poscat) (Ping timeout: 260 seconds)
2024-08-29 01:29:21 +0200 <haskellbridge> <thirdofmay18081814goya> tapl i think
2024-08-29 01:29:53 +0200poscat(~poscat@user/poscat)
2024-08-29 01:30:13 +0200 <glguy> are you wanting to know what it is or how to implement it?
2024-08-29 01:30:54 +0200 <haskellbridge> <thirdofmay18081814goya> glguy: what it is and why it produces different results wrt the typechecker
2024-08-29 01:31:50 +0200 <glguy> have you already seen this? https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/rank_polymorphism.html#arbitrary-ra…
2024-08-29 01:32:26 +0200 <haskellbridge> <thirdofmay18081814goya> glguy: no! will be reading this, thanks a lot
2024-08-29 01:36:16 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 01:39:53 +0200raehik(~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net)
2024-08-29 01:41:19 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds)
2024-08-29 01:42:05 +0200arahael(~arahael@user/arahael)
2024-08-29 01:46:09 +0200acidjnk_new(~acidjnk@p200300d6e72cfb17547c43ea473ec4ac.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2024-08-29 01:51:30 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 01:56:24 +0200son0p(~ff@186.121.18.131) (Quit: Leaving)
2024-08-29 01:56:32 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 255 seconds)
2024-08-29 02:00:03 +0200ZharMeny(~ZharMeny@user/ZharMeny) (Quit: roll for dice... hmm, no dice)
2024-08-29 02:07:11 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 02:11:33 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2024-08-29 02:22:36 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 02:27:56 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds)
2024-08-29 02:38:27 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 02:40:20 +0200athan_(~athan@syn-098-153-145-140.biz.spectrum.com)
2024-08-29 02:43:10 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds)
2024-08-29 02:51:45 +0200tt123109783243(~tt1231@syn-075-185-104-199.res.spectrum.com)
2024-08-29 02:53:53 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 02:58:27 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2024-08-29 03:01:37 +0200peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com)
2024-08-29 03:01:52 +0200az181(~az181@bmly-12-b2-v4wan-164596-cust791.vm4.cable.virginm.net) (Ping timeout: 252 seconds)
2024-08-29 03:09:18 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 03:11:13 +0200justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 248 seconds)
2024-08-29 03:13:20 +0200justsomeguy(~justsomeg@user/justsomeguy)
2024-08-29 03:14:05 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds)
2024-08-29 03:14:42 +0200ddellacosta(~ddellacos@ool-44c73c8f.dyn.optonline.net)
2024-08-29 03:17:53 +0200jjhoo(~jahakala@user/jjhoo) (Ping timeout: 245 seconds)
2024-08-29 03:20:07 +0200ddellacosta(~ddellacos@ool-44c73c8f.dyn.optonline.net) (Read error: Connection reset by peer)
2024-08-29 03:24:42 +0200madjestic(~madjestic@103-135-99-95.ftth.glasoperator.nl) (Ping timeout: 246 seconds)
2024-08-29 03:24:44 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 03:25:44 +0200peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 260 seconds)
2024-08-29 03:26:25 +0200ddellacosta(~ddellacos@ool-44c73c8f.dyn.optonline.net)
2024-08-29 03:28:49 +0200tt123109783243(~tt1231@syn-075-185-104-199.res.spectrum.com) (Ping timeout: 260 seconds)
2024-08-29 03:29:22 +0200tt123109783243(~tt1231@syn-075-185-104-199.res.spectrum.com)
2024-08-29 03:30:08 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 255 seconds)
2024-08-29 03:30:48 +0200Typedfern(~Typedfern@91.red-83-37-29.dynamicip.rima-tde.net) (Ping timeout: 245 seconds)
2024-08-29 03:34:49 +0200jjhoo(~jahakala@user/jjhoo)
2024-08-29 03:40:46 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 03:43:25 +0200Typedfern(~Typedfern@91.red-83-37-29.dynamicip.rima-tde.net)
2024-08-29 03:45:21 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2024-08-29 03:47:06 +0200krei-se(~krei-se@p57af29d2.dip0.t-ipconnect.de) (Ping timeout: 272 seconds)
2024-08-29 03:48:22 +0200krei-se(~krei-se@p57af29f0.dip0.t-ipconnect.de)
2024-08-29 03:55:01 +0200spew(~spew@2806:2a0:1522:8662::cebf) (Quit: spew)
2024-08-29 03:56:12 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 03:57:15 +0200justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 246 seconds)
2024-08-29 04:00:48 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds)
2024-08-29 04:03:37 +0200machinedgod(~machinedg@d50-99-47-73.abhsia.telus.net)
2024-08-29 04:05:17 +0200 <haskellbridge> <Bowuigi> dmj` haven't done much with Lean tbh, but it likely has codata types via suspension, so sort of?
2024-08-29 04:08:38 +0200 <haskellbridge> <Bowuigi> thirdofmay18081814goya there are a ton of attempts at getting inference for higher rank polymorphism. Apparently the "Complete and easy inference for higher rank types" cites some of the most important ones
2024-08-29 04:11:38 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 04:15:27 +0200benjaminl(~benjaminl@user/benjaminl)
2024-08-29 04:15:31 +0200machinedgod(~machinedg@d50-99-47-73.abhsia.telus.net) (Quit: leaving)
2024-08-29 04:15:52 +0200machinedgod(~machinedg@d50-99-47-73.abhsia.telus.net)
2024-08-29 04:16:09 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2024-08-29 04:16:39 +0200benjaminl_(~benjaminl@c-76-144-12-233.hsd1.or.comcast.net) (Ping timeout: 252 seconds)
2024-08-29 04:27:03 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 04:32:04 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds)
2024-08-29 04:38:07 +0200machinedgod(~machinedg@d50-99-47-73.abhsia.telus.net) (Quit: leaving)
2024-08-29 04:38:22 +0200madhavanmiui(~madhavanm@152.58.212.118)
2024-08-29 04:38:25 +0200machinedgod(~machinedg@d50-99-47-73.abhsia.telus.net)
2024-08-29 04:38:33 +0200madhavanmiui(~madhavanm@152.58.212.118) (Client Quit)
2024-08-29 04:38:57 +0200 <haskellbridge> <thirdofmay18081814goya> Bowuigi: nice, thanks for the resource!
2024-08-29 04:42:19 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 04:43:04 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 252 seconds)
2024-08-29 04:46:36 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2024-08-29 04:54:34 +0200sp1ff`(~user@c-73-11-70-111.hsd1.wa.comcast.net) (Remote host closed the connection)
2024-08-29 04:54:34 +0200sp1ff(~user@c-73-11-70-111.hsd1.wa.comcast.net) (Remote host closed the connection)
2024-08-29 04:57:44 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 05:01:33 +0200peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com)
2024-08-29 05:01:34 +0200td_(~td@i53870935.versanet.de) (Ping timeout: 260 seconds)
2024-08-29 05:02:08 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2024-08-29 05:03:06 +0200td_(~td@i53870918.versanet.de)
2024-08-29 05:08:48 +0200peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 272 seconds)
2024-08-29 05:13:09 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 05:13:30 +0200aforemny(~aforemny@i59F516D8.versanet.de)
2024-08-29 05:14:25 +0200aforemny_(~aforemny@2001:9e8:6cc3:6400:e30f:2a23:e5e9:e455) (Ping timeout: 248 seconds)
2024-08-29 05:17:41 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 255 seconds)
2024-08-29 05:18:56 +0200Eoco(~ian@128.101.131.218) (Quit: WeeChat 4.1.1)
2024-08-29 05:23:59 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 255 seconds)
2024-08-29 05:24:05 +0200Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2024-08-29 05:25:26 +0200Lord_of_Life_Lord_of_Life
2024-08-29 05:28:35 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 05:33:54 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)
2024-08-29 05:34:18 +0200Sgeo_(~Sgeo@user/sgeo)
2024-08-29 05:37:48 +0200Sgeo(~Sgeo@user/sgeo) (Ping timeout: 276 seconds)
2024-08-29 05:41:34 +0200peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com)
2024-08-29 05:44:00 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 05:47:02 +0200 <dmj`> Bowuigi: Adding lambda sets to Haskell sounds like a really cool idea
2024-08-29 05:47:25 +0200 <dmj`> you can track the lambdas through the desugaring
2024-08-29 05:48:33 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2024-08-29 05:48:34 +0200sefidel(~sefidel@user/sefidel) (Remote host closed the connection)
2024-08-29 05:59:25 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 06:03:38 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds)
2024-08-29 06:06:23 +0200sefidel(~sefidel@user/sefidel)
2024-08-29 06:13:16 +0200sroso(~sroso@user/SrOso) (Quit: Leaving :))
2024-08-29 06:14:51 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 06:17:22 +0200sefidel(~sefidel@user/sefidel) (Remote host closed the connection)
2024-08-29 06:17:51 +0200sefidel(~sefidel@user/sefidel)
2024-08-29 06:19:21 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2024-08-29 06:30:17 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 06:31:49 +0200rvalue(~rvalue@user/rvalue) (Ping timeout: 260 seconds)
2024-08-29 06:35:39 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)
2024-08-29 06:43:18 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 06:44:18 +0200michalz(~michalz@185.246.207.197)
2024-08-29 06:48:14 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds)
2024-08-29 06:53:26 +0200rosco(~rosco@183.171.74.47)
2024-08-29 06:58:45 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 07:03:14 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
2024-08-29 07:09:27 +0200echoreply(~echoreply@2001:19f0:9002:1f3b:5400:ff:fe6f:8b8d) (Ping timeout: 276 seconds)
2024-08-29 07:11:10 +0200echoreply(~echoreply@45.32.163.16)
2024-08-29 07:11:18 +0200carbolymer(~carbolyme@dropacid.net) (Remote host closed the connection)
2024-08-29 07:12:26 +0200carbolymer(~carbolyme@dropacid.net)
2024-08-29 07:12:42 +0200Eoco(~ian@128.101.131.218)
2024-08-29 07:14:10 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 07:18:45 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
2024-08-29 07:22:35 +0200rvalue(~rvalue@user/rvalue)
2024-08-29 07:29:35 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 07:33:33 +0200jle`(~jle`@2603:8001:3b02:84d4:2809:1e29:1db7:65cb) (Ping timeout: 246 seconds)
2024-08-29 07:33:54 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2024-08-29 07:34:39 +0200jle`(~jle`@2603:8001:3b02:84d4:cf52:aad8:ec6d:eddd)
2024-08-29 07:44:17 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 07:46:22 +0200rosco(~rosco@183.171.74.47) (Quit: Lost terminal)
2024-08-29 07:48:43 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds)
2024-08-29 07:55:14 +0200raehik(~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Ping timeout: 260 seconds)
2024-08-29 07:59:42 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 08:02:15 +0200peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 246 seconds)
2024-08-29 08:03:01 +0200Tuplanolla(~Tuplanoll@91-159-69-59.elisa-laajakaista.fi)
2024-08-29 08:03:52 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-114-71.web.vodafone.de)
2024-08-29 08:04:44 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds)
2024-08-29 08:05:43 +0200bladelizard(~bladeliza@213.94.19.138)
2024-08-29 08:10:13 +0200bladelizard(~bladeliza@213.94.19.138) (Ping timeout: 252 seconds)
2024-08-29 08:15:09 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 08:19:46 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2024-08-29 08:20:14 +0200gmg(~user@user/gehmehgeh)
2024-08-29 08:21:48 +0200gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2024-08-29 08:22:34 +0200gmg(~user@user/gehmehgeh)
2024-08-29 08:25:17 +0200acidjnk_new(~acidjnk@p200300d6e72cfb18ac0e327209850a07.dip0.t-ipconnect.de)
2024-08-29 08:27:11 +0200divya(~user@202.170.201.3)
2024-08-29 08:30:35 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 08:34:49 +0200Pixi`(~Pixi@user/pixi)
2024-08-29 08:35:01 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds)
2024-08-29 08:36:22 +0200neuroevolutus(~neuroevol@37.19.200.148)
2024-08-29 08:37:12 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-08-29 08:37:44 +0200neuroevolutus(~neuroevol@37.19.200.148) (Client Quit)
2024-08-29 08:37:56 +0200Pixi(~Pixi@user/pixi) (Ping timeout: 255 seconds)
2024-08-29 08:39:55 +0200Pixi__(~Pixi@user/pixi)
2024-08-29 08:42:50 +0200Pixi(~Pixi@user/pixi)
2024-08-29 08:43:33 +0200Pixi`(~Pixi@user/pixi) (Ping timeout: 246 seconds)
2024-08-29 08:45:18 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 08:45:39 +0200Pixi__(~Pixi@user/pixi) (Ping timeout: 276 seconds)
2024-08-29 08:47:38 +0200bladelizard(~bladeliza@213.94.19.138)
2024-08-29 08:49:06 +0200bladelizard(~bladeliza@213.94.19.138) (Remote host closed the connection)
2024-08-29 08:50:51 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)
2024-08-29 08:51:51 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
2024-08-29 08:52:43 +0200ft(~ft@p4fc2a393.dip0.t-ipconnect.de) (Quit: leaving)
2024-08-29 08:53:52 +0200hueso(~root@user/hueso) (Ping timeout: 252 seconds)
2024-08-29 08:56:49 +0200Pixi(~Pixi@user/pixi) (Quit: Leaving)
2024-08-29 09:01:02 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 09:05:49 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds)
2024-08-29 09:07:43 +0200aljazmc(~aljazmc@user/aljazmc) (Remote host closed the connection)
2024-08-29 09:07:50 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Read error: Connection reset by peer)
2024-08-29 09:09:44 +0200oo_miguel(~Thunderbi@78.10.207.45)
2024-08-29 09:10:19 +0200ash3en(~Thunderbi@p200300e7b71f94fba89838e14b44a860.dip0.t-ipconnect.de)
2024-08-29 09:12:07 +0200ubert(~Thunderbi@178.165.178.117.wireless.dyn.drei.com) (Read error: Connection reset by peer)
2024-08-29 09:12:26 +0200ubert(~Thunderbi@178.165.178.117.wireless.dyn.drei.com)
2024-08-29 09:12:49 +0200machinedgod(~machinedg@d50-99-47-73.abhsia.telus.net) (Ping timeout: 260 seconds)
2024-08-29 09:16:27 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl)
2024-08-29 09:16:37 +0200ubert(~Thunderbi@178.165.178.117.wireless.dyn.drei.com) (Ping timeout: 248 seconds)
2024-08-29 09:21:57 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
2024-08-29 09:24:56 +0200ash3en1(~Thunderbi@2a01:c23:8c99:e00:e1c5:8430:a907:e2c0)
2024-08-29 09:26:36 +0200ash3en(~Thunderbi@p200300e7b71f94fba89838e14b44a860.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
2024-08-29 09:26:37 +0200ash3en1ash3en
2024-08-29 09:27:34 +0200aforemny(~aforemny@i59F516D8.versanet.de) (Ping timeout: 260 seconds)
2024-08-29 09:35:40 +0200aforemny(~aforemny@i59F516D8.versanet.de)
2024-08-29 09:38:53 +0200madjestic(~madjestic@77-63-76-204.mobile.kpn.net)
2024-08-29 09:39:45 +0200cfricke(~cfricke@user/cfricke)
2024-08-29 09:46:04 +0200rosco(~rosco@175.136.158.234)
2024-08-29 09:50:41 +0200madjestic(~madjestic@77-63-76-204.mobile.kpn.net) (Ping timeout: 252 seconds)
2024-08-29 09:53:43 +0200Sgeo_(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2024-08-29 10:00:04 +0200Batzy(~quassel@user/batzy) (Ping timeout: 260 seconds)
2024-08-29 10:00:31 +0200Batzy(~quassel@user/batzy)
2024-08-29 10:04:16 +0200mreh(~matthew@host86-160-168-12.range86-160.btcentralplus.com)
2024-08-29 10:06:32 +0200merijn(~merijn@77.242.116.146)
2024-08-29 10:07:11 +0200econo_(uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity)
2024-08-29 10:15:54 +0200hueso(~root@user/hueso)
2024-08-29 10:23:14 +0200 <albet70> hi there, is there segmentation library in haskell?
2024-08-29 10:26:36 +0200tzh(~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
2024-08-29 10:26:40 +0200Square2(~Square4@user/square)
2024-08-29 10:32:01 +0200dysthesis(~dysthesis@user/dysthesis) (Quit: WeeChat 4.4.1)
2024-08-29 10:32:12 +0200simendsjo(~user@79.161.5.185)
2024-08-29 10:42:47 +0200rvalue-(~rvalue@user/rvalue)
2024-08-29 10:43:29 +0200rvalue(~rvalue@user/rvalue) (Ping timeout: 255 seconds)
2024-08-29 10:44:53 +0200madjestic(~madjestic@213.208.215.120)
2024-08-29 10:47:30 +0200rvalue-rvalue
2024-08-29 11:04:02 +0200madjestic(~madjestic@213.208.215.120) (Ping timeout: 252 seconds)
2024-08-29 11:05:59 +0200tinwood(~tinwood@canonical/tinwood) (Changing host)
2024-08-29 11:05:59 +0200tinwood(~tinwood@user/tinwood)
2024-08-29 11:06:02 +0200 <int-e> . o O ( https://en.wikipedia.org/wiki/Segmentation#Computing_and_communications )
2024-08-29 11:08:52 +0200califax_(~califax@user/califx)
2024-08-29 11:09:32 +0200tomsmedingsuspects https://en.wikipedia.org/wiki/Speech_segmentation
2024-08-29 11:09:53 +0200 <tomsmeding> er, https://en.wikipedia.org/wiki/Text_segmentation
2024-08-29 11:10:01 +0200chiselfuse(~chiselfus@user/chiselfuse) (Ping timeout: 260 seconds)
2024-08-29 11:10:01 +0200califax(~califax@user/califx) (Ping timeout: 260 seconds)
2024-08-29 11:10:09 +0200califax_califax
2024-08-29 11:12:33 +0200chiselfuse(~chiselfus@user/chiselfuse)
2024-08-29 11:18:20 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-08-29 11:22:33 +0200califax(~califax@user/califx) (Remote host closed the connection)
2024-08-29 11:22:56 +0200califax(~califax@user/califx)
2024-08-29 11:26:17 +0200 <Pozyomka> Is it possible to write a *total* function [a] -> [[a]] satisfying the following constraints? (a) The return value is the result of splitting the argument into chunks of length >= 1 but <= 3. (b) A chunk of length 1 is only allowed if the input list has length 1. (c) The recursive cases are either lumped together at the beginning or lumped together at the end, but not in the middle?
2024-08-29 11:26:59 +0200 <tomsmeding> what do you mean with "the recursive cases"?
2024-08-29 11:27:57 +0200 <tomsmeding> would it suffice to have the output chunk lengths be this: [1], [2], [3], [2,2], [2,3], [2,2,2], [2,2,3], etc.
2024-08-29 11:28:38 +0200az181(~az181@bmly-12-b2-v4wan-164596-cust791.vm4.cable.virginm.net)
2024-08-29 11:28:54 +0200cfricke(~cfricke@user/cfricke) (Quit: WeeChat 4.2.2)
2024-08-29 11:30:07 +0200 <Pozyomka> Such a function has to be defined using pattern matching and possibly recurring in some cases. Suppose there are 3 cases. If only one case is recursive, then it should be the top or the bottom one, not the middle one. If two cases are recursive, then the middle one should be one of them.
2024-08-29 11:30:45 +0200 <Pozyomka> And, yes, [], [1], [2], [3], [2,2], [2,3], [2,2,2], [2,2,3], etc. is acceptable.
2024-08-29 11:30:47 +0200cfricke(~cfricke@user/cfricke)
2024-08-29 11:31:12 +0200 <Pozyomka> It's annoying how un-googleable @ is.
2024-08-29 11:31:23 +0200 <Pozyomka> (Not Haskell's fault, though.)
2024-08-29 11:36:23 +0200 <tomsmeding> Pozyomka: https://paste.tomsmeding.com/1Ys69IVC ?
2024-08-29 11:36:55 +0200 <tomsmeding> Pozyomka: in case you hadn't found yet, that's called an "as-pattern"
2024-08-29 11:38:38 +0200 <Pozyomka> Ah, thanks. I had this, but the recursive case is in the middle: https://gist.github.com/eduardoleon/6df6ece235d7de7bf9b17407fe89285e
2024-08-29 11:38:43 +0200az181(~az181@bmly-12-b2-v4wan-164596-cust791.vm4.cable.virginm.net) (Ping timeout: 245 seconds)
2024-08-29 11:39:41 +0200 <tomsmeding> Pozyomka: this is also an option https://paste.tomsmeding.com/ZJHa9XzF
2024-08-29 11:40:08 +0200 <Pozyomka> That one breaks condition (b) above.
2024-08-29 11:40:18 +0200 <tomsmeding> where?
2024-08-29 11:40:27 +0200 <tomsmeding> i.e. for what input
2024-08-29 11:40:39 +0200 <Pozyomka> (b) A chunk of length 1 is only allowed if the input list has length 1.
2024-08-29 11:40:47 +0200 <Pozyomka> So take a list of length 3.
2024-08-29 11:40:55 +0200 <tomsmeding> a list of length 3 doesn't match the first case
2024-08-29 11:40:55 +0200 <Pozyomka> Oh, my bad.
2024-08-29 11:40:57 +0200 <Pozyomka> I misread.
2024-08-29 11:40:57 +0200 <tomsmeding> ;)
2024-08-29 11:40:59 +0200 <Pozyomka> Sorry!
2024-08-29 11:41:03 +0200sawilagar(~sawilagar@user/sawilagar)
2024-08-29 11:41:04 +0200 <tomsmeding> there's a whole lot of (:) there
2024-08-29 11:41:15 +0200 <Pozyomka> Yeah, that's nice.
2024-08-29 11:41:22 +0200 <Pozyomka> Then that's the one I'm taking. Thank you!
2024-08-29 11:42:27 +0200simendsjo(~user@79.161.5.185) (Ping timeout: 276 seconds)
2024-08-29 11:45:10 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.2.2)
2024-08-29 11:47:01 +0200 <mauke> tomsmeding: line 3 is redundant
2024-08-29 11:48:49 +0200 <Pozyomka> What I'm really trying to do is re-implement Data.Sequence using *only* total functions everywhere. So I'm reading the finger trees paper, and there's this helper function “app3 :: FingerTree a -> [a] -> FingerTree a”, whose recursive case is when both FingerTree arguments are Deep. In this case, we take the left FingerTree's right finger (which is a list), the middle list, and the right
2024-08-29 11:48:51 +0200 <Pozyomka> FingerTree's left finger (which is also a list), concatenate them, and chunk them as above, obtaining the list to be used in the recursive call.
2024-08-29 11:49:03 +0200 <Pozyomka> ERRR
2024-08-29 11:49:14 +0200 <Pozyomka> app3 :: FingerTree a -> [a] -> FingerTree a -> FingerTree a
2024-08-29 11:51:18 +0200 <tomsmeding> mauke: no, because line two has right-hand side [] and not [[]]
2024-08-29 11:51:56 +0200madjestic(~madjestic@213.208.215.120)
2024-08-29 11:51:59 +0200 <mauke> line 2 has rhs [[x]]
2024-08-29 11:52:00 +0200 <tomsmeding> Pozyomka: do you want total functions, or functions that e.g. Agda can automatically prove total?
2024-08-29 11:52:03 +0200 <tomsmeding> those are two different things
2024-08-29 11:52:31 +0200 <tomsmeding> mauke: which paste are you referring to? :p
2024-08-29 11:52:36 +0200 <tomsmeding> oh that one
2024-08-29 11:52:50 +0200 <tomsmeding> how is it redundant?
2024-08-29 11:52:53 +0200 <mauke> oh, there was another one :-)
2024-08-29 11:53:15 +0200 <tomsmeding> oh line _three_
2024-08-29 11:53:20 +0200 <mauke> > let f [] = []; f [x] = [[x]]; f [x,y,z] = [[x,y,z]]; f (x:y:zs) = [x,y] : f zs in f [1,2]
2024-08-29 11:53:22 +0200 <lambdabot> [[1,2]]
2024-08-29 11:53:23 +0200 <tomsmeding> it is!
2024-08-29 11:53:26 +0200 <tomsmeding> funny
2024-08-29 11:53:27 +0200 <Pozyomka> Functions that are total by some complicated argument that the type checker can't check are okay. But all the functions have to be total, including the helpers.
2024-08-29 11:55:57 +0200 <tomsmeding> Pozyomka: have you seen this one? https://tomsmeding.com/vang/eRvkwg/3406088.3409026.pdf
2024-08-29 11:56:01 +0200 <Pozyomka> Let me see.
2024-08-29 11:56:12 +0200 <tomsmeding> it's been a while since I read it, and I'm not sure if all the functions in there are total
2024-08-29 11:56:18 +0200 <tomsmeding> but I recall it was a very nice exposition
2024-08-29 11:59:03 +0200 <Pozyomka> Oh, his toTuples in the right column of page 4 is your first version, after deleting the case mauke identified as redundant.
2024-08-29 11:59:37 +0200ubert(~Thunderbi@178.165.178.117.wireless.dyn.drei.com)
2024-08-29 12:01:25 +0200 <Pozyomka> Thank you!
2024-08-29 12:02:44 +0200ZharMeny(~ZharMeny@user/ZharMeny)
2024-08-29 12:03:53 +0200simendsjo(~user@79.161.5.185)
2024-08-29 12:04:48 +0200 <tomsmeding> oh haha
2024-08-29 12:05:34 +0200 <tomsmeding> (this paper is behind a paywall normally; the link I posted invalidates after 24h, so save the PDF if you want to read it later)
2024-08-29 12:06:00 +0200madjestic(~madjestic@213.208.215.120) (Ping timeout: 252 seconds)
2024-08-29 12:06:46 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-114-71.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 12:06:52 +0200 <Pozyomka> Thank you again!
2024-08-29 12:07:09 +0200 <tomsmeding> :)
2024-08-29 12:09:46 +0200krei-se(~krei-se@p57af29f0.dip0.t-ipconnect.de) (Quit: ZNC 1.9.1 - https://znc.in)
2024-08-29 12:11:33 +0200merijn(~merijn@77.242.116.146) (Ping timeout: 248 seconds)
2024-08-29 12:15:26 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-114-71.web.vodafone.de)
2024-08-29 12:16:54 +0200krei-se(~krei-se@p57af29f0.dip0.t-ipconnect.de)
2024-08-29 12:20:36 +0200metabulation(~wootehfoo@user/wootehfoot)
2024-08-29 12:23:42 +0200merijn(~merijn@77.242.116.146)
2024-08-29 12:23:50 +0200ss4(~wootehfoo@user/wootehfoot) (Ping timeout: 255 seconds)
2024-08-29 12:27:39 +0200troydm(~troydm@user/troydm) (Ping timeout: 260 seconds)
2024-08-29 12:29:23 +0200son0p(~ff@2800:e2:f80:ee7::1)
2024-08-29 12:30:44 +0200merijn(~merijn@77.242.116.146) (Ping timeout: 260 seconds)
2024-08-29 12:33:38 +0200Smiles(uid551636@id-551636.lymington.irccloud.com)
2024-08-29 12:34:41 +0200__monty__(~toonn@user/toonn)
2024-08-29 12:38:36 +0200merijn(~merijn@77.242.116.146)
2024-08-29 12:47:10 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
2024-08-29 12:53:14 +0200 <[exa]> Is there some kindof lens-less zoom for State and StateT? like
2024-08-29 12:53:45 +0200 <[exa]> zoom :: (s->t) -> (t->s) -> StateT t m a -> StateT s m a
2024-08-29 12:54:05 +0200 <[exa]> not a big issue writing this myself but see, library version would be better
2024-08-29 12:55:07 +0200tomsmedingactually wrote almost precisely that yesterday
2024-08-29 12:55:30 +0200 <tomsmeding> except the t->s was s->t->s in case t is smaller than s and you need the original s to restore the full "new s"
2024-08-29 12:56:34 +0200 <tomsmeding> hm, actually I wrote these two:
2024-08-29 12:56:38 +0200 <tomsmeding> withMoreState :: Functor m => b -> StateT (s, b) m a -> StateT s m (a, b)
2024-08-29 12:56:45 +0200 <tomsmeding> withLessState :: Functor m => (s -> (s', b)) -> (s' -> b -> s) -> StateT s' m a -> StateT s m a
2024-08-29 12:57:16 +0200 <haskellbridge> <mauke> ... I was just thinking about running a subcomputation on parts of my state
2024-08-29 12:57:20 +0200 <tomsmeding> used like `withMoreState _ $ traverse (\x -> withLessState _) _`
2024-08-29 13:00:06 +0200toys(~toys@user/toys) (WeeChat 4.4.1)
2024-08-29 13:09:55 +0200rosco(~rosco@175.136.158.234) (Quit: Lost terminal)
2024-08-29 13:10:45 +0200ZharMeny(~ZharMeny@user/ZharMeny) (Ping timeout: 248 seconds)
2024-08-29 13:11:00 +0200ZharMeny`(~ZharMeny@user/ZharMeny)
2024-08-29 13:13:27 +0200ash3en(~Thunderbi@2a01:c23:8c99:e00:e1c5:8430:a907:e2c0) (Ping timeout: 276 seconds)
2024-08-29 13:17:28 +0200ZharMeny`ZharMeny
2024-08-29 13:20:38 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-08-29 13:30:36 +0200 <[exa]> tomsmeding: oh nice
2024-08-29 13:31:06 +0200ZharMeny(~ZharMeny@user/ZharMeny) (Read error: Connection reset by peer)
2024-08-29 13:31:16 +0200ZharMeny`(~ZharMeny@user/ZharMeny)
2024-08-29 13:31:36 +0200son0p(~ff@2800:e2:f80:ee7::1) (Ping timeout: 246 seconds)
2024-08-29 13:33:15 +0200ZharMeny`ZharMeny
2024-08-29 13:33:31 +0200 <tomsmeding> [exa]: was this also your usecase? :P
2024-08-29 13:37:11 +0200Square2(~Square4@user/square) (Remote host closed the connection)
2024-08-29 13:37:50 +0200Square2(~Square4@user/square)
2024-08-29 13:37:53 +0200cfricke(~cfricke@user/cfricke) (Ping timeout: 245 seconds)
2024-08-29 13:43:04 +0200Square2(~Square4@user/square) (Ping timeout: 272 seconds)
2024-08-29 13:56:05 +0200esnos(~user@176.106.34.161)
2024-08-29 13:58:38 +0200 <esnos> Hi, do you know why this command in ghci `:t pure @((->) String)` gives me error `No instance for (Applicative ((->) String)) arising from a use of ‘pure’ In the expression: pure @((->) String)`
2024-08-29 13:59:43 +0200 <tomsmeding> % :t pure @((->) String)
2024-08-29 13:59:43 +0200 <yahb2> pure @((->) String) :: a -> String -> a
2024-08-29 14:00:14 +0200 <tomsmeding> works for me
2024-08-29 14:04:14 +0200 <esnos> Ok, I know what I did, I hide Applicative from prelude for learning purpose...
2024-08-29 14:04:30 +0200 <tomsmeding> ah :)
2024-08-29 14:16:37 +0200ski(~ski@145.224.119.31)
2024-08-29 14:16:49 +0200justsomeguy(~justsomeg@user/justsomeguy)
2024-08-29 14:21:16 +0200 <[exa]> tomsmeding: basically, just needed a tiny bit of extra state somewhere which was later basically dropped
2024-08-29 14:21:31 +0200 <tomsmeding> ah
2024-08-29 14:23:14 +0200tt123109783243(~tt1231@syn-075-185-104-199.res.spectrum.com) (Ping timeout: 248 seconds)
2024-08-29 14:26:26 +0200 <Axman6> [exa]: (and tomsmeding) https://hackage.haskell.org/package/lens-5.2.2/docs/Control-Lens-Zoom.html
2024-08-29 14:26:54 +0200simendsjo(~user@79.161.5.185) (Ping timeout: 246 seconds)
2024-08-29 14:27:47 +0200 <Axman6> you can write do foo; zoom focus (do bar; baz); quux, where bar and baz will see only what focus points to
2024-08-29 14:28:00 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-08-29 14:28:15 +0200 <Axman6> :t zoom _1
2024-08-29 14:28:16 +0200 <lambdabot> (Zoom m n b s, Field1 s s b b, Functor (Zoomed m c)) => m c -> n c
2024-08-29 14:29:03 +0200 <Axman6> Magnify lets you do the same wthing with Reader
2024-08-29 14:29:30 +0200 <tomsmeding> Axman6: note that [exa] said "lens-less" :p
2024-08-29 14:29:45 +0200 <Axman6> oh, I thought they asked for lens specifically!
2024-08-29 14:29:51 +0200 <Axman6> well, just use lens, because it's great
2024-08-29 14:30:09 +0200 <tomsmeding> :p
2024-08-29 14:30:28 +0200ddellacosta(~ddellacos@ool-44c73c8f.dyn.optonline.net) (Ping timeout: 252 seconds)
2024-08-29 14:30:56 +0200simendsjo(~user@79.161.5.185)
2024-08-29 14:34:00 +0200 <dminuoso> [exa]: https://hackage.haskell.org/package/optics-extra-0.4.2.1/docs/Optics-Zoom.html#v:zoom
2024-08-29 14:34:01 +0200 <[exa]> Axman6: yeah I was kinda trying to pull in another gigaton of dependencies
2024-08-29 14:34:03 +0200 <dminuoso> It's lens-less!
2024-08-29 14:34:38 +0200 <[exa]> optically valid, yes. :D
2024-08-29 14:34:41 +0200 <[exa]> thanks guys!
2024-08-29 14:35:07 +0200 <dminuoso> It has far better optics for when something goes wrong, yes.
2024-08-29 14:36:36 +0200ZharMeny`(~ZharMeny@user/ZharMeny)
2024-08-29 14:37:38 +0200ell(~ellie@user/ellie) (Quit: Leaving)
2024-08-29 14:38:38 +0200ell(~ellie@user/ellie)
2024-08-29 14:38:48 +0200ZharMeny(~ZharMeny@user/ZharMeny) (Ping timeout: 272 seconds)
2024-08-29 14:39:52 +0200ZharMeny`ZharMeny
2024-08-29 14:45:18 +0200cfricke(~cfricke@user/cfricke)
2024-08-29 14:48:57 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-08-29 14:50:05 +0200cfricke(~cfricke@user/cfricke) (Ping timeout: 265 seconds)
2024-08-29 14:54:38 +0200justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 272 seconds)
2024-08-29 14:58:30 +0200Alleria(~Alleria@user/alleria)
2024-08-29 14:58:58 +0200 <jackdk> https://hackage.haskell.org/package/microlens-mtl-0.2.0.3/docs/Lens-Micro-Mtl.html#v:zoom
2024-08-29 14:59:12 +0200simendsjo(~user@79.161.5.185) (Read error: Connection reset by peer)
2024-08-29 15:00:05 +0200simendsjo(~user@79.161.5.185)
2024-08-29 15:12:58 +0200justsomeguy(~justsomeg@user/justsomeguy)
2024-08-29 15:13:00 +0200Blasius(~Blasius@5ec169d9.skybroadband.com) (Ping timeout: 252 seconds)
2024-08-29 15:13:05 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-08-29 15:19:59 +0200michalz(~michalz@185.246.207.197) (Read error: Connection reset by peer)
2024-08-29 15:20:17 +0200michalz(~michalz@185.246.207.218)
2024-08-29 15:20:42 +0200mreh(~matthew@host86-160-168-12.range86-160.btcentralplus.com) (Ping timeout: 252 seconds)
2024-08-29 15:20:45 +0200statusbot(~statusbot@ec2-34-198-122-184.compute-1.amazonaws.com) (Remote host closed the connection)
2024-08-29 15:20:56 +0200statusbot(~statusbot@ec2-34-198-122-184.compute-1.amazonaws.com)
2024-08-29 15:28:04 +0200Square2(~Square4@user/square)
2024-08-29 15:29:34 +0200Blasius(~Blasius@5ec169d9.skybroadband.com)
2024-08-29 15:31:43 +0200 <mauke> https://hackage.haskell.org/package/microlens-th-0.4.3.15/docs/Lens-Micro-TH.html#g:2 this is weird
2024-08-29 15:32:02 +0200 <mauke> why do I need the bogus type? can't I just do $(makeLenses ''Foo)?
2024-08-29 15:34:19 +0200cfricke(~cfricke@user/cfricke)
2024-08-29 15:38:56 +0200 <c_wraith> mauke: that *looks* like confused docs.
2024-08-29 15:40:03 +0200 <c_wraith> oh. I see what's going on.
2024-08-29 15:40:18 +0200 <c_wraith> implicit splices strike again
2024-08-29 15:40:38 +0200 <c_wraith> they were a mistake in the first place, and remain a mistake now
2024-08-29 15:41:00 +0200 <c_wraith> That's about getting ghci to recognize that you're making a splice, not just running an expression
2024-08-29 15:41:11 +0200 <mauke> yes, that's why I suggested using $( ) instead
2024-08-29 15:41:27 +0200 <c_wraith> explicit splices are forgotten knowledge, I guess
2024-08-29 15:41:41 +0200 <c_wraith> can we please remove implicit splices?
2024-08-29 15:42:07 +0200zmt01(~zmt00@user/zmt00)
2024-08-29 15:43:01 +0200 <mauke> alternatively, just use 'import Prelude' as a no-op declaration
2024-08-29 15:45:33 +0200zmt00(~zmt00@user/zmt00) (Ping timeout: 276 seconds)
2024-08-29 15:47:04 +0200justsomeguy(~justsomeg@user/justsomeguy) (Quit: WeeChat 3.6)
2024-08-29 15:47:58 +0200ash3en(~Thunderbi@2a01:c23:8c99:e00:e1c5:8430:a907:e2c0)
2024-08-29 15:53:42 +0200simendsjo(~user@79.161.5.185) (Ping timeout: 252 seconds)
2024-08-29 15:58:49 +0200ZharMeny`(~ZharMeny@user/ZharMeny)
2024-08-29 15:59:17 +0200Sgeo(~Sgeo@user/sgeo)
2024-08-29 16:01:59 +0200 <dminuoso> So strange, I did not even know about implicit splices.
2024-08-29 16:02:03 +0200 <dminuoso> I've always used explicit splices.
2024-08-29 16:02:24 +0200 <dminuoso> Does that mean I'm.. special?
2024-08-29 16:02:28 +0200 <c_wraith> sure!
2024-08-29 16:02:59 +0200ZharMeny(~ZharMeny@user/ZharMeny) (Ping timeout: 255 seconds)
2024-08-29 16:04:18 +0200ZharMeny`ZharMeny
2024-08-29 16:09:03 +0200Guest40(~Guest40@2401:4900:51f7:7237:568:1443:c04d:536e)
2024-08-29 16:15:05 +0200Guest40(~Guest40@2401:4900:51f7:7237:568:1443:c04d:536e) (Quit: Client closed)
2024-08-29 16:18:14 +0200cfricke(~cfricke@user/cfricke) (Ping timeout: 272 seconds)
2024-08-29 16:19:49 +0200Teacup_(~teacup@user/teacup) ()
2024-08-29 16:20:11 +0200Teacup(~teacup@user/teacup)
2024-08-29 16:24:15 +0200Alleria(~Alleria@user/alleria) (Remote host closed the connection)
2024-08-29 16:29:27 +0200mreh(~matthew@host86-160-168-12.range86-160.btcentralplus.com)
2024-08-29 16:43:40 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-114-71.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 16:47:08 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-114-71.web.vodafone.de)
2024-08-29 16:50:20 +0200spew(~spew@201.141.99.170)
2024-08-29 16:52:36 +0200swamp_(~zmt00@user/zmt00)
2024-08-29 16:54:08 +0200tabemann_(~tabemann@2600:1700:7990:24e0:8704:9636:2bf6:fb61)
2024-08-29 16:56:24 +0200zmt01(~zmt00@user/zmt00) (Ping timeout: 276 seconds)
2024-08-29 16:56:24 +0200tabemann__(~tabemann@2600:1700:7990:24e0:471d:6865:e425:eedb) (Ping timeout: 276 seconds)
2024-08-29 17:05:55 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-114-71.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 17:06:09 +0200Blasius(~Blasius@5ec169d9.skybroadband.com) (Ping timeout: 276 seconds)
2024-08-29 17:06:37 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-114-71.web.vodafone.de)
2024-08-29 17:11:19 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-114-71.web.vodafone.de) (Ping timeout: 260 seconds)
2024-08-29 17:11:27 +0200Blasius(~Blasius@5ec169d9.skybroadband.com)
2024-08-29 17:11:44 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-113-52.web.vodafone.de)
2024-08-29 17:11:58 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.2.2)
2024-08-29 17:21:05 +0200metabulation(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2024-08-29 17:28:09 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-113-52.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 17:31:45 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-113-52.web.vodafone.de)
2024-08-29 17:35:42 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-08-29 17:36:50 +0200raehik(~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net)
2024-08-29 17:41:12 +0200L29Ah(~L29Ah@wikipedia/L29Ah) ()
2024-08-29 17:43:17 +0200cfricke(~cfricke@user/cfricke)
2024-08-29 17:49:55 +0200cfricke(~cfricke@user/cfricke) (Quit: WeeChat 4.2.2)
2024-08-29 17:51:38 +0200machinedgod(~machinedg@d50-99-47-73.abhsia.telus.net)
2024-08-29 17:55:50 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-113-52.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 17:57:25 +0200tzh(~tzh@c-76-115-131-146.hsd1.or.comcast.net)
2024-08-29 17:57:57 +0200merijn(~merijn@77.242.116.146) (Ping timeout: 246 seconds)
2024-08-29 17:58:00 +0200Alleria(~Alleria@user/alleria)
2024-08-29 17:59:05 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-113-52.web.vodafone.de)
2024-08-29 18:08:07 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-113-52.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 18:08:19 +0200ash3en(~Thunderbi@2a01:c23:8c99:e00:e1c5:8430:a907:e2c0) (Ping timeout: 260 seconds)
2024-08-29 18:08:32 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-113-52.web.vodafone.de)
2024-08-29 18:09:08 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-113-52.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 18:13:19 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-127.web.vodafone.de)
2024-08-29 18:14:30 +0200econo_(uid147250@id-147250.tinside.irccloud.com)
2024-08-29 18:14:37 +0200Artea(~Lufia@artea.pt)
2024-08-29 18:19:47 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-08-29 18:25:36 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2024-08-29 18:28:37 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-127.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 18:31:23 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-08-29 18:31:42 +0200AWizzArd(~code@user/awizzard)
2024-08-29 18:32:01 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-127.web.vodafone.de)
2024-08-29 18:32:09 +0200lxsameer(~lxsameer@Serene/lxsameer)
2024-08-29 18:34:01 +0200madjestic(~madjestic@77-63-78-93.mobile.kpn.net)
2024-08-29 18:36:46 +0200 <lxsameer> hey friends, do you know how to exclude certain characters from a megaparser Parser?
2024-08-29 18:45:10 +0200 <ncf> noneOf
2024-08-29 18:46:01 +0200madjestic(~madjestic@77-63-78-93.mobile.kpn.net) (Ping timeout: 252 seconds)
2024-08-29 18:48:12 +0200 <lxsameer> cheers
2024-08-29 18:48:30 +0200 <tomsmeding> there is always 'satisfy (`notElem` _)'
2024-08-29 18:49:08 +0200 <tomsmeding> sure, 'noneOf' is more readable and shorter, but for basic character parsers like this one doesn't need to get stuck on trying to find the appropriate pre-made utility :)
2024-08-29 18:50:27 +0200 <lxsameer> thank you both
2024-08-29 18:51:53 +0200 <lxsameer> noneOf seems to be dropped in 9.6
2024-08-29 18:52:22 +0200 <lxsameer> oh I'm wrong, nvm
2024-08-29 18:52:45 +0200Smiles(uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2024-08-29 18:57:36 +0200Alleria(~Alleria@user/alleria) (Ping timeout: 244 seconds)
2024-08-29 19:05:20 +0200JuanDaugherty(~juan@user/JuanDaugherty)
2024-08-29 19:19:08 +0200 <monochrom> I am very special. I prefer explicit splices, explicit forall, explicit conversion between numeric types, explicit lambdas and argument names (don't laugh, look at those people who want "_ + _" or "# + #" to mean \x y -> x + y), ...
2024-08-29 19:20:37 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-08-29 19:22:42 +0200pavonia(~user@user/siracusa) (Quit: Bye!)
2024-08-29 19:24:22 +0200takuan(~takuan@178-116-218-225.access.telenet.be) (Quit: Lost terminal)
2024-08-29 19:24:42 +0200divya(~user@202.170.201.3) (Remote host closed the connection)
2024-08-29 19:27:06 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-127.web.vodafone.de) (Ping timeout: 252 seconds)
2024-08-29 19:28:11 +0200 <mauke> how about operator sections?
2024-08-29 19:30:44 +0200nyc(~nyc@syn-067-250-055-000.res.spectrum.com)
2024-08-29 19:30:46 +0200nyc(~nyc@syn-067-250-055-000.res.spectrum.com) (Changing host)
2024-08-29 19:30:46 +0200nyc(~nyc@user/nyc)
2024-08-29 19:32:29 +0200 <tomsmeding> with you on all but the explicit forall
2024-08-29 19:34:20 +0200son0p(~ff@2800:e6:4001:8da7:232f:489b:caf3:dc20)
2024-08-29 19:37:35 +0200 <monochrom> I use sections myself, but when teaching I don't use them. Sometimes I use (:), but also explain "if you don't understand/like that syntax, it's \x xs -> x : xs". I also never used $, I wrote "\f x -> f x".
2024-08-29 19:38:02 +0200 <monochrom> err, I never taught $. Sometimes I use it myself.
2024-08-29 19:39:41 +0200 <monochrom> My course is not supposed to be a Haskell course, just a PL course in which I happen to find Haskell suitable to convey PL topics, so there are a lot of Haskell goodies I omit. I don't even teach newtype.
2024-08-29 19:43:01 +0200 <EvanR> read my lips: no newtypes
2024-08-29 19:44:03 +0200 <nyc> uncurry3 RWS.execRWST . (, readerEnv, initialState) is something I write pretty often.
2024-08-29 19:49:26 +0200rvalue(~rvalue@user/rvalue) (Read error: Connection reset by peer)
2024-08-29 19:50:05 +0200rvalue(~rvalue@user/rvalue)
2024-08-29 19:50:18 +0200 <monochrom> Actually something interesting happened when I used "data" instead of "newtype". You know the simple version of parser monad, except I use "data": "data P a = P(String -> Maybe (a, String))".
2024-08-29 19:50:44 +0200 <monochrom> Then I coded up the Alternative instance, "P f1 <|> P f2 = ..."
2024-08-29 19:51:11 +0200 <nyc> curryNminusK $ uncurryN nAryFunc . (,, x,,, y,, z,,,) or whatever is an easy way to fill in some args & leave others available for application it seems.
2024-08-29 19:51:48 +0200 <monochrom> And eventually I also have parsers like "foo = bar <|> something that has a recursive call to foo".
2024-08-29 19:52:07 +0200 <monochrom> And that hangs because I use "data" instead of "newtype". :)
2024-08-29 19:52:27 +0200skiwants `(2 + 3 *)' to mean `\x -> 2 + 3 * x'
2024-08-29 19:53:10 +0200 <nyc> Speaking of parsers, I could use a library for manipulating some sort of IR for regular expressions esp. if there's some sort of regex simplifier or minimizer out there.
2024-08-29 19:54:44 +0200 <mauke> ski: that's a syntactic abomination
2024-08-29 19:54:56 +0200 <mauke> unless you also want to allow (2 + * 3)
2024-08-29 19:55:02 +0200 <mauke> then it's a different syntactic abomination
2024-08-29 19:55:11 +0200 <monochrom> tomsmeding: I am OK with implicit forall when one just wants to learn basic Haskell (say, Haskell 2010). In broader contexts and probably outside Haskell, implicit forall is why people, for example, misunderstand induction.
2024-08-29 19:55:22 +0200ski's also reminded of monadic abstractions in SML including a primitive val delay : (unit -> 'a t) -> 'a t in order to allow recursive, parameterless, parser definitions (getting around the value restriction, which forbids defining recursive non-values (determined syntactically))
2024-08-29 19:55:22 +0200 <nyc> OTOH maybe I could just sort of extend things for regex-with-pcre, throw a huge nasty regex IR at the regex to DFA compiler from some sort of notational extension & then just wing things with runghc or similar.
2024-08-29 19:55:35 +0200 <ski> mauke : nah, only at the two ends
2024-08-29 19:55:41 +0200 <tomsmeding> monochrom: oh I was definitely talking about the forall in Haskell type signatures. The \forall in logic is a completely different story
2024-08-29 19:56:37 +0200 <nyc> As long as it's not like a diversion from programming the things I'm trying to use it as a tool to help program.
2024-08-29 19:56:38 +0200 <ski> yeah, monochrom, when teaching induction, i think one should start with using explicit universals, to begin with
2024-08-29 19:56:38 +0200 <monochrom> With implicit forall, the induction step goes as "p n => p (n+1)". People are trained to "disambiguate" that to "(forall n. p n) => (forall n. p (n+1))", and conclude that induction is circular logic.
2024-08-29 19:57:31 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de)
2024-08-29 19:57:43 +0200 <tomsmeding> monochrom: disclaimer: I have much less experience than you in teaching this stuff, but I haven't seen that particular misunderstanding yet
2024-08-29 19:57:58 +0200 <ski> .. or `(n = k => P n) => (n = k + 1 => P n)'
2024-08-29 19:58:17 +0200 <monochrom> That problem happens at the highschool level. :)
2024-08-29 19:59:03 +0200 <monochrom> I think most universities happen to do a good job making quantifiers explicit, by design or by happy coincidence.
2024-08-29 20:00:17 +0200skialso thinks every math student, at uni/college level, should early on get expoed to (the practice of) natural deduction
2024-08-29 20:00:40 +0200 <mauke> how is that circular?
2024-08-29 20:00:50 +0200 <mauke> looks more like trivial to me
2024-08-29 20:01:29 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 20:03:20 +0200 <monochrom> It is both. "circular" is a meta-level observation or interpretation.
2024-08-29 20:05:31 +0200 <dolio> When would they be trained to disambiguate that way?
2024-08-29 20:08:10 +0200 <monochrom> Highschool teaches the very simple model "free variables in a sentence are universally quantifier when the question asks you to prove something". Then one considers "p n" and "p (n+1)" to be separate sentences.
2024-08-29 20:08:13 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de)
2024-08-29 20:09:28 +0200 <monochrom> In fact, there is no "implies" connective in highschool logic. There are two sentences: "Assume p n, fullstop.", "Prove p (n+1), fullstop". Two sentences.
2024-08-29 20:11:24 +0200 <dolio> Okay, well, that is indeed quite bad, if they're teaching that you just quantify every individual piece whenever you see it.
2024-08-29 20:11:50 +0200machinedgod(~machinedg@d50-99-47-73.abhsia.telus.net) (Ping timeout: 255 seconds)
2024-08-29 20:13:03 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 20:14:50 +0200 <ski> i remember it took me a while to realize that the direction of the implication arrow, when solving an equation, determined whether you covered all solutions (but maybe had false positives), or you only had true solutions (but maybe missed some) .. (or both, in which case you had both completeness and soundness)
2024-08-29 20:16:18 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de)
2024-08-29 20:16:23 +0200hgolden_(~hgolden@2603:8000:9d00:3ed1:6c70:1ac0:d127:74dd) (Read error: Connection reset by peer)
2024-08-29 20:18:40 +0200 <dolio> I kind of think that even most 'proper' logic courses aren't very good, from what I can infer from seeing people discuss logic.
2024-08-29 20:19:01 +0200 <dolio> Although they aren't as bad as what you're describing.
2024-08-29 20:19:19 +0200 <tomsmeding> or the people weren't taking those courses, or they weren't paying attention :)
2024-08-29 20:19:34 +0200 <tomsmeding> one only has to get about half the exam correct in order to pass
2024-08-29 20:19:48 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 20:19:57 +0200 <dolio> I mean like supposedly professional mathematicians talking about logic.
2024-08-29 20:20:09 +0200 <tomsmeding> professional _mathematicians_? ah
2024-08-29 20:20:31 +0200 <dolio> Also most books aren't great, either.
2024-08-29 20:20:39 +0200 <dolio> Which get used to teach the courses.
2024-08-29 20:20:52 +0200 <constxd> bros i am looking for a language that is as aesthetically pleasing as haskell (juxtaposition = application, currying, lots of handy infix operators for various sorts of composition, etc.) but is strict, and has support for imperative programming (mutable state, side effects allowed anywhere, etc.) but also lightweight (not Scala) does such a thing exist...
2024-08-29 20:21:04 +0200 <constxd> dynamically typed is fine even
2024-08-29 20:21:14 +0200 <tomsmeding> {-# LANGUAGE -XStrict #-}
2024-08-29 20:21:28 +0200 <tomsmeding> (I'm half joking)
2024-08-29 20:21:57 +0200 <Franciman> constxd: maybe ocaml
2024-08-29 20:21:59 +0200 <tomsmeding> joking because it doesn't really cut it, because libraries aren't compiled with it, and nothing really is built for that behaviour so much
2024-08-29 20:22:02 +0200 <dolio> -XStrict is just bad. You could suggest Haskell, though. :þ
2024-08-29 20:22:03 +0200 <Franciman> the syntax is not as nice as haskell tho
2024-08-29 20:22:14 +0200 <Franciman> it has various rough points, but it's similar at least
2024-08-29 20:23:10 +0200 <EvanR> maybe try F#
2024-08-29 20:23:30 +0200 <Franciman> does f# have a nice syntax?
2024-08-29 20:23:41 +0200 <Franciman> now that .net is cross platform and open source, i may try it
2024-08-29 20:23:42 +0200 <tomsmeding> that is something only you can judge for yourself
2024-08-29 20:23:46 +0200 <constxd> i really wonder about Raku if i'm being honest
2024-08-29 20:24:01 +0200 <Franciman> perl 6?
2024-08-29 20:24:14 +0200 <constxd> they ditched that name but yeah
2024-08-29 20:24:15 +0200 <EvanR> also there is koka
2024-08-29 20:25:09 +0200 <EvanR> but writing haskell so that stuff you're doing is most eagerly evaluated isn't that hard
2024-08-29 20:25:15 +0200 <EvanR> mostly
2024-08-29 20:25:23 +0200hgolden(~hgolden@2603:8000:9d00:3ed1:6c70:1ac0:d127:74dd)
2024-08-29 20:25:46 +0200 <EvanR> avoid lists
2024-08-29 20:26:07 +0200 <tomsmeding> -XStrictData is much less weird than -XStrict
2024-08-29 20:26:33 +0200 <tomsmeding> you'll have to deal with... basically everything being lazy, though, such as (,), Either, Maybe, [], etc.
2024-08-29 20:26:35 +0200 <EvanR> even though a lot of lazy list code will compile into loops, it would still be lazy and you don't want it
2024-08-29 20:27:28 +0200 <tomsmeding> relevant is https://hackage.haskell.org/package/strict
2024-08-29 20:29:09 +0200ft(~ft@p4fc2a393.dip0.t-ipconnect.de)
2024-08-29 20:30:42 +0200 <mauke> -XStrict breaks my brain
2024-08-29 20:31:32 +0200spew(~spew@201.141.99.170) (Quit: spew)
2024-08-29 20:32:30 +0200 <constxd> i wonder about PureScript too
2024-08-29 20:32:55 +0200 <constxd> i have heard in some sense it's like Haskell but without the stuff that is considered mistakes in hindsight
2024-08-29 20:33:56 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de)
2024-08-29 20:36:32 +0200 <Franciman> constxd: if you like raku's syntax, ocaml will be awesome
2024-08-29 20:37:41 +0200neuroevolutus(~neuroevol@37.19.200.135)
2024-08-29 20:39:53 +0200 <dmj`> constxd: if it ain't non-strict it ain't haskell :P
2024-08-29 20:40:33 +0200 <EvanR> laziness is amazing, except for the poor souls working on the compiler
2024-08-29 20:42:34 +0200 <dmj`> it'd probably be easier if we inlined the eval function into every program, or generate a custom eval function that operated on all closures / constructors
2024-08-29 20:42:48 +0200xff0x(~xff0x@2405:6580:b080:900:4a8f:2c6:6e99:efb9) (Ping timeout: 246 seconds)
2024-08-29 20:43:50 +0200xff0x(~xff0x@2405:6580:b080:900:136b:65b1:e5b:b9e1)
2024-08-29 20:44:44 +0200 <dmj`> implicit laziness is complicated to deal with, explicit would be better
2024-08-29 20:45:05 +0200ash3en(~Thunderbi@2a01:c23:8c99:e00:e1c5:8430:a907:e2c0)
2024-08-29 20:45:33 +0200 <[exa]> constxd: purescript elegantly trades the little mistakes of haskell for a heap of other subtle mistakes
2024-08-29 20:47:14 +0200 <dmj`> and its effectively js only
2024-08-29 20:47:22 +0200 <[exa]> most notably the evaluation is more of a scheme or ML than the haskell kind, in turn 99% of the usual constructions that involve functions doing functions stuff just fail to work
2024-08-29 20:47:23 +0200target_i(~target_i@user/target-i/x-6023099)
2024-08-29 20:47:44 +0200son0p(~ff@2800:e6:4001:8da7:232f:489b:caf3:dc20) (Ping timeout: 260 seconds)
2024-08-29 20:48:03 +0200raehik(~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Ping timeout: 246 seconds)
2024-08-29 20:49:05 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 20:51:40 +0200 <monochrom> Do you accept Idris?
2024-08-29 20:54:16 +0200 <EvanR> I just use the type system xD
2024-08-29 20:54:21 +0200 <EvanR> don't try to run anything
2024-08-29 20:55:50 +0200JuanDaugherty(~juan@user/JuanDaugherty) (Quit: JuanDaugherty)
2024-08-29 20:57:53 +0200rdcdr(~rdcdr@user/rdcdr) (Ping timeout: 245 seconds)
2024-08-29 20:58:19 +0200rdcdr(~rdcdr@user/rdcdr)
2024-08-29 21:00:16 +0200petrichor(~znc-user@user/petrichor) (Quit: ZNC 1.8.2 - https://znc.in)
2024-08-29 21:02:06 +0200petrichor(~znc-user@user/petrichor)
2024-08-29 21:03:39 +0200madjestic(~madjestic@103-135-99-95.ftth.glasoperator.nl)
2024-08-29 21:03:56 +0200hgolden_(~hgolden@syn-172-251-233-141.res.spectrum.com)
2024-08-29 21:04:04 +0200hgolden(~hgolden@2603:8000:9d00:3ed1:6c70:1ac0:d127:74dd) (Ping timeout: 260 seconds)
2024-08-29 21:05:57 +0200ubert(~Thunderbi@178.165.178.117.wireless.dyn.drei.com) (Ping timeout: 248 seconds)
2024-08-29 21:10:26 +0200 <tomsmeding> [exa]: do you have an example?
2024-08-29 21:15:45 +0200 <Franciman> wonder how the chezscheme backend compares to ghc
2024-08-29 21:15:49 +0200 <Franciman> produced code
2024-08-29 21:16:20 +0200ubert(~Thunderbi@178.165.178.117.wireless.dyn.drei.com)
2024-08-29 21:17:47 +0200 <[exa]> tomsmeding: I once tried to write the simple parsec instance for something there
2024-08-29 21:17:58 +0200 <[exa]> turned out to be absolutely unattainable
2024-08-29 21:18:18 +0200Square2(~Square4@user/square) (Ping timeout: 245 seconds)
2024-08-29 21:18:49 +0200 <tomsmeding> in what sense? I thought parsec-like stuff is just lambda calculus and inductive data types
2024-08-29 21:18:53 +0200 <tomsmeding> surely it has that?!
2024-08-29 21:19:47 +0200 <[exa]> hm, what are the conditions for a "record patch syntax" to work? I'm trying to do one which shold be absolutely obvious (`x{f=val}` with `x` bound by types to be the exact record type) but ghc tells me "Not a record constructor: x"
2024-08-29 21:19:56 +0200 <[exa]> tomsmeding: yap it doesn't have lambda calculus :D
2024-08-29 21:20:01 +0200 <[exa]> iz strict
2024-08-29 21:20:12 +0200 <tomsmeding> but that's fine?
2024-08-29 21:20:22 +0200 <tomsmeding> strict lambda calculus is still lambda calculus
2024-08-29 21:21:21 +0200 <tomsmeding> if you transform the parser data type, which is morally a coproduct, into the continuation-style thing that is typical of parsec-like libraries, you do have to take care to make all of the continuations a function
2024-08-29 21:21:31 +0200 <tomsmeding> i.e. if you have a 0-argument continuation, have to make it () -> a
2024-08-29 21:21:40 +0200 <tomsmeding> but that's quite minor IMO
2024-08-29 21:21:46 +0200 <mauke> [exa]: need more context
2024-08-29 21:21:53 +0200 <EvanR> the old () -> a trick
2024-08-29 21:23:35 +0200 <[exa]> yeah that would work, except I kinda tableflipped for some reason right in the middle
2024-08-29 21:25:12 +0200 <davean> ((╯°□°)╯︵ ┻━┻) -> a
2024-08-29 21:25:56 +0200 <davean> That function signature is basicly me
2024-08-29 21:26:18 +0200 <davean> get fed up and just fix something, except I'm in IO for sure
2024-08-29 21:26:41 +0200[exa]invokes unsafePerformDavean
2024-08-29 21:26:57 +0200 <davean> [exa]: that was July 1st :-p
2024-08-29 21:27:44 +0200 <[exa]> mauke: the context was basically me going "hey why don't we have a HM inference visualizer for browsers, this must be trivial in the modern programming systems!!!111"
2024-08-29 21:27:54 +0200 <[exa]> then I got corrected
2024-08-29 21:28:02 +0200 <mauke> no, for the record error
2024-08-29 21:28:27 +0200 <tomsmeding> [exa]: the JS backend of GHC exists nowadays
2024-08-29 21:28:29 +0200 <tomsmeding> it works
2024-08-29 21:28:39 +0200 <tomsmeding> it you're happy with downloading a tarball with a custom GHC build :p
2024-08-29 21:29:09 +0200 <[exa]> don't really mind that. I guess I'll try next
2024-08-29 21:29:28 +0200 <[exa]> mauke: https://paste.tomsmeding.com/mw5YY3BN, complains about the `sfi{...}`s
2024-08-29 21:29:44 +0200 <tomsmeding> [exa]: what is the full error? :p
2024-08-29 21:29:47 +0200 <[exa]> I hope I didn't kill it by the wildcards
2024-08-29 21:30:08 +0200 <[exa]> https://paste.tomsmeding.com/TIwqP6sB
2024-08-29 21:30:10 +0200 <tomsmeding> also, given that there is a wildcard involved (angry face), the definition of SkipFwdIter :p
2024-08-29 21:30:10 +0200 <[exa]> that's literally it
2024-08-29 21:30:29 +0200 <mauke> what language extensions are active?
2024-08-29 21:31:20 +0200 <[exa]> only RecordWildcards
2024-08-29 21:31:21 +0200Square(~Square@user/square)
2024-08-29 21:31:22 +0200tomsmeding. o O ( -XNoTraditionalRecordSyntax )
2024-08-29 21:32:01 +0200 <[exa]> tomsmeding: https://paste.tomsmeding.com/Z3cHiU8U
2024-08-29 21:33:04 +0200 <tomsmeding> huh
2024-08-29 21:33:08 +0200tomsmedinggets the same
2024-08-29 21:33:58 +0200 <[exa]> maybe it hates that the record's too polymorphic?
2024-08-29 21:34:08 +0200 <tomsmeding> it's a _parsing_ error
2024-08-29 21:34:17 +0200 <mauke> yes, and it's looking for a pattern
2024-08-29 21:34:48 +0200 <tomsmeding> [exa]: you're missing a `do` on the `Just` case
2024-08-29 21:35:02 +0200 <tomsmeding> good luck figuring out what ghc is trying to parse here
2024-08-29 21:36:01 +0200 <[exa]> oh wow
2024-08-29 21:36:07 +0200 <[exa]> that's it, thanks al ot
2024-08-29 21:36:17 +0200 <[exa]> s/l / l/
2024-08-29 21:36:29 +0200 <mauke> hah, just found that
2024-08-29 21:37:03 +0200 <mauke> I wish I knew why that generates a backwards syntax error
2024-08-29 21:37:23 +0200 <[exa]> ha true, it only generated one
2024-08-29 21:37:43 +0200 <tomsmeding> "only one"?
2024-08-29 21:37:49 +0200 <tomsmeding> ghc never gives more than one syntax error
2024-08-29 21:38:03 +0200 <[exa]> ah, ok nvm
2024-08-29 21:38:05 +0200terrorjack4(~terrorjac@2a01:4f8:121:32e8::) (Quit: The Lounge - https://thelounge.chat)
2024-08-29 21:38:34 +0200 <[exa]> I assume it did something terrible with trying to glue the <- to the previous `do` or something
2024-08-29 21:38:43 +0200 <[exa]> cool
2024-08-29 21:38:46 +0200 <[exa]> thanks guys
2024-08-29 21:39:05 +0200hgolden_(~hgolden@syn-172-251-233-141.res.spectrum.com) (Remote host closed the connection)
2024-08-29 21:39:08 +0200 <mauke> I think it somehow parses the whole (Nothing -> do ... Just p0 -> (p1, _) <-) part as a single pattern
2024-08-29 21:39:54 +0200 <mauke> because if you replace sfi{ by A{, the error changes to "error: do-notation in pattern" at Nothing -> do
2024-08-29 21:39:55 +0200hgolden(~hgolden@2603:8000:9d00:3ed1:6c70:1ac0:d127:74dd)
2024-08-29 21:40:12 +0200 <tomsmeding> I think the `return $ sf {...} Just p0 -> (p1, _)` is a pattern on the left side of a <- in the Nothing do
2024-08-29 21:40:34 +0200 <[exa]> O_o
2024-08-29 21:40:49 +0200 <tomsmeding> if you reduce the code to this: https://paste.tomsmeding.com/WhFDSGvX
2024-08-29 21:41:05 +0200 <tomsmeding> oh I lied
2024-08-29 21:41:39 +0200 <tomsmeding> meh I haev no clue
2024-08-29 21:41:49 +0200 <tomsmeding> [exa]: you broke haskell
2024-08-29 21:42:16 +0200 <[exa]> naaaaaaaaaaaaaay
2024-08-29 21:42:29 +0200 <[exa]> is this worth reporting?
2024-08-29 21:42:42 +0200 <[exa]> or should I bury it here to the heap of other syntax gore
2024-08-29 21:43:09 +0200 <[exa]> Franciman: what comparison metrics btw
2024-08-29 21:43:13 +0200maukeremembers something
2024-08-29 21:43:24 +0200 <mauke> layout is terminated early by syntax errors
2024-08-29 21:43:37 +0200 <tomsmeding> before reporting I'd spend some more time figuring out what's happening exactly
2024-08-29 21:43:41 +0200 <tomsmeding> oh no
2024-08-29 21:43:51 +0200 <tomsmeding> I HATE that part of haskell parsing
2024-08-29 21:43:53 +0200 <mauke> so the missing 'do' causes a syntax error in the second branch, so the 'do' in the first branch retracts its '}' ... or something
2024-08-29 21:43:57 +0200 <tomsmeding> and I refuse to believe it's fucking necessary
2024-08-29 21:44:01 +0200 <[exa]> ah so it can glue the rest of the layout to anywhere?
2024-08-29 21:44:21 +0200 <tomsmeding> with a stateful parser you don't need any kind of brace insertion
2024-08-29 21:44:27 +0200 <Franciman> [exa]: memory consumption and/or speed
2024-08-29 21:45:03 +0200 <mauke> tomsmeding: what do you mean?
2024-08-29 21:45:24 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de)
2024-08-29 21:46:40 +0200 <[exa]> Franciman: depends a lot IMO on the usecase. Look at what attoparsecs do, haskell wins there. For memory-pokey stuff Chez might just be unbeatable just on the account of being much simpler.
2024-08-29 21:47:01 +0200hgolden_(~hgolden@204.152.216.106)
2024-08-29 21:47:04 +0200 <Franciman> nice
2024-08-29 21:47:05 +0200terrorjack4(~terrorjac@2a01:4f8:c17:dc9f::)
2024-08-29 21:47:05 +0200 <[exa]> ghc is inserting indents and dedents?
2024-08-29 21:48:23 +0200 <mauke> it's the layout of case/of that's messing things up
2024-08-29 21:49:08 +0200 <mauke> if you add { ; } for the case/of, you get a much more sensible error: parse error on input ‘<-’; Suggested fix: Possibly caused by a missing 'do'?
2024-08-29 21:50:12 +0200hgolden(~hgolden@2603:8000:9d00:3ed1:6c70:1ac0:d127:74dd) (Ping timeout: 276 seconds)
2024-08-29 21:51:25 +0200 <[exa]> Franciman: tbh looking at this https://ecraven.github.io/r7rs-benchmarks/ I'd somewhat bet on mildly optimized haskell
2024-08-29 21:51:35 +0200 <Franciman> hahah
2024-08-29 21:51:39 +0200 <mauke> and if you put '};' before 'return $', you get the same "not a constructor" error
2024-08-29 21:51:44 +0200 <tomsmeding> oh meh I apparently don't have 'do' parsing in my parser yet
2024-08-29 21:52:06 +0200 <[exa]> nvm back to useful coding :D
2024-08-29 21:52:21 +0200 <tomsmeding> but I wrote a parser of a subset of haskell at some point that 1. I'm fairly sure does not backtrack more than a bounded number of tokens, and 2. does nothing at all with braces
2024-08-29 21:52:38 +0200mreh(~matthew@host86-160-168-12.range86-160.btcentralplus.com) (Ping timeout: 255 seconds)
2024-08-29 21:52:44 +0200 <tomsmeding> it's a stateful parser combinator parser that keeps proper track of indented blocks
2024-08-29 21:52:54 +0200 <tomsmeding> you probably can't do that in alex/happy
2024-08-29 21:53:04 +0200 <tomsmeding> and it's probably slower than what ghc does :)
2024-08-29 21:53:38 +0200 <monochrom> Any solution to layout is a good solution. :)
2024-08-29 21:54:12 +0200 <mauke> > do 1 == 2 == False
2024-08-29 21:54:13 +0200 <lambdabot> error:
2024-08-29 21:54:13 +0200 <lambdabot> Precedence parsing error
2024-08-29 21:54:13 +0200 <lambdabot> cannot mix ‘==’ [infix 4] and ‘==’ [infix 4] in the same infix expre...
2024-08-29 21:55:10 +0200 <mauke> > (do 1 == 2) == False
2024-08-29 21:55:11 +0200 <lambdabot> True
2024-08-29 21:55:16 +0200 <mauke> hmm
2024-08-29 21:55:36 +0200 <tomsmeding> precedence resolution comes after parsing proper
2024-08-29 21:56:07 +0200 <tomsmeding> it first parses it as a stupid tree without any precedences, then finds all the infix* statements, then goes back and fixes all the operator trees
2024-08-29 21:56:56 +0200raehik(~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net)
2024-08-29 21:57:10 +0200 <mauke> oh, they fixed that in Haskell 2010
2024-08-29 21:57:17 +0200 <mauke> it was valid code in H98
2024-08-29 21:57:24 +0200L29Ah(~L29Ah@wikipedia/L29Ah)
2024-08-29 21:57:55 +0200lxsameer(~lxsameer@Serene/lxsameer) (Ping timeout: 244 seconds)
2024-08-29 21:58:02 +0200 <mauke> oh, or I'm misremembering things
2024-08-29 21:58:04 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 21:58:09 +0200 <[exa]> I like this meaning of "fixed"
2024-08-29 21:58:46 +0200 <mauke> > let x = 42 in x == 42 == True
2024-08-29 21:58:48 +0200 <lambdabot> error:
2024-08-29 21:58:48 +0200 <lambdabot> Precedence parsing error
2024-08-29 21:58:48 +0200 <lambdabot> cannot mix ‘==’ [infix 4] and ‘==’ [infix 4] in the same infix expre...
2024-08-29 21:58:56 +0200 <mauke> ^ this was valid in Haskell 98
2024-08-29 21:59:27 +0200 <tomsmeding> then that's definitely a fix
2024-08-29 22:00:19 +0200 <dmj`> it was the best of times, it was the worst of times
2024-08-29 22:00:36 +0200 <dolio> Haskell98 says == is infix 4.
2024-08-29 22:01:05 +0200 <tomsmeding> dolio: I think the point is that it was parsed as "hey, the second == is a syntax error, apparently the `let` ends"
2024-08-29 22:01:06 +0200 <mauke> I don't think == was changed
2024-08-29 22:01:22 +0200 <dolio> Oh, I see.
2024-08-29 22:01:34 +0200 <tomsmeding> which is very awkward
2024-08-29 22:01:36 +0200 <mauke> the let body extends to the right "as far as possible"
2024-08-29 22:01:37 +0200ft(~ft@p4fc2a393.dip0.t-ipconnect.de) (Quit: Lost terminal)
2024-08-29 22:01:38 +0200 <dolio> Did anyone ever actually implement that parsing rule?
2024-08-29 22:01:45 +0200neuroevolutus(~neuroevol@37.19.200.135) (Ping timeout: 256 seconds)
2024-08-29 22:02:28 +0200ash3en(~Thunderbi@2a01:c23:8c99:e00:e1c5:8430:a907:e2c0) (Quit: ash3en)
2024-08-29 22:04:29 +0200 <dmj`> dolio: Lennart found a new solution for it in his MicroHs project. The part where the parser gets invoked during the layout phase
2024-08-29 22:06:31 +0200peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com)
2024-08-29 22:07:47 +0200ft(~ft@p4fc2a393.dip0.t-ipconnect.de)
2024-08-29 22:09:39 +0200machinedgod(~machinedg@d50-99-47-73.abhsia.telus.net)
2024-08-29 22:09:56 +0200 <dmj`> dolio: https://github.com/augustss/MicroHs/blob/master/src/MicroHs/Parse.hs#L274-L294
2024-08-29 22:10:53 +0200 <dmj`> the number 5 rule, layout stack gets popped different if a parse error is detected
2024-08-29 22:10:57 +0200 <dolio> This doesn't cover the let case, though, right?
2024-08-29 22:11:15 +0200 <dmj`> I think he uses it for let, where, do, case, since they all have the same issue iirc
2024-08-29 22:12:09 +0200 <dmj`> if you ctrl+f for "pBlock" it gets used in all those scenarios
2024-08-29 22:14:37 +0200 <dolio> There's no pBlock for the relevant part of let.
2024-08-29 22:16:35 +0200 <dmj`> https://github.com/augustss/MicroHs/blob/master/src/MicroHs/Parse.hs#L623
2024-08-29 22:16:56 +0200 <dolio> The relevant part is after the "in".
2024-08-29 22:18:10 +0200 <dmj`> isn't it in the "let { }", and then if you nest lets it could be problematic, trying to close the outer let prematurely inside the inner let
2024-08-29 22:18:39 +0200 <mauke> no
2024-08-29 22:18:48 +0200 <dolio> No. It is `let ... in x == y == z` parsing as `(let ... in x == y) == z`, because `x == y == z` is a syntax error.
2024-08-29 22:19:29 +0200 <dolio> The weird rule is that various expressions, 'extend as far as possible such that they don't cause syntax errors.'
2024-08-29 22:19:40 +0200 <tomsmeding> what I find surprising is that a haskell parser is even _able_ to parse that as `(let ... in x == y) == z` in the first place, because the `infix ==` statement could well come after this code!
2024-08-29 22:19:48 +0200 <dolio> So, in principle, there might be a lambda expression example, too.
2024-08-29 22:20:00 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de)
2024-08-29 22:20:20 +0200 <dolio> Like `\x y z -> x == y == z` parsing as `(\x y z -> x == y) == z` as long as there's a z in the outer scope.
2024-08-29 22:21:25 +0200 <tomsmeding> if the 'infix' is commented, this code ceases to parse https://paste.tomsmeding.com/e1C0p56U
2024-08-29 22:21:49 +0200 <tomsmeding> if the parser cannot know the fixity of an operator when it needs to decide whether to terminate the `let` or not, how can it do so?
2024-08-29 22:22:03 +0200 <tomsmeding> or is terminating the `let` part of the post-parsing precedence fixing stage
2024-08-29 22:22:10 +0200 <dolio> And also the lexer was specified that way, too, so it could break up e.g. contiguous alphabetic characters if they would result in a syntax error.
2024-08-29 22:22:16 +0200 <monochrom> Shoot, that is actually interesting because with "== is neither left- nor right-assoc", x==y==z is a parse error.
2024-08-29 22:22:19 +0200 <dmj`> if its infix (without l or r specified) and the precedence is identical it should always be a layout error I thought
2024-08-29 22:23:20 +0200 <monochrom> This complicates the issue very much.
2024-08-29 22:24:12 +0200peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds)
2024-08-29 22:25:00 +0200 <dmj`> tomsmeding: the latter, Haskell tries to close let, where, case an do statements with virtual braces to make the syntax context free, but nesting causes parse errors, so in those cases the closing virtual braces are popped off the stack and parsing continues until the end of the expression
2024-08-29 22:25:36 +0200 <tomsmeding> dmj`: but based on what information does the parser decide to put a '}' before the second '=='?
2024-08-29 22:26:01 +0200 <tomsmeding> if the 'infix 4 ==' statement comes later than this expression, which it can, then the relevant information is not yet available
2024-08-29 22:27:35 +0200 <dolio> tomsmeding: I don't know if the weird 98 rule was actually implemented. It's pretty unintuitive.
2024-08-29 22:28:01 +0200 <dmj`> tomsmeding: I think it goes lexing, layout, parsing, then during typechecking fixity resolution will occur and that's where the precedence errors are thrown
2024-08-29 22:28:36 +0200 <dmj`> InfixOps Exp [(Op, Exp)] gets converted into a tree of InfixOp Exp Op Exp
2024-08-29 22:29:45 +0200 <tomsmeding> dmj`: right -- but if that's how it works, then surely the parser has no clue whether to terminate the `let` body before the second '=='
2024-08-29 22:30:02 +0200 <tomsmeding> so the misparse in question could never have occurred
2024-08-29 22:30:30 +0200 <dmj`> yea that's true, so maybe the no. 5 layout rule might not even be relevant to this issue, it would be handled by the fixity resolution
2024-08-29 22:30:37 +0200 <tomsmeding> dolio has the pertinent question: did GHC ever parse `let ... in x == y == z` as `(let ... in x == y) == z`?
2024-08-29 22:31:01 +0200 <dolio> I'd be somewhat surprised.
2024-08-29 22:31:32 +0200 <tomsmeding> if someone did, then they cared nil about parse error helpfulness :p
2024-08-29 22:31:46 +0200 <dmj`> I don't know tbh, Lennart parses it as the list representation above and throws the double == error here https://github.com/augustss/MicroHs/blob/master/src/MicroHs/Fixity.hs#L69
2024-08-29 22:32:05 +0200CrunchyFlakes(~CrunchyFl@ip-109-42-115-64.web.vodafone.de) (Read error: Connection reset by peer)
2024-08-29 22:32:18 +0200 <monochrom> Supposed "infix 4 ==" must be honoured, even when it's the very last line of the file. :)
2024-08-29 22:32:30 +0200 <monochrom> err, Supposedly!
2024-08-29 22:33:12 +0200 <monochrom> To be sure I appreciate that in practice it's such a pain and maybe not worth the effort.
2024-08-29 22:33:24 +0200 <dolio> That, I think, works.
2024-08-29 22:33:31 +0200 <tomsmeding> monochrom: I think that works perfectly
2024-08-29 22:33:52 +0200 <tomsmeding> this fails to parse: https://paste.tomsmeding.com/e1C0p56U
2024-08-29 22:34:44 +0200 <tomsmeding> and if someone says that this is to be taken as a parse failure that terminates a `let`, then that someone deserves a stomp
2024-08-29 22:35:24 +0200 <dolio> I don't think you can make that example into something that parses.
2024-08-29 22:35:34 +0200 <dolio> So H98 says it's okay to fail. :)
2024-08-29 22:35:36 +0200 <tomsmeding> you can, by removing the `infix` statement
2024-08-29 22:35:53 +0200 <dolio> No, you can't just throw away expressions.
2024-08-29 22:36:00 +0200 <tomsmeding> oh by rearranging parentheses, you mean
2024-08-29 22:36:02 +0200 <tomsmeding> right
2024-08-29 22:36:09 +0200 <dolio> You can only end the scope of something early.
2024-08-29 22:36:19 +0200 <tomsmeding> yes, it should definitely fail -- it was an illustration that 'infix' is honoured, even if it comes late
2024-08-29 22:36:26 +0200 <dolio> Or split up something that looks like a single lexeme.
2024-08-29 22:36:56 +0200 <tomsmeding> the latter of which is a mistake made in BASIC -- we learned from that
2024-08-29 22:37:35 +0200 <dolio> Maybe you could say that the last expression parses as `infix @ $`, except that's still not valid, and I'm not sure the spec was that ridiculous.
2024-08-29 22:37:42 +0200 <tomsmeding> :p
2024-08-29 22:38:03 +0200 <tomsmeding> it would be valid, perhaps, if an 'infix' statement also continued until a parse error
2024-08-29 22:38:07 +0200 <tomsmeding> but presumably it doesn't
2024-08-29 22:38:25 +0200 <dolio> It's invalid because @ isn't a valid operator, I think.
2024-08-29 22:38:28 +0200 <tomsmeding> though I guess the parse error would occur at the newline following the `$`
2024-08-29 22:38:34 +0200 <dolio> Yeah.
2024-08-29 22:38:55 +0200 <[exa]> btw is there any info on why haskells didn't adopt the prolog system? the xfy system looks quite unbeatable to me.
2024-08-29 22:38:58 +0200 <tomsmeding> > (@) = 4
2024-08-29 22:39:00 +0200 <lambdabot> <hint>:1:2: error: parse error on input ‘@’
2024-08-29 22:39:14 +0200 <tomsmeding> % (@) = 4
2024-08-29 22:39:14 +0200 <yahb2> <no output>
2024-08-29 22:39:16 +0200 <tomsmeding> ?
2024-08-29 22:39:22 +0200 <tomsmeding> % (@) + 1
2024-08-29 22:39:22 +0200 <yahb2> 5
2024-08-29 22:39:30 +0200 <tomsmeding> ghc version discrepancy?
2024-08-29 22:39:54 +0200 <tomsmeding> > let (@) = 4 in (@)
2024-08-29 22:39:55 +0200 <lambdabot> <hint>:1:6: error: parse error on input ‘@’
2024-08-29 22:40:13 +0200 <monochrom> I agree that no one should expect "let in x==y==z" to mean "(let in x==y)==z" even if the spec implies it by an obscure technicality. :)
2024-08-29 22:40:59 +0200 <monochrom> [exa]: What is the xfy system?
2024-08-29 22:41:30 +0200 <[exa]> the one for marking the fixities in op/3
2024-08-29 22:41:34 +0200 <[exa]> sec
2024-08-29 22:42:09 +0200 <[exa]> ( https://www.swi-prolog.org/pldoc/doc_for?object=op/3 )
2024-08-29 22:42:29 +0200ubert(~Thunderbi@178.165.178.117.wireless.dyn.drei.com) (Ping timeout: 260 seconds)
2024-08-29 22:42:39 +0200ZharMeny(~ZharMeny@user/ZharMeny) (Ping timeout: 260 seconds)
2024-08-29 22:43:47 +0200[exa]-> afk
2024-08-29 22:44:53 +0200 <tomsmeding> hm, so 'infix' is xfx, 'infixl' is yfx, 'infixr' is xfy
2024-08-29 22:45:32 +0200 <tomsmeding> the only binary operator case not describable with haskell's syntax is yfy, and I don't see any prolog operators with that precedence
2024-08-29 22:45:36 +0200 <EvanR> yeah the three letter codes are incomprehensible
2024-08-29 22:45:42 +0200 <tomsmeding> also that
2024-08-29 22:45:47 +0200driib3(~driib@vmi931078.contaboserver.net) (Quit: The Lounge - https://thelounge.chat)
2024-08-29 22:46:15 +0200 <tomsmeding> "left-associative" and "right-associative" are not much better, but at least one can mumble something like "the parentheses bunch up towards the left/right"
2024-08-29 22:46:29 +0200 <tomsmeding> oh, yfy is not even allowed
2024-08-29 22:46:35 +0200 <tomsmeding> [exa]: in what way is xfy better :p
2024-08-29 22:46:43 +0200driib31(~driib@vmi931078.contaboserver.net)
2024-08-29 22:47:00 +0200 <mauke> what precedence is afk
2024-08-29 22:47:08 +0200 <tomsmeding> parse error
2024-08-29 22:47:25 +0200gentauro(~gentauro@user/gentauro) (Read error: Connection reset by peer)
2024-08-29 22:48:34 +0200 <tomsmeding> or hm, if y is "<= prec" and x is "< prec", i.e. "< prec-1", then w is "< prec-2", so afk would require a term with precedence prec-23 on the left and prec-13 on the right
2024-08-29 22:49:07 +0200ZharMeny(~ZharMeny@user/ZharMeny)
2024-08-29 22:49:26 +0200 <tomsmeding> can go up to prec-25 using 'z'; unfortunately, the rest of the 1200-large range of precedence values you can't cover
2024-08-29 22:50:52 +0200 <EvanR> precedence is another thing solved by monochromes campaign of explicitness, always use explicit parentheses
2024-08-29 22:51:23 +0200 <tomsmeding> lisper detected
2024-08-29 22:52:59 +0200gmg(~user@user/gehmehgeh) (Quit: Leaving)
2024-08-29 22:53:11 +0200gentauro(~gentauro@user/gentauro)
2024-08-29 22:55:03 +0200 <ski> (iirc, Mercury has some `fxy' binary prefix operators)
2024-08-29 23:00:54 +0200 <glguy> monochrom: Your example helped me to find an optimization over using "otherwise"
2024-08-29 23:01:23 +0200 <glguy> > let f x | even x = 1 | let = 0 in f <$> [1..5]
2024-08-29 23:01:25 +0200 <lambdabot> [0,1,0,1,0]
2024-08-29 23:01:51 +0200 <tomsmeding> beautiful!
2024-08-29 23:04:29 +0200driib31(~driib@vmi931078.contaboserver.net) (Quit: The Lounge - https://thelounge.chat)
2024-08-29 23:04:49 +0200 <mauke> is that just an empty set of bindings?
2024-08-29 23:04:54 +0200 <tomsmeding> yes
2024-08-29 23:05:05 +0200 <dolio> Oh, that's what's happening?
2024-08-29 23:05:16 +0200 <tomsmeding> > let in 7
2024-08-29 23:05:17 +0200 <lambdabot> 7
2024-08-29 23:06:18 +0200 <mauke> % id let in 7
2024-08-29 23:06:18 +0200 <yahb2> 7
2024-08-29 23:06:29 +0200 <glguy> :t \case
2024-08-29 23:06:30 +0200 <lambdabot> p1 -> p2
2024-08-29 23:06:46 +0200 <tomsmeding> mauke: you sneaky -XBlockArguments
2024-08-29 23:07:33 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2024-08-29 23:07:57 +0200 <tomsmeding> funny messed up error formatting here:
2024-08-29 23:07:59 +0200 <tomsmeding> % id do let
2024-08-29 23:07:59 +0200 <yahb2> <interactive>:31:7: error: ; The last statement in a 'do' block must be an expression let
2024-08-29 23:08:14 +0200 <tomsmeding> (surely the copy of the input expression should be on a new line)
2024-08-29 23:08:23 +0200 <mauke> % mod do { 5 * 6 } let in 3 + 4
2024-08-29 23:08:23 +0200 <yahb2> 2
2024-08-29 23:08:34 +0200madjestic(~madjestic@103-135-99-95.ftth.glasoperator.nl) (Ping timeout: 252 seconds)
2024-08-29 23:08:51 +0200michalz(~michalz@185.246.207.218) (Remote host closed the connection)
2024-08-29 23:10:01 +0200 <mauke> % runST let in pure 42
2024-08-29 23:10:01 +0200 <yahb2> <interactive>:35:1: error: ; Variable not in scope: runST :: f0 a0 -> t
2024-08-29 23:10:24 +0200 <mauke> % import Control.Monad.ST
2024-08-29 23:10:24 +0200 <yahb2> <no output>
2024-08-29 23:10:26 +0200 <mauke> % runST let in pure 42
2024-08-29 23:10:26 +0200 <yahb2> 42
2024-08-29 23:10:30 +0200 <mauke> excellent
2024-08-29 23:10:39 +0200driib31(~driib@vmi931078.contaboserver.net)
2024-08-29 23:10:47 +0200 <tomsmeding> % :set -XNoBlockArguments
2024-08-29 23:10:47 +0200 <yahb2> <no output>
2024-08-29 23:15:41 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Read error: Connection reset by peer)
2024-08-29 23:20:47 +0200 <ski> > [() | let]
2024-08-29 23:20:49 +0200 <lambdabot> [()]
2024-08-29 23:22:18 +0200 <glguy> ski: that's useful with -XOverloadedLists - it fixes the type to be []
2024-08-29 23:22:44 +0200pavonia(~user@user/siracusa)
2024-08-29 23:23:24 +0200 <ski> to not be
2024-08-29 23:24:05 +0200 <ncf> that is the question
2024-08-29 23:24:12 +0200oo_miguel(~Thunderbi@78.10.207.45) (Quit: oo_miguel)
2024-08-29 23:25:08 +0200driib31(~driib@vmi931078.contaboserver.net) (Quit: The Lounge - https://thelounge.chat)
2024-08-29 23:29:19 +0200driib31(~driib@vmi931078.contaboserver.net)
2024-08-29 23:30:50 +0200driib31(~driib@vmi931078.contaboserver.net) (Client Quit)
2024-08-29 23:31:56 +0200 <EvanR> :t (2,b)
2024-08-29 23:31:57 +0200 <lambdabot> Num a => (a, Expr)
2024-08-29 23:36:44 +0200driib31(~driib@vmi931078.contaboserver.net)
2024-08-29 23:36:57 +0200son0p(~ff@186.121.18.131)
2024-08-29 23:37:13 +0200 <c_wraith> Oh no. (|| not (2, b)) is a type error!
2024-08-29 23:37:49 +0200 <glguy> :t (/ negate (2*b))
2024-08-29 23:37:50 +0200 <lambdabot> Expr -> Expr
2024-08-29 23:41:33 +0200 <c_wraith> :t (|| not (2 b)) -- I "fixed" it
2024-08-29 23:41:34 +0200 <lambdabot> Bool -> Bool
2024-08-29 23:43:20 +0200 <ski> lambdaProlog (Teyjus (compiles to a WAM-like byte code) implementation) has `prefix',`prefixl',`postfix',`postfixr' in addition to `infix',`infixl',`infixr'
2024-08-29 23:46:25 +0200oo_miguel(~Thunderbi@78.10.207.45)
2024-08-29 23:47:19 +0200 <ski> (these correspond to the Prolog fixities, `fx',`fy',`xf',`yf' ; `xfx',`yfx',`xfy', respectively)
2024-08-29 23:48:40 +0200 <ski> (oh .. i suppose it's `prefixr' and `postfixl', not `prefixl' and `postfixr', actually)
2024-08-29 23:50:32 +0200target_i(~target_i@user/target-i/x-6023099) (Quit: leaving)
2024-08-29 23:50:44 +0200oo_miguel(~Thunderbi@78.10.207.45) (Ping timeout: 252 seconds)
2024-08-29 23:51:42 +0200machinedgod(~machinedg@d50-99-47-73.abhsia.telus.net) (Ping timeout: 272 seconds)
2024-08-29 23:54:33 +0200nshepperd(nshepperd@2600:3c03::f03c:92ff:fe28:92c9) (Ping timeout: 245 seconds)
2024-08-29 23:54:57 +0200esnos(~user@176.106.34.161) (Ping timeout: 246 seconds)
2024-08-29 23:56:32 +0200hgolden__(~hgolden@23.162.40.69)
2024-08-29 23:57:13 +0200 <lystra> Hi. I'm modifying ghc-9.4.8 to take -Wl,-rpath, into consideration as output from "pkgconfig --libs". https://gist.github.com/twwlogin/33eb2db7bf4eaebb0f1712110d31787c is an example of the change I made. ghc is complaining about extraRpathDirs being out of scope. Any idea why?
2024-08-29 23:59:05 +0200hgolden_(~hgolden@204.152.216.106) (Ping timeout: 255 seconds)