2023-12-09 00:03:08 +0100 | coot | (~coot@89-69-206-216.dynamic.chello.pl) (Quit: coot) |
2023-12-09 00:05:07 +0100 | dhil | (~dhil@2001:8e0:2014:3100:7b3d:f8f2:337f:eb5a) (Ping timeout: 246 seconds) |
2023-12-09 00:10:11 +0100 | lane1 | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 264 seconds) |
2023-12-09 00:11:00 +0100 | machinedgod | (~machinedg@93-136-199-108.adsl.net.t-com.hr) |
2023-12-09 00:16:05 +0100 | bilegeek | (~bilegeek@2600:1008:b049:5a95:99c5:8ca9:6c97:5a13) |
2023-12-09 00:17:18 +0100 | notzmv | (~zmv@user/notzmv) (Ping timeout: 260 seconds) |
2023-12-09 00:19:58 +0100 | mikess | (~sam@user/mikess) (Ping timeout: 255 seconds) |
2023-12-09 00:22:54 +0100 | mikess | (~sam@user/mikess) |
2023-12-09 00:28:26 +0100 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2023-12-09 00:31:39 +0100 | mikess | (~sam@user/mikess) (Quit: leaving) |
2023-12-09 00:32:41 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 00:34:05 +0100 | acidjnk_new | (~acidjnk@p200300d6e72b93646479aa555f408eaf.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
2023-12-09 00:34:43 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2023-12-09 00:40:05 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 252 seconds) |
2023-12-09 00:49:19 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 00:49:31 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) |
2023-12-09 00:50:28 +0100 | tremon | (~tremon@83.80.159.219) (Quit: getting boxed in) |
2023-12-09 00:52:32 +0100 | mosul | (~mosul@user/mosul) |
2023-12-09 00:55:03 +0100 | [itchyjunk] | (~itchyjunk@user/itchyjunk/x-7353470) |
2023-12-09 00:57:45 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 256 seconds) |
2023-12-09 00:58:43 +0100 | [_] | (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 260 seconds) |
2023-12-09 01:03:16 +0100 | <monochrom> | I was reading Bauer's "what's algebraic about algebraic effects?". I love this fun sentence: "The next time the subject of tensor products comes up, you may impress your mathematician friends by mentioning that you know how to tensor software with hardware." >:D |
2023-12-09 01:03:51 +0100 | pavonia | (~user@user/siracusa) |
2023-12-09 01:06:18 +0100 | <ski> | link ? |
2023-12-09 01:07:39 +0100 | <geekosaur> | https://arxiv.org/abs/1807.05923 I think? |
2023-12-09 01:07:45 +0100 | <geekosaur> | well, via that |
2023-12-09 01:07:51 +0100 | <monochrom> | Yeah that. |
2023-12-09 01:08:06 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2023-12-09 01:08:32 +0100 | <ski> | ty |
2023-12-09 01:10:22 +0100 | <monochrom> | (The sentence means the tensor product between effectful programs and external environment/state-space.) |
2023-12-09 01:14:04 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2023-12-09 01:14:23 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2023-12-09 01:16:36 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 245 seconds) |
2023-12-09 01:24:39 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 252 seconds) |
2023-12-09 01:29:24 +0100 | idgaen | (~idgaen@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 4.1.1) |
2023-12-09 01:47:15 +0100 | sawilagar | (~sawilagar@user/sawilagar) (Ping timeout: 260 seconds) |
2023-12-09 01:52:49 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2023-12-09 01:57:31 +0100 | juri_ | (~juri@faikvm.com) (Ping timeout: 255 seconds) |
2023-12-09 01:58:31 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 01:59:07 +0100 | juri_ | (~juri@79.140.117.90) |
2023-12-09 02:04:28 +0100 | <dsal> | I'm having trouble with an impredicative type. I want to write ` :: [Coercible a b => a] -> [b]` but obvious things aren't working. I should be able to do this, right? |
2023-12-09 02:04:31 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 268 seconds) |
2023-12-09 02:05:15 +0100 | <dsal> | Maybe that's too magical. Makes usage super easy… |
2023-12-09 02:05:39 +0100 | <ski> | did you mean `[forall a. Coercible a b => a] -> [b]' ? or maybe `[exists a. Coercible a b *> a] -> [b]' ? |
2023-12-09 02:06:25 +0100 | ski | suspects the latter |
2023-12-09 02:06:36 +0100 | <dsal> | Ohh. I forgot to scope the forall. I'm not familiar with exists. |
2023-12-09 02:06:55 +0100 | <ski> | pseudo-Haskell (not (yet ?) supported by any extension) |
2023-12-09 02:07:40 +0100 | <ski> | with the latter, each element of the list could have a different type `a', as long as they're all coercible to `b' |
2023-12-09 02:07:52 +0100 | <dsal> | Ah. Yeah, that sounds right. |
2023-12-09 02:08:04 +0100 | <ski> | with the former, each element of the list has to be polymorphic, has to have *all* types `a' that are coercible to `b' |
2023-12-09 02:08:32 +0100 | <ski> | you want the former, or the latter ? |
2023-12-09 02:08:33 +0100 | <dsal> | I just want to pass a bag of newtype values I have lying around that all have the same representation and let the callee do the conversion. |
2023-12-09 02:08:47 +0100 | <ski> | do all of them have the same type ? |
2023-12-09 02:08:51 +0100 | <dsal> | No. |
2023-12-09 02:10:08 +0100 | jargon | (~jargon@32.sub-174-238-226.myvzw.com) (Remote host closed the connection) |
2023-12-09 02:11:06 +0100 | <ski> | there are two ways of encoding `exists a. Cxt a *> Foo a'. first one is to define a datatype `data SomeFoo = forall a. Cxt a => WrapFoo (Foo a)' (using `ExistentialQuantification' (imho a misnomer, `ExistentialConstructors' would be better)), alternatively using `data SomeFoo where WrapFoo :: Cxt a => Foo a -> SomeFoo' (using `GADTs') |
2023-12-09 02:11:18 +0100 | <ski> | in either case, you get |
2023-12-09 02:11:27 +0100 | <ski> | WrapFoo :: Cxt a => Foo a -> SomeFoo |
2023-12-09 02:11:32 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 02:11:37 +0100 | <ski> | which really means here |
2023-12-09 02:11:41 +0100 | <ski> | WrapFoo :: forall a. Cxt a => Foo a -> SomeFoo |
2023-12-09 02:11:46 +0100 | <ski> | which is logically equivalent to |
2023-12-09 02:11:57 +0100 | <ski> | WrapFoo :: (exists a. Cxt a *> Foo a) -> SomeFoo |
2023-12-09 02:12:11 +0100 | <ski> | therefore a `SomeFoo' value expresses `exists a. Cxt a *> Foo a' |
2023-12-09 02:12:28 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 255 seconds) |
2023-12-09 02:12:30 +0100 | <ski> | the second way of encoding is to replace |
2023-12-09 02:12:43 +0100 | <ski> | makeSomeFoo :: ... -> exists a. Cxt a *> Foo a |
2023-12-09 02:12:44 +0100 | <ski> | with |
2023-12-09 02:13:04 +0100 | <ski> | withSomeFoo :: ... -> (forall a. Cxt a => Foo a -> o) -> o |
2023-12-09 02:13:17 +0100 | <ski> | (requires `Rank2Types') |
2023-12-09 02:13:24 +0100 | [itchyjunk] | (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
2023-12-09 02:13:30 +0100 | [_] | (~itchyjunk@user/itchyjunk/x-7353470) |
2023-12-09 02:13:49 +0100 | <ski> | this second encoding, the CPS/Church encoding, is useful when you want to return an existential, but unpack it immediately after the call on the other side |
2023-12-09 02:13:55 +0100 | <dsal> | For my use case, I'm basically passing a list of differently wrapped types that all unwrap to the same thing, but I don't want to make it harder for the caller. If I have to do anything other than [v1, v2, v3] (for three types coercible to underlying value), then I might as well just have the caller coerce. |
2023-12-09 02:14:13 +0100 | <ski> | while the `data' type encoding, is useful when you want to store the existential in some data structure (like your list) |
2023-12-09 02:16:04 +0100 | <ski> | dsal : right, okay |
2023-12-09 02:16:39 +0100 | <ski> | for the `data' encoding, you need the data constructor. for the CPS encoding, you need to use a `withXXX' version (or introduce a lambda) |
2023-12-09 02:17:02 +0100 | <dsal> | Now my call looks like [coerce @_ T v1, coerce v2, coerce v3] Which… is OK, I guess. I'm only trying to add sugar. |
2023-12-09 02:17:48 +0100 | <ski> | fair |
2023-12-09 02:19:09 +0100 | <ski> | (perhaps "raw" existentials could be added at some point. but i'm not too sure how little extra annotations (say type ascriptions, possibly) could be needed) |
2023-12-09 02:19:39 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 252 seconds) |
2023-12-09 02:20:39 +0100 | <monochrom> | But hey if you have turned out impredicativity anyway you may as well simulate raw existentials by CPSing to raw universals >:) |
2023-12-09 02:20:53 +0100 | emmanuelux | (~emmanuelu@user/emmanuelux) |
2023-12-09 02:21:20 +0100 | <monochrom> | [forall o. (forall a. Cxt a => Foo a -> o) -> o] |
2023-12-09 02:22:04 +0100 | <ski> | yep ("introduce a lambda") |
2023-12-09 02:22:40 +0100 | emmanuelux_ | (~emmanuelu@user/emmanuelux) (Ping timeout: 276 seconds) |
2023-12-09 02:23:03 +0100 | <monochrom> | "So you want a list of objects. Let me introduce you to System F..." >:) |
2023-12-09 02:26:41 +0100 | notzmv | (~zmv@user/notzmv) |
2023-12-09 02:33:36 +0100 | Tuplanolla | (~Tuplanoll@91-159-68-236.elisa-laajakaista.fi) (Quit: Leaving.) |
2023-12-09 02:42:46 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 02:44:22 +0100 | <dsal> | Yeah, I thought about doing that, but anything other than passing the raw value might as well be `coerce`. This isn't a common use case. |
2023-12-09 02:44:28 +0100 | <dsal> | (probably, I don't know, I'm just trying this out) |
2023-12-09 02:46:10 +0100 | <monochrom> | In practice, [coerce x, coerce y, ...] is probably the simplest. |
2023-12-09 02:47:01 +0100 | <ski> | if it's a list literal, i guess one could use TH .. |
2023-12-09 02:47:17 +0100 | <ski> | (.. probably not worth it) |
2023-12-09 02:47:59 +0100 | myme | (~myme@2a01:799:d60:e400:674:e335:7501:d41d) (Ping timeout: 268 seconds) |
2023-12-09 02:48:37 +0100 | myme | (~myme@2a01:799:d60:e400:f494:822d:598a:260f) |
2023-12-09 02:52:34 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 276 seconds) |
2023-12-09 02:56:28 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 02:57:35 +0100 | machinedgod | (~machinedg@93-136-199-108.adsl.net.t-com.hr) (Ping timeout: 264 seconds) |
2023-12-09 02:58:53 +0100 | machinedgod | (~machinedg@93-136-130-2.adsl.net.t-com.hr) |
2023-12-09 03:00:32 +0100 | <iqubic> | What are we talling about here? |
2023-12-09 03:01:33 +0100 | mosul | (~mosul@user/mosul) (Ping timeout: 268 seconds) |
2023-12-09 03:01:40 +0100 | jargon | (~jargon@32.sub-174-238-226.myvzw.com) |
2023-12-09 03:01:52 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Ping timeout: 255 seconds) |
2023-12-09 03:02:22 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
2023-12-09 03:02:25 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 255 seconds) |
2023-12-09 03:02:57 +0100 | mosul | (~mosul@user/mosul) |
2023-12-09 03:10:11 +0100 | machinedgod | (~machinedg@93-136-130-2.adsl.net.t-com.hr) (Ping timeout: 264 seconds) |
2023-12-09 03:15:07 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 03:23:27 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 252 seconds) |
2023-12-09 03:24:07 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 03:26:07 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 240 seconds) |
2023-12-09 03:27:03 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2023-12-09 03:27:44 +0100 | xff0x_ | (~xff0x@2405:6580:b080:900:9024:2952:42f7:bdd9) |
2023-12-09 03:30:46 +0100 | xff0x | (~xff0x@ai096045.d.east.v6connect.net) (Ping timeout: 255 seconds) |
2023-12-09 03:33:01 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 256 seconds) |
2023-12-09 03:44:49 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 03:47:00 +0100 | maars | (uid160334@id-160334.uxbridge.irccloud.com) |
2023-12-09 03:48:49 +0100 | <edwardk> | iqubic: haskell, nominally. i mean i sometimes like to talk about ai or fish these days, but haskell is what it says on the tin |
2023-12-09 03:49:01 +0100 | <iqubic> | I see. |
2023-12-09 03:49:11 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 264 seconds) |
2023-12-09 03:55:41 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection) |
2023-12-09 03:57:23 +0100 | not_reserved | (~not_reser@194.124.76.8) |
2023-12-09 03:57:57 +0100 | tommy__ | (~tommy@2601:681:5a00:a260:f35c:8e59:cc90:e32a) |
2023-12-09 04:00:49 +0100 | xff0x_ | (~xff0x@2405:6580:b080:900:9024:2952:42f7:bdd9) (Ping timeout: 276 seconds) |
2023-12-09 04:01:13 +0100 | xff0x | (~xff0x@ai085147.d.east.v6connect.net) |
2023-12-09 04:04:27 +0100 | tommy__ | (~tommy@2601:681:5a00:a260:f35c:8e59:cc90:e32a) (Ping timeout: 268 seconds) |
2023-12-09 04:08:52 +0100 | <dsal> | I saw a whale this morning. |
2023-12-09 04:10:23 +0100 | <dsal> | iqubic: I'm doing a thing at work where I have a large number of newtype wrappers around a fundamental type and I want to do some stuff where I shed the type distinction and do stuff with the fundamental. I'd like to be able to do that with a list of stuff I know can be coerced to that type without having to do the coercion in the caller (just to make it easier to use), but it's probably not that important. |
2023-12-09 04:10:39 +0100 | <iqubic> | I see... |
2023-12-09 04:12:22 +0100 | mikess | (~sam@user/mikess) |
2023-12-09 04:16:29 +0100 | enviosity | (~enviosity@176.254.244.83) (Ping timeout: 240 seconds) |
2023-12-09 04:17:41 +0100 | analoq | (~yashi@user/dies) (Ping timeout: 240 seconds) |
2023-12-09 04:19:32 +0100 | analoq | (~yashi@user/dies) |
2023-12-09 04:25:52 +0100 | edr | (~edr@user/edr) (Quit: Leaving) |
2023-12-09 04:29:49 +0100 | pretty_dumm_guy | (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5) |
2023-12-09 04:31:12 +0100 | <edwardk> | dsal: but a whale is a mammal. it doesn't count ;) |
2023-12-09 04:43:11 +0100 | td_ | (~td@i5387090D.versanet.de) (Ping timeout: 252 seconds) |
2023-12-09 04:45:12 +0100 | td_ | (~td@i5387091B.versanet.de) |
2023-12-09 04:46:34 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) |
2023-12-09 04:54:26 +0100 | <dsal> | edwardk: heh, [category theory joke] but it was the first one of the season, so I was excited about it. |
2023-12-09 04:54:48 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
2023-12-09 04:54:49 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2023-12-09 05:14:05 +0100 | <iqubic> | edwardk: do you think that the semigroupoids library is still needed now that Foldable1 is in Base? |
2023-12-09 05:17:28 +0100 | <edwardk> | i still use a few things from it now and again |
2023-12-09 05:17:31 +0100 | phma | (~phma@host-67-44-208-50.hnremote.net) (Read error: Connection reset by peer) |
2023-12-09 05:17:56 +0100 | phma | (phma@2001:5b0:211f:f418:cffc:74b5:153b:99d9) |
2023-12-09 05:19:04 +0100 | <edwardk> | Extend, Bind, Conclude, Decide, Devise, Apply, Alt don't have base equivalents |
2023-12-09 05:19:05 +0100 | <iqubic> | Like what? |
2023-12-09 05:19:51 +0100 | <iqubic> | What is Decide? Is that like, some covariant Applicative Functor? |
2023-12-09 05:19:56 +0100 | <edwardk> | let alone the Bitraversable1, etc. kind of things. |
2023-12-09 05:20:09 +0100 | <iqubic> | *contravariant |
2023-12-09 05:20:22 +0100 | <edwardk> | https://hackage.haskell.org/package/semigroupoids-6.0.0.1/docs/Data-Functor-Contravariant-Decide.h… |
2023-12-09 05:21:59 +0100 | <iqubic> | What the heck does that do? |
2023-12-09 05:22:38 +0100 | <edwardk> | 'if you can handle b, and you can handle c, and you can convert an a into b or c you can handle a." |
2023-12-09 05:23:18 +0100 | <iqubic> | I see... |
2023-12-09 05:24:12 +0100 | <edwardk> | this is the version without a unit, unlike Decidable in contravariant |
2023-12-09 05:24:24 +0100 | <iqubic> | So `f' has to use the parameter in a negative position. |
2023-12-09 05:24:33 +0100 | <edwardk> | yep |
2023-12-09 05:24:57 +0100 | <edwardk> | easiest instance is Op r |
2023-12-09 05:25:02 +0100 | <edwardk> | with no constraints on r |
2023-12-09 05:25:11 +0100 | <iqubic> | I see. |
2023-12-09 05:25:42 +0100 | <ski> | write end of concurrent channels ? |
2023-12-09 05:26:23 +0100 | <iqubic> | Would `Newtype Predicate a = Predicate { runPredicate :: a -> Bool }' also work? |
2023-12-09 05:26:33 +0100 | <ski> | yes |
2023-12-09 05:26:37 +0100 | <edwardk> | iqubic: yep. aka Op Bool |
2023-12-09 05:26:58 +0100 | <edwardk> | https://www.schoolofhaskell.com/user/edwardk/editorial/procrustean-mathematics talks about why i care about these sort of crippled not-quite-what-everyone-uses classes |
2023-12-09 05:28:08 +0100 | <iqubic> | I see that Divisible from Contravariant has a "conquer :: f a" function. What's that for? |
2023-12-09 05:28:20 +0100 | <ski> | (iow `CoyonedaOp Chan') |
2023-12-09 05:28:33 +0100 | jargon | (~jargon@32.sub-174-238-226.myvzw.com) (Remote host closed the connection) |
2023-12-09 05:28:44 +0100 | <edwardk> | its a 'unit' for divide |
2023-12-09 05:29:00 +0100 | <edwardk> | plays the same role as pure |
2023-12-09 05:29:02 +0100 | <ski> | `(a -> Void) -> f a' |
2023-12-09 05:29:04 +0100 | <edwardk> | which seems odd given that signature |
2023-12-09 05:29:28 +0100 | <edwardk> | you use the mapping to () actually |
2023-12-09 05:29:36 +0100 | <iqubic> | What would "conquer" look like for Op r? |
2023-12-09 05:30:04 +0100 | <edwardk> | there it requires r have an instance. i'll let you guess what it might be that is associative and has a unit |
2023-12-09 05:30:42 +0100 | <iqubic> | newtype Op r a = Op { getOp :: a -> r } |
2023-12-09 05:30:45 +0100 | <edwardk> | for predicates conquer is the predicate that returns true |
2023-12-09 05:30:50 +0100 | <edwardk> | in all cases |
2023-12-09 05:31:16 +0100 | <edwardk> | so that if you divide and conquer one case you are left with the predicate for the other case (because divide uses && on the Bool result) |
2023-12-09 05:32:40 +0100 | <iqubic> | let me guess, you need "instance Monoid r => Op r where..." so that you can return 'mempty' in "conquer"? |
2023-12-09 05:33:09 +0100 | <edwardk> | pure :: (() -> a) -> f a ~ a -> f a, conquer :: (a -> ()) -> f a ~ f a, lose :: (a -> Void) -> f a, empty :: (Void -> a) -> f a ~ f a |
2023-12-09 05:33:17 +0100 | <edwardk> | yep |
2023-12-09 05:33:29 +0100 | <iqubic> | https://hackage.haskell.org/package/contravariant-1.5.5/docs/src/Data.Functor.Contravariant.Divisi… |
2023-12-09 05:33:38 +0100 | <iqubic> | Looks like I'm write! |
2023-12-09 05:33:42 +0100 | <iqubic> | *right |
2023-12-09 05:34:16 +0100 | <edwardk> | anyways those 4 units above are the key to understanding Applicative, Divisible, Decidable, and Alternative in many ways and why those 4 classes are so tightly intertwined |
2023-12-09 05:35:06 +0100 | <edwardk> | the same story that says monads are monoids in the category of endofunctors can be used to argue about Applicative, which is also a monoid object in the category of endofunctors, just w.r.t a different choice of tensor |
2023-12-09 05:35:27 +0100 | <edwardk> | the tensor chosen there is something called Day convolution |
2023-12-09 05:35:33 +0100 | <iqubic> | What the hell is "lose :: (a -> Void) -> f a" |
2023-12-09 05:35:40 +0100 | <edwardk> | but Day convolution is _usually_ done about contravariant functors. |
2023-12-09 05:35:46 +0100 | <iqubic> | Why is Void there? |
2023-12-09 05:35:48 +0100 | <edwardk> | Contravariant 'empty' |
2023-12-09 05:35:55 +0100 | <ski> | iqubic : instead of `Either b c' |
2023-12-09 05:35:56 +0100 | <edwardk> | :t empty |
2023-12-09 05:35:58 +0100 | <lambdabot> | Alternative f => f a |
2023-12-09 05:36:39 +0100 | <edwardk> | notice how all 4 of those take in an arrow that is either to or from an initial or terminal object |
2023-12-09 05:36:57 +0100 | <edwardk> | and then the forms we usually deal with are ones that have been simplified using that fact |
2023-12-09 05:36:58 +0100 | <iqubic> | I do notice that. |
2023-12-09 05:37:15 +0100 | <edwardk> | hence why i wrote the unsimplified versions next to the ones we know |
2023-12-09 05:38:10 +0100 | <iqubic> | Void is the intial object, right? And () is the terminal object? |
2023-12-09 05:38:17 +0100 | <ski> | yea |
2023-12-09 05:38:37 +0100 | <ski> | (ignoring bottoms) |
2023-12-09 05:39:02 +0100 | <edwardk> | for a fun exercise play around with Day :: (a -> (b, c)) -> f b -> g c -> Day f g a but we could also write Day :: (a -> Either b c) -> f b -> g c -> Day f g a, or Day :: ((b, c) -> a) -> f b -> g c -> Day f g a or Day :: (Either b c -> a) -> f b -> g c -> Day f g a |
2023-12-09 05:39:27 +0100 | <edwardk> | then for a fun exercise you can realize that for one of those there exists a function that takes Applicative f => Day f f a -> f a |
2023-12-09 05:39:38 +0100 | <edwardk> | and another Divisible f => Day f f a -> f a |
2023-12-09 05:39:49 +0100 | <edwardk> | and another Decidable f => ... and another Alternative f => |
2023-12-09 05:40:16 +0100 | <edwardk> | now Decidable and Alternative aren't purely about the monoidal structure, there's some half-defined interaction with Divisible or Applicative |
2023-12-09 05:40:21 +0100 | [_] | (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
2023-12-09 05:40:29 +0100 | [_] | (~itchyjunk@user/itchyjunk/x-7353470) |
2023-12-09 05:40:43 +0100 | <edwardk> | :t liftA2 |
2023-12-09 05:40:44 +0100 | <lambdabot> | Applicative f => (a -> b -> c) -> f a -> f b -> f c |
2023-12-09 05:40:54 +0100 | <edwardk> | :t liftA2 . curry |
2023-12-09 05:40:55 +0100 | <lambdabot> | Applicative f => ((a, b) -> c) -> f a -> f b -> f c |
2023-12-09 05:41:09 +0100 | <edwardk> | looks a lot like the third 'Day' type i wrote above |
2023-12-09 05:42:03 +0100 | aforemny_ | (~aforemny@i59F516ED.versanet.de) |
2023-12-09 05:42:11 +0100 | <edwardk> | and you can write combinators to take each Day and provide associativity, and the mixture of arrows to/from the initial/terminal objects act as appropriate units for Day |
2023-12-09 05:42:52 +0100 | aforemny | (~aforemny@i59F516CC.versanet.de) (Ping timeout: 246 seconds) |
2023-12-09 05:42:53 +0100 | <edwardk> | i gave a talk at some point, let me find it |
2023-12-09 05:43:17 +0100 | <edwardk> | https://www.youtube.com/watch?v=cB8DapKQz-I here you go. Discrimination is Wrong. |
2023-12-09 05:46:32 +0100 | <iqubic> | That's really, really cool! |
2023-12-09 05:47:35 +0100 | <edwardk> | https://www.youtube.com/watch?v=cB8DapKQz-I&t=376s is the relevant section of the talk starting from the 'monads are monoids in the category of endofunctors' bit |
2023-12-09 05:48:49 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 255 seconds) |
2023-12-09 05:50:53 +0100 | iqubic | (~avi@2601:602:9502:c70:dd03:78c7:a43f:a269) (Remote host closed the connection) |
2023-12-09 05:58:23 +0100 | <ski> | ooh, I-Vars |
2023-12-09 06:01:20 +0100 | <edwardk> | https://hackage.haskell.org/package/discrimination-0.5/docs/Data-Discrimination-Grouping.html has my favorit Divisible/Decidable instances in haskell |
2023-12-09 06:02:03 +0100 | <edwardk> | at the end of that talk i call for help. well help didn't wind up coming forth and i had to solve the problem myself, which led to https://hackage.haskell.org/package/promises and that implementation of Grouping |
2023-12-09 06:02:11 +0100 | <ski> | @hackage ivar-simple |
2023-12-09 06:02:12 +0100 | <lambdabot> | https://hackage.haskell.org/package/ivar-simple |
2023-12-09 06:02:17 +0100 | <ski> | @hackage data-ivar |
2023-12-09 06:02:18 +0100 | <lambdabot> | https://hackage.haskell.org/package/data-ivar |
2023-12-09 06:02:23 +0100 | <edwardk> | i mention it because it has a fancier version of ivars than those ;) |
2023-12-09 06:02:47 +0100 | <ski> | yea, it looks a bit more elaborate, `ST'-style |
2023-12-09 06:03:19 +0100 | <edwardk> | it comes down to the observation that we have lazy and strict futures, but only strict promises |
2023-12-09 06:03:23 +0100 | <edwardk> | what would a lazy promise be? |
2023-12-09 06:04:01 +0100 | <edwardk> | a strict future rushes off and does something when you create it, and you block waiting for it. this is basically the birth of async/await style |
2023-12-09 06:04:10 +0100 | <edwardk> | a lazy future... well, we're haskellers. thunks |
2023-12-09 06:04:25 +0100 | <edwardk> | doesn't do squat until you start camping out waiting for it, then it does its work |
2023-12-09 06:04:50 +0100 | <ski> | "If you observe the demanded answer of this promise then either by the end of the current lazy computation we'll provide a \"real\" answer, or you'll get an error." -- meaning we'll block until the end of the `runLazy'/`runLazy_' ? |
2023-12-09 06:04:57 +0100 | <edwardk> | a promise is different than a future, despite being an implementation technique for the latter. given a 'future' i have a computation that will run and the last thing it gives will be the answer |
2023-12-09 06:05:27 +0100 | <edwardk> | but a promise is just something that someone will fulfill later and then you can unblock |
2023-12-09 06:05:34 +0100 | <edwardk> | it gets written to, ivar style |
2023-12-09 06:05:41 +0100 | trev | (~trev@user/trev) |
2023-12-09 06:05:51 +0100 | <edwardk> | but uh.. how do i tell the entire universe to stop and to run only when i need something? |
2023-12-09 06:05:59 +0100 | <edwardk> | i can't do that with an IO-based IVar |
2023-12-09 06:06:08 +0100 | <edwardk> | but i can make something that kind of works like a demand-driven ST |
2023-12-09 06:06:08 +0100 | <ski> | yea, a promise is more like a logic/dataflow variable |
2023-12-09 06:06:35 +0100 | sabino | (~sabino@user/sabino) (Ping timeout: 264 seconds) |
2023-12-09 06:06:45 +0100 | <edwardk> | where the computation that will produce the result of the IVar is known, it will write to the promise eventually, or reach the end in which case the promise goes unfulfilled (in my case often filling in with a default value) |
2023-12-09 06:07:02 +0100 | <edwardk> | and we can drive the ST-like computation forward right up until the promise is fulfilled and then put it back to bed |
2023-12-09 06:07:09 +0100 | <edwardk> | so 'lazy' promises can exist! |
2023-12-09 06:07:33 +0100 | <edwardk> | and they are needed in order to get the correct asymptotics for productive stable unordered discrimination in that talk |
2023-12-09 06:07:57 +0100 | <edwardk> | otherwise they take sorting from n log n to... something that is basically n^2, not to something effectively linear |
2023-12-09 06:08:15 +0100 | sabino | (~sabino@user/sabino) |
2023-12-09 06:08:16 +0100 | <edwardk> | er not sorting, producing equivalence classes in the order encountered |
2023-12-09 06:08:25 +0100 | <ski> | mhm .. don't quite get how this works, yet .. watching the talk might help |
2023-12-09 06:08:30 +0100 | <ski> | the `b' in `runLazy'/`runLazy_' is ignored, i suppose |
2023-12-09 06:08:42 +0100 | <edwardk> | but if each equivalence class produced had to sift through the inputs independently you'd spend O(n^2) time |
2023-12-09 06:08:46 +0100 | <edwardk> | yeah |
2023-12-09 06:09:07 +0100 | <edwardk> | you communicate with the outside world through promises and demands |
2023-12-09 06:09:33 +0100 | <edwardk> | runLazy_ $ \p -> do q <- promise_; p != "yay! " ++ demand q; q != "it works." =====> "yay! it works." |
2023-12-09 06:09:52 +0100 | <ski> | (first, i was thinking it was something like `newCyclicIdent :: (Ident a -> a) -> IO a', with `readIdent :: Ident a -> IO a',`instance Eq (Ident a)') |
2023-12-09 06:09:58 +0100 | <edwardk> | p is going to be the answer. and we can fulfill p partially, and leave in the middle of it a demand for yet another promise |
2023-12-09 06:10:28 +0100 | <edwardk> | then since this is 'ST-like' you can have STVars, etc. |
2023-12-09 06:10:49 +0100 | <ski> | what about nested ? |
2023-12-09 06:10:51 +0100 | <edwardk> | so it turns out the way to use the promises API is typically by making STvariables or arrays and the like and stuffing promises in them |
2023-12-09 06:10:55 +0100 | <edwardk> | they work fine |
2023-12-09 06:11:19 +0100 | <edwardk> | each promises is tied to the logical lazy st-like computation that will fulfill it |
2023-12-09 06:11:28 +0100 | <edwardk> | it may also choose to fulfill a bunch of other promises along the way |
2023-12-09 06:11:49 +0100 | <edwardk> | but when you demand a solution to one promise, you don't care if that program runs around like a doordasher fulfilling other people's orders too |
2023-12-09 06:12:09 +0100 | <ski> | hm, but the `s' in `Lazy' doesn't interact with the one in `ST', i suppose |
2023-12-09 06:12:40 +0100 | <edwardk> | well, it plays the exact same role |
2023-12-09 06:12:48 +0100 | ski | nods |
2023-12-09 06:13:06 +0100 | <edwardk> | it ensures it is only ever able to be fulfilled by the correct logical thread of execution |
2023-12-09 06:13:17 +0100 | <ski> | and if you fulfill a promise more than once ? |
2023-12-09 06:13:20 +0100 | <edwardk> | so i can suspend that thread until something needs a promise fulfilled |
2023-12-09 06:13:51 +0100 | <edwardk> | not here. this isn't lindsey kuper's version of ivars |
2023-12-09 06:14:06 +0100 | <edwardk> | in hers you can fulfill them multiple times so long as you always agree |
2023-12-09 06:14:32 +0100 | <edwardk> | but the problem there is safety and sanity require you to know how to compare the values you put in them for equality |
2023-12-09 06:14:45 +0100 | <edwardk> | and i can't do that all the time. the promise may be that i'll tell you a function or something |
2023-12-09 06:14:52 +0100 | <ski> | @hackage lvish |
2023-12-09 06:14:52 +0100 | <lambdabot> | https://hackage.haskell.org/package/lvish |
2023-12-09 06:14:53 +0100 | <ski> | yea |
2023-12-09 06:15:09 +0100 | <ski> | right |
2023-12-09 06:15:53 +0100 | <ski> | (you'd need unification .. Mercury throws a run-time exception, if you try to unify functions or predicates, iirc) |
2023-12-09 06:16:24 +0100 | <edwardk> | and in my case you'd have some pretty weird semantics. the first thing that fulfils is when i 'go back to sleep'. so if you ran to that point to answer a demand you'd ge the first result, but if someone fulfille it multiple times before you demanded a result of a particular promise somewhere you could get the second result! |
2023-12-09 06:17:09 +0100 | <ski> | (lambdaProlog does higher-order unification (incomplete) .. and its lambdas are weaker, no recursion at all, computation is done through predicates, not functions (which are more like quoted functions in MetaML/MetaOCaml)) |
2023-12-09 06:17:48 +0100 | <ski> | so, do you detect that ? |
2023-12-09 06:18:00 +0100 | <edwardk> | e.g. runLazy $ \p -> q <- promise_; r <- promise; p != (demand q, demand r); r != "hello"; r != "goodbye"; q != "testing" -- would produce ("testing","hello") -- if the second r != wasn't there. |
2023-12-09 06:18:14 +0100 | <edwardk> | and if you demanded the first half of the pair before the second |
2023-12-09 06:18:20 +0100 | mikess | (~sam@user/mikess) (Quit: leaving) |
2023-12-09 06:18:39 +0100 | <edwardk> | but if yuou demanded the second half of the pair before the first... you'd get ("testing","goodbye") ?! |
2023-12-09 06:19:00 +0100 | <edwardk> | well, i throw at yu if you try to fulfill a promise twice. |
2023-12-09 06:19:00 +0100 | <ski> | kinda like weird `unsafeInterleaveST' behaviour, i guess |
2023-12-09 06:19:06 +0100 | <ski> | ok |
2023-12-09 06:19:48 +0100 | <edwardk> | it dies because you go to put into an Mvar that has no other referent, so you get BlockedIndefinitelyOnMVar out of ghc |
2023-12-09 06:20:47 +0100 | <ski> | (hm, isn't there an monad for doing concurrent pipelines in the PCPH ? for some reason i'm reminded of that) |
2023-12-09 06:20:49 +0100 | <edwardk> | anyways you can view the Lazy s monad as a sort of super-powered but safe interleaveST |
2023-12-09 06:21:07 +0100 | <edwardk> | remember, i'm deliberately not progressing the pipeline until its demanded |
2023-12-09 06:21:12 +0100 | <edwardk> | otherwise its just a boring normal promise |
2023-12-09 06:21:15 +0100 | <edwardk> | like everyone else uses |
2023-12-09 06:21:20 +0100 | <ski> | "pipeline" here being ? |
2023-12-09 06:21:26 +0100 | <edwardk> | the computation |
2023-12-09 06:21:31 +0100 | <edwardk> | whatever you wrote in the Lazy monad |
2023-12-09 06:21:37 +0100 | <ski> | the sequence of `Lazy s' actions ? |
2023-12-09 06:21:39 +0100 | <ski> | ok |
2023-12-09 06:22:00 +0100 | <edwardk> | until you introspect the result of it, nothing happens. it gets triggered to advance when you implicitly demand the answer by looking at it |
2023-12-09 06:22:06 +0100 | <edwardk> | and then it runs through the chain until it is fulfilled |
2023-12-09 06:22:34 +0100 | <ski> | but it runs forwards, right ? |
2023-12-09 06:22:35 +0100 | <edwardk> | but along the way it may have set up other promises and used demands on those (as yet unfulfilled) promises as part of how it fulfilled the original promise, ike i did above |
2023-12-09 06:22:41 +0100 | <edwardk> | yes, until it files p != ... |
2023-12-09 06:22:43 +0100 | <edwardk> | er finds |
2023-12-09 06:22:52 +0100 | <ski> | (not like `ST.Lazy' .. or is there a version of it like that ?) |
2023-12-09 06:22:55 +0100 | <edwardk> | and then that becomes the answer. and then it stops |
2023-12-09 06:23:06 +0100 | <edwardk> | Lazy here is like ST.ReallyReallyLazy ;) |
2023-12-09 06:23:42 +0100 | <edwardk> | one way to think about it is ST is still kinda future'y |
2023-12-09 06:23:52 +0100 | <edwardk> | its only way to commmunicate with the outside world is through its result |
2023-12-09 06:23:55 +0100 | <ski> | i think someone had some example with `foo = do xs <- foo; ...; return (x:xs)', which "executed backwards" in lazy `ST' |
2023-12-09 06:24:01 +0100 | <edwardk> | but when you demand the result the whole action has to kinda happen |
2023-12-09 06:24:11 +0100 | <edwardk> | here i can kinda stop and take a nap |
2023-12-09 06:24:39 +0100 | <ski> | (there was a paste on <lpaste.net>, i believe) |
2023-12-09 06:24:53 +0100 | <edwardk> | you get similar results in lazy state |
2023-12-09 06:24:57 +0100 | <edwardk> | head recursion |
2023-12-09 06:25:06 +0100 | <edwardk> | and guards that don't stop you from launching missiles, etc. |
2023-12-09 06:25:43 +0100 | <edwardk> | foo = do foo; modify (1:) -- when exec'd produces an infinite stream of 1:'s in lazy state |
2023-12-09 06:25:56 +0100 | <ski> | right |
2023-12-09 06:26:03 +0100 | <edwardk> | but you'll note that this computation runs _forwards_ |
2023-12-09 06:26:08 +0100 | <edwardk> | but then stops and takes a nap |
2023-12-09 06:26:20 +0100 | <ski> | yes, that's what i was wondering about |
2023-12-09 06:27:24 +0100 | <monochrom> | Yes I posted ST.Lazy and State.Lazy examples like that on lpaste. Then lpaste died. :) |
2023-12-09 06:27:40 +0100 | <ski> | right, i thought it might've been you |
2023-12-09 06:28:13 +0100 | <edwardk> | the lazy state monad example is a general argument for why 'cont is the mother of all monads' doesn't hold in a lazy language |
2023-12-09 06:28:54 +0100 | <edwardk> | theres no cps'd lazy state |
2023-12-09 06:29:26 +0100 | <ski> | (e.g. my `links' file tells me "unsafeInterleavIO passing style" by monochrom in 2012-11-0[78] at <http://lpaste.net/77374>) |
2023-12-09 06:34:48 +0100 | <edwardk> | in any event the result of that promises lib is something that comes across like a form of laziness where you can tell other computations what their answers are in the process of finishing your own. whereas normal laziness forces you to er.. force the thunk and let it go work out its own answer, and it can't help you out until its done. |
2023-12-09 06:36:01 +0100 | <edwardk> | there should be a more elegant way to write it where its one thread of execution per runLazy call that blocks rather than this weird coroutine that kind of swaps over to whatever thread demands results from it, but that was the first version i came up with |
2023-12-09 06:37:10 +0100 | <edwardk> | it gets used in Grouping, because newtype Group a = Group { getGroup :: forall m b. PrimMonad m => (b -> m (b -> m ())) -> m (a -> b -> m ()) } lets the consumer pick the PrimMonad instance. and Lazy s is an instance of PrimMonad |
2023-12-09 06:37:11 +0100 | <ski> | mhm |
2023-12-09 06:37:19 +0100 | <ski> | when would that make a difference ? |
2023-12-09 06:37:37 +0100 | <edwardk> | might be faster, fewer constructors being allocated, etc. |
2023-12-09 06:37:40 +0100 | <edwardk> | more waiting on mvars |
2023-12-09 06:38:11 +0100 | <ski> | mhm |
2023-12-09 06:38:13 +0100 | <edwardk> | but then i'd have to explicitly fulfil all the defaulted versions at the end. |
2023-12-09 06:38:18 +0100 | <edwardk> | so maybe not a win |
2023-12-09 06:38:26 +0100 | <edwardk> | its on my list of 'ways to make discrimination faster' |
2023-12-09 06:38:28 +0100 | <ski> | and you have some consumer of `Group a' which picks `Lazy s' ? |
2023-12-09 06:38:35 +0100 | <edwardk> | yeah, several. |
2023-12-09 06:39:06 +0100 | <edwardk> | https://hackage.haskell.org/package/discrimination-0.5/docs/src/Data.Discrimination.Grouping.html#… |
2023-12-09 06:39:08 +0100 | <edwardk> | is the big one |
2023-12-09 06:39:19 +0100 | <edwardk> | it gives what looks like the API of 'Sorting' from Grouping |
2023-12-09 06:39:40 +0100 | <edwardk> | but also the nub replacement. |
2023-12-09 06:39:42 +0100 | <edwardk> | https://hackage.haskell.org/package/discrimination-0.5/docs/src/Data.Discrimination.Grouping.html#… |
2023-12-09 06:45:10 +0100 | <ski> | `MutVar's in `Lazy s' ? |
2023-12-09 06:48:55 +0100 | <ski> | hm, i think i kinda follow what `runGroup' is doing |
2023-12-09 06:56:39 +0100 | <edwardk> | its basically making a directory of equivalence classes it has seen so far and when new items come in they are being deposited into the right list one at a time |
2023-12-09 06:57:25 +0100 | <edwardk> | the individual instances are responsible for using each of those computations in the right way |
2023-12-09 06:57:42 +0100 | <ski> | it looks similar to `set-cdr!'ing the tail, doing TCMC |
2023-12-09 06:57:54 +0100 | <ski> | (except, lazy) |
2023-12-09 06:58:02 +0100 | <edwardk> | notice how nubWith looks like that given a lobotomy. the only thing that matters is the first thing in each equivalence class, which is emitted directly, then the action that is give back drops all the rest on the floor |
2023-12-09 07:00:05 +0100 | <edwardk> | but if you mapped head over the result of runGroup and fed it pairs of (a,a) values, it'd have the same demand profile, and that would be a valid (if inefficient) way to implement nub with the correct asymptotics |
2023-12-09 07:01:08 +0100 | <edwardk> | i just love how non-obvious of a contravariant functor Grouping is |
2023-12-09 07:01:17 +0100 | <ski> | hm, there's only one `:' in `nubWith', though, while there's two in `runGroup' ? |
2023-12-09 07:01:33 +0100 | <edwardk> | keep in mind the associativity |
2023-12-09 07:01:41 +0100 | <edwardk> | one is building a list of lists |
2023-12-09 07:01:43 +0100 | <edwardk> | one is building a list |
2023-12-09 07:01:59 +0100 | iqubic | (~avi@2601:602:9502:c70:5de0:aac0:2bec:3df) |
2023-12-09 07:01:59 +0100 | <edwardk> | one of those promises is for the member of the inner list it just made |
2023-12-09 07:02:09 +0100 | <edwardk> | the other is for the outer list to put more equivalance classes in place |
2023-12-09 07:02:17 +0100 | <ski> | yea, well, three actually. but i was only considering the ones for the inner lists |
2023-12-09 07:02:25 +0100 | <iqubic> | What are we talking about here now? |
2023-12-09 07:02:40 +0100 | <ski> | iqubic : last two links above |
2023-12-09 07:02:50 +0100 | <ski> | oh, sorry, you just joined |
2023-12-09 07:03:20 +0100 | <iqubic> | Yeah, my laptop died, so I had to wait for it to charge up enough to let me use it. |
2023-12-09 07:03:22 +0100 | <ski> | <https://hackage.haskell.org/package/discrimination-0.5/docs/Data-Discrimination-Grouping.html>,<https://hackage.haskell.org/package/discrimination-0.5/docs/src/Data.Discrimination.Grouping.html#…>,<https://hackage.haskell.org/package/discrimination-0.5/docs/src/Data.Discrimination.Grouping.html#…> |
2023-12-09 07:03:22 +0100 | <edwardk> | we're talking about my lazy promises library and the discrimination code linked above that uses it. https://hackage.haskell.org/package/discrimination-0.5/docs/src/Data.Discrimination.Grouping.html#… https://hackage.haskell.org/package/promises-0.3/docs/Data-Promise.html |
2023-12-09 07:03:48 +0100 | <edwardk> | Grouping there is an instance of Divisible and Decidable and all that jazz we were talking about earlier |
2023-12-09 07:04:03 +0100 | <edwardk> | and is the most complicated contravariant functor i've ever used in haskell in earnest |
2023-12-09 07:04:12 +0100 | <edwardk> | newtype Group a = Group { getGroup :: forall m b. PrimMonad m => (b -> m (b -> m ())) -> m (a -> b -> m ()) } |
2023-12-09 07:04:24 +0100 | <edwardk> | notice how the 'a' occurs in negative position |
2023-12-09 07:04:53 +0100 | <ski> | edwardk : afaiu the q' != b' : demand q'' is for the remaining elements of the inner list(s), while b : demand q is for the head, no ? |
2023-12-09 07:05:18 +0100 | <ski> | (hm, guess there could be some `NonEmpty' there) |
2023-12-09 07:05:41 +0100 | <edwardk> | yeah it could be a NonEmpty inside the outer list |
2023-12-09 07:05:49 +0100 | <edwardk> | i think this might predate my NonEmpty type |
2023-12-09 07:05:52 +0100 | <edwardk> | maybe nt |
2023-12-09 07:05:54 +0100 | <edwardk> | er not |
2023-12-09 07:06:37 +0100 | <ski> | so, then i'm wondering why `nubWith' only has one `:' |
2023-12-09 07:06:38 +0100 | <edwardk> | guess not |
2023-12-09 07:06:46 +0100 | <edwardk> | :t nub |
2023-12-09 07:06:47 +0100 | <lambdabot> | Eq a => [a] -> [a] |
2023-12-09 07:06:56 +0100 | <edwardk> | :t nubBy |
2023-12-09 07:06:57 +0100 | <lambdabot> | (a -> a -> Bool) -> [a] -> [a] |
2023-12-09 07:07:04 +0100 | <ski> | .. oh, actually, i'm dense |
2023-12-09 07:07:18 +0100 | <edwardk> | :t nub . on (==) |
2023-12-09 07:07:19 +0100 | <lambdabot> | error: |
2023-12-09 07:07:19 +0100 | <lambdabot> | • Couldn't match type ‘a -> a -> Bool’ with ‘[a2]’ |
2023-12-09 07:07:19 +0100 | <lambdabot> | Expected type: (a -> a1) -> [a2] |
2023-12-09 07:07:29 +0100 | <edwardk> | :t nubBy . on (==) |
2023-12-09 07:07:30 +0100 | <lambdabot> | Eq a1 => (a2 -> a1) -> [a2] -> [a2] |
2023-12-09 07:07:31 +0100 | <ski> | ah, so the `_' is for skipping all the others |
2023-12-09 07:07:36 +0100 | <edwardk> | thats what i wanted |
2023-12-09 07:07:37 +0100 | <edwardk> | yeah |
2023-12-09 07:07:43 +0100 | <ski> | right, now it makes sense |
2023-12-09 07:08:00 +0100 | <ski> | (sorry, brain fart) |
2023-12-09 07:08:19 +0100 | <edwardk> | (b -> m (b -> m ())) -- is the computation that takes the first b used to establish an equivalence class, and gives back (after side effects) the way to consume more members of that same class |
2023-12-09 07:08:34 +0100 | <edwardk> | so in the general discrimination approach this becomes the stuff we cram in our buckets |
2023-12-09 07:08:35 +0100 | <ski> | yep, i figured |
2023-12-09 07:09:03 +0100 | <ski> | (didn't check the code that actually does that, but figured it must be something like that) |
2023-12-09 07:09:17 +0100 | <edwardk> | so the job of Group a is to take that and after some initial setup, give you something that you can feed a,b pairs to |
2023-12-09 07:09:38 +0100 | <edwardk> | and you can keep feeding me those pairs indefinitely, but if you stop the lazy computation runs out |
2023-12-09 07:09:50 +0100 | <edwardk> | and then i can know to fill in the default value for each of those promises (aka []) |
2023-12-09 07:09:59 +0100 | <ski> | "initial setup" being the first `m' in `m (a -> b -> m ())' |
2023-12-09 07:10:01 +0100 | <edwardk> | otherwise we block and keep running through the input |
2023-12-09 07:10:03 +0100 | <edwardk> | yep! |
2023-12-09 07:10:23 +0100 | <ski> | (figured that too, when looking at the code a bit) |
2023-12-09 07:10:28 +0100 | <edwardk> | it took me like 2-3 months to figure out how to write this type |
2023-12-09 07:11:04 +0100 | <ski> | i see why you wanted defaults, now |
2023-12-09 07:11:21 +0100 | rosco | (~rosco@175.136.152.56) |
2023-12-09 07:11:36 +0100 | <edwardk> | otherwise i'd have to track every created promise and whether i'd fulfilled it, and fulfill all the unfulfilled ones at the end with [] |
2023-12-09 07:11:55 +0100 | <ski> | mm |
2023-12-09 07:12:07 +0100 | wice | (~wice@176.254.244.83) |
2023-12-09 07:12:25 +0100 | <ski> | so you keep track of whether the value is a default value, or an explicitly provided value |
2023-12-09 07:12:55 +0100 | <edwardk> | idk why whenever i'm about to get on a plane to go to a conference where i'm going to be entertaining a bunch of folks, i stay up super late on irc chatting all night ;) |
2023-12-09 07:13:02 +0100 | igemnace | (~ian@user/igemnace) (Read error: Connection reset by peer) |
2023-12-09 07:13:07 +0100 | <ski> | hehee |
2023-12-09 07:13:08 +0100 | <edwardk> | i'm somewhat self-destructive that way i guess |
2023-12-09 07:13:29 +0100 | <ski> | well, it's fun to chat about such things :) |
2023-12-09 07:13:39 +0100 | <edwardk> | guessing its not a common destination for haskell folks, but is anybody going to be at NeurIPS this week? |
2023-12-09 07:14:44 +0100 | <edwardk> | i'm leaving my new fish all on their own (with my niece to take care of them) and going to go pal around with folks and they don't even write haskell. its a tragedy |
2023-12-09 07:15:20 +0100 | <edwardk> | they being the people not the fish. well both the people and the fish. neither writes haskell yet. |
2023-12-09 07:15:25 +0100 | <int-e> | . o O ( I bet the fish won't care. ) |
2023-12-09 07:16:30 +0100 | harveypwca | (~harveypwc@2601:246:c280:7940:585a:99af:3e4c:209b) |
2023-12-09 07:17:12 +0100 | <edwardk> | but look at those eyes https://usercontent.irccloud-cdn.com/file/H5mxhvEx/sirius-eyes.png |
2023-12-09 07:17:27 +0100 | <edwardk> | he can guilt with the best of them |
2023-12-09 07:18:14 +0100 | <ski> | "ok, check to make sure we haven't been satisfied in the meantime" <https://hackage.haskell.org/package/promises-0.3/docs/src/Data-Promise.html> -- this makes me wonder whether there might be any inefficiency problems a la SRFI 45 <https://srfi.schemers.org/srfi-45/srfi-45.html> was solving |
2023-12-09 07:20:13 +0100 | <edwardk> | i think those have rather different semantics than what i capture here. lazy there is about setting up an eager way to fulfil the computation, np? |
2023-12-09 07:20:16 +0100 | <edwardk> | er no? |
2023-12-09 07:21:06 +0100 | <edwardk> | er not quite |
2023-12-09 07:21:36 +0100 | <ski> | it's about not building up `(force (delay (force (delay ...))))' sequences that all wait to update their mutable cell, growing space unboundedly |
2023-12-09 07:21:40 +0100 | <edwardk> | yeah |
2023-12-09 07:21:42 +0100 | <iqubic> | I think you need Klesli arrows for fish. |
2023-12-09 07:21:50 +0100 | <iqubic> | :t (>=>) |
2023-12-09 07:21:51 +0100 | <lambdabot> | Monad m => (a -> m b) -> (b -> m c) -> a -> m c |
2023-12-09 07:22:14 +0100 | <iqubic> | Sorry, that's a really bad joke. |
2023-12-09 07:22:31 +0100 | <ski> | (e.g. for a lazy `filter' on streams, where few elements satisfy the predicate) |
2023-12-09 07:22:41 +0100 | <edwardk> | but that looks like a normal bony fish. he's cartilaginous. he looks more like ---_===_ |
2023-12-09 07:23:15 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2023-12-09 07:23:17 +0100 | <edwardk> | yeah i can see how that'd build up delay/force chains |
2023-12-09 07:23:29 +0100 | <ski> | val lazy : (unit -> 'a susp) -> 'a susp |
2023-12-09 07:23:34 +0100 | <ski> | in ML terms |
2023-12-09 07:23:41 +0100 | <ski> | taking that as primitive, instead of |
2023-12-09 07:23:44 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2023-12-09 07:23:46 +0100 | <edwardk> | i guess if you constantly did stuff like x <- promise_; y != demand x; ... as a way to delay a computation you'd hit this |
2023-12-09 07:23:48 +0100 | <ski> | val delay : (unit -> 'a) -> 'a susp |
2023-12-09 07:24:17 +0100 | <iqubic> | AI has corrupted my brain. I can only read ML as "Machine Learning" |
2023-12-09 07:24:20 +0100 | <edwardk> | but here since they are promises, not thunks, you can just pass off one such promise as another. |
2023-12-09 07:24:37 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2023-12-09 07:24:47 +0100 | <edwardk> | iqubic: it has been a rough few years in that regard |
2023-12-09 07:24:57 +0100 | <iqubic> | I'm sure. |
2023-12-09 07:25:30 +0100 | <edwardk> | "I'm going to go show off my shiny new ML hardware at the conference. Jane Street will be there." If I said that 5 years ago, I'd have meant something completely different. |
2023-12-09 07:25:52 +0100 | <edwardk> | but as it is I'm going to go show off my shiny new ML hardware at NeurIPS and Jane Street will indeed be there. ;) |
2023-12-09 07:26:11 +0100 | <ski> | .. and they'll be using an ML to program it ? |
2023-12-09 07:26:23 +0100 | <edwardk> | they are more than welcome to |
2023-12-09 07:26:58 +0100 | <ski> | hm, this is related to, i think some Groq (?) talk you held ? |
2023-12-09 07:27:13 +0100 | <edwardk> | oh man, i should use more haskell for Positron and then try to sell a bunch of hw to jane street just to watch Yaron scowl at me. |
2023-12-09 07:27:47 +0100 | <edwardk> | Nah. I left Groq in March and started a new company (Positron) |
2023-12-09 07:28:02 +0100 | <ski> | ah, ic |
2023-12-09 07:29:08 +0100 | <ski> | (thinking of "Reinventing Compilers for AI - - GroqDay December 2021" <https://www.youtube.com/watch?v=upljocX5mrk> and "Stanford Seminar - Dataflow for convergence of AI and HPC - GroqChip!" <https://www.youtube.com/watch?v=kPUxl00xys4>) |
2023-12-09 07:29:17 +0100 | igemnace | (~ian@user/igemnace) |
2023-12-09 07:29:25 +0100 | <edwardk> | basically we're focused on how to get more performance per dollar in the LLM (and mixed media model) space |
2023-12-09 07:29:54 +0100 | <edwardk> | Groq makes an interesting chip. It is the only real attempt to do determinism on that scale. |
2023-12-09 07:30:09 +0100 | <edwardk> | I just don't think there's a good product market fit. |
2023-12-09 07:30:23 +0100 | <edwardk> | and its about what, 6-7 years old now? |
2023-12-09 07:31:56 +0100 | <edwardk> | We'll be at NeurIPS taking preorders for Positron systems, and talking about our software stack. Big expo booth and everything. |
2023-12-09 07:32:08 +0100 | <edwardk> | Completely different architecture and constraints than Groq. |
2023-12-09 07:32:57 +0100 | <ski> | getting more performance, in which ways ? |
2023-12-09 07:33:26 +0100 | <edwardk> | In many ways its a harder problem, because I embrace the bits of non-determinism required to handle all the external memory architecture designs that are out there, but then manage all the processing internally in a smarter way, by replacing a traditioal cache with something fit for purpose. |
2023-12-09 07:33:48 +0100 | <iqubic> | What is Positron? |
2023-12-09 07:33:54 +0100 | <edwardk> | But doing that means knowing a lot of statistics on refresh rates. |
2023-12-09 07:34:01 +0100 | <ski> | <edwardk> Nah. I left Groq in March and started a new company (Positron) |
2023-12-09 07:34:34 +0100 | <edwardk> | A fabless semiconductor company I started with Thomas Sohmers back at the start of April. |
2023-12-09 07:34:56 +0100 | <iqubic> | Are there any people doing machine learning in Haskell? |
2023-12-09 07:35:26 +0100 | <edwardk> | We do machine learning, and a significant cross-section of the team likes haskell, but right now its a bit lower level than that |
2023-12-09 07:35:41 +0100 | <edwardk> | I used a fair bit of Haskell to prototype out designs |
2023-12-09 07:35:57 +0100 | <iqubic> | That's fair. |
2023-12-09 07:36:20 +0100 | <edwardk> | The company is something close to a 50/50 mix of hardware/software |
2023-12-09 07:36:39 +0100 | <edwardk> | needs to be to drink from the firehose of ML development |
2023-12-09 07:37:57 +0100 | <edwardk> | we'll actually be selling hardware at neurips. so wish me luck |
2023-12-09 07:38:09 +0100 | <edwardk> | i have to keep Sirius (the stingray above) in clams. |
2023-12-09 07:38:22 +0100 | <ski> | clams ? |
2023-12-09 07:38:35 +0100 | <ski> | it eats clams ? |
2023-12-09 07:38:47 +0100 | <edwardk> | he eats clams, bloodworm, general whitefish, occasional jumbo shrimp, krill, whatever |
2023-12-09 07:38:50 +0100 | <edwardk> | he eats a lot |
2023-12-09 07:39:04 +0100 | <edwardk> | but his favorite is either clams or huge bricks of frozen bloodworms |
2023-12-09 07:39:20 +0100 | phma | (phma@2001:5b0:211f:f418:cffc:74b5:153b:99d9) (Read error: Connection reset by peer) |
2023-12-09 07:39:25 +0100 | <ski> | hm, how wide is he ? (cm ?) |
2023-12-09 07:39:44 +0100 | <edwardk> | the clams he actually backs up, burrows out an area in the aquarium where he can hit the glass on the bottom, and then smashes the clams on the bottom glass until the meat is out (i hand them to him half frozen) |
2023-12-09 07:39:58 +0100 | <edwardk> | about a ft around the disc. so er.. 30cm? |
2023-12-09 07:40:16 +0100 | <int-e> | > 2.54*12 |
2023-12-09 07:40:18 +0100 | <lambdabot> | 30.48 |
2023-12-09 07:40:18 +0100 | <edwardk> | plus another several inches of tail + stinger |
2023-12-09 07:40:18 +0100 | <ski> | mm. pretty big (for an aquarium fish) |
2023-12-09 07:40:20 +0100 | phma | (phma@2001:5b0:210f:7288:e7e3:fefd:fd87:d9a3) |
2023-12-09 07:40:32 +0100 | <edwardk> | he's in 300 gallon + aquarium |
2023-12-09 07:40:50 +0100 | <edwardk> | ~1135 liters |
2023-12-09 07:41:00 +0100 | <edwardk> | 8 ft long. its huge |
2023-12-09 07:41:19 +0100 | <edwardk> | https://usercontent.irccloud-cdn.com/file/mzXmviBL/i-am-the-night.mp4 |
2023-12-09 07:42:02 +0100 | ski | 's reminded of old Gaston comic, installing (dripping) ceiling aquariums all across the (comics) office, with circular tunnels between them, all for his goldfish to get more space to explore |
2023-12-09 07:42:15 +0100 | <xerox> | what's the acquarium's background from? |
2023-12-09 07:42:30 +0100 | <edwardk> | hah. that sounds like something that would be impossible to clean. the person who had that dream never had to clean a fish tank |
2023-12-09 07:42:46 +0100 | <edwardk> | its an underwater downed plane. and one of the reasons why i got so large an aquarium |
2023-12-09 07:43:14 +0100 | <iqubic> | Those are some cute fish! |
2023-12-09 07:43:24 +0100 | <edwardk> | i needed about 150 gallons to take in a bunch of koi from the backyard that were born way out of season. but it was going to take 8 weeks to get the tank made, 2-4 weeks to ship + 4 weeks or more to cycle it and they'd be frozen to death by then |
2023-12-09 07:43:58 +0100 | <edwardk> | so i reached out to the custom aquarium place and they had one they had made for someone else but he couldnt take possession of it (too big to ship to a residential address!) and it had made a bunch of odd choices. |
2023-12-09 07:44:16 +0100 | <edwardk> | namely the plane background, and a oversized sump underneath for saltwater fish, etc. |
2023-12-09 07:44:34 +0100 | <edwardk> | but i could get it without 8 weeks worth of extra lead time.. it was just 2x the size i wanted |
2023-12-09 07:44:53 +0100 | <edwardk> | so now the 18 or so koi that were born late in my pond can survive the winter indoors in the aquarium |
2023-12-09 07:45:28 +0100 | <edwardk> | and they've been joined by Sirius, who was languishing in far too small a tank at the local fish store for like 3 years and is a bit stunted. (he should be about twice as big around at this age!) |
2023-12-09 07:45:45 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) |
2023-12-09 07:46:23 +0100 | <xerox> | lovely creature |
2023-12-09 07:46:24 +0100 | <edwardk> | and i added a bunch of other cleaner fish and some weather loaches to give some color and keep the tank clean, and planted the tank because thats a lot of dirty fish |
2023-12-09 07:46:31 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2023-12-09 07:46:36 +0100 | <ski> | (hm, can't seem to find any image from that story) |
2023-12-09 07:47:15 +0100 | <edwardk> | so now its him, 18 koi, 9 weather loaches, 8 siamese algae eaters, and a couple of feeder guppies that snuck in with about 70+ shrimp. the shrimp are down to maybe a dozen or so of the wiliest ones |
2023-12-09 07:48:12 +0100 | <edwardk> | given the koi will be 30cm+ in a year, the loaches will be 30cm+ in a year, the SAEs will get to be 6 inches... a lot of fish are going elsewhere soon. the bulk of the koi are headed out to the pond in the spring |
2023-12-09 07:48:23 +0100 | <iqubic> | Are you worried that any of your fish will eat the other fish? |
2023-12-09 07:48:32 +0100 | <edwardk> | they are all selected to avoid that |
2023-12-09 07:48:44 +0100 | stefan-_- | (~cri@42dots.de) (Read error: Connection reset by peer) |
2023-12-09 07:48:44 +0100 | trev | (~trev@user/trev) (Read error: Connection reset by peer) |
2023-12-09 07:48:44 +0100 | Lears | (~Leary]@user/Leary/x-0910699) (Write error: Connection reset by peer) |
2023-12-09 07:48:45 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (*.net *.split) |
2023-12-09 07:48:45 +0100 | sabino | (~sabino@user/sabino) (*.net *.split) |
2023-12-09 07:48:45 +0100 | lg188 | (~lg188@82.18.98.230) (*.net *.split) |
2023-12-09 07:48:45 +0100 | qqq | (~qqq@92.43.167.61) (*.net *.split) |
2023-12-09 07:48:45 +0100 | Sgeo | (~Sgeo@user/sgeo) (*.net *.split) |
2023-12-09 07:48:45 +0100 | haskellbridge | (~haskellbr@069-135-003-034.biz.spectrum.com) (*.net *.split) |
2023-12-09 07:48:45 +0100 | actioninja | (~actioninj@user/actioninja) (*.net *.split) |
2023-12-09 07:48:45 +0100 | nitrix | (~nitrix@user/nitrix) (*.net *.split) |
2023-12-09 07:48:45 +0100 | mobivme | (~mobivme@112.201.111.217) (*.net *.split) |
2023-12-09 07:48:45 +0100 | telser_ | (~quassel@user/telser) (*.net *.split) |
2023-12-09 07:48:46 +0100 | tessier | (~treed@ec2-184-72-149-67.compute-1.amazonaws.com) (*.net *.split) |
2023-12-09 07:48:46 +0100 | hamess | (~hamess@user/hamess) (*.net *.split) |
2023-12-09 07:48:46 +0100 | np | (~nerdypepp@user/nerdypepper) (*.net *.split) |
2023-12-09 07:48:46 +0100 | TMA | (tma@twin.jikos.cz) (*.net *.split) |
2023-12-09 07:48:46 +0100 | jjhoo | (~jahakala@user/jjhoo) (*.net *.split) |
2023-12-09 07:48:46 +0100 | dolio | (~dolio@130.44.134.54) (*.net *.split) |
2023-12-09 07:48:46 +0100 | koz | (~koz@121.99.240.58) (*.net *.split) |
2023-12-09 07:48:46 +0100 | xxpor | (~xxpor@user/xxpor) (*.net *.split) |
2023-12-09 07:48:46 +0100 | elkcl | (~elkcl@broadband-95-84-226-240.ip.moscow.rt.ru) (*.net *.split) |
2023-12-09 07:48:46 +0100 | tomku | (~tomku@user/tomku) (*.net *.split) |
2023-12-09 07:48:46 +0100 | swistak | (~swistak@185.21.216.141) (*.net *.split) |
2023-12-09 07:48:46 +0100 | qhong | (~qhong@rescomp-21-400677.stanford.edu) (*.net *.split) |
2023-12-09 07:48:47 +0100 | andjjj23_ | (~irc@107.170.228.47) (*.net *.split) |
2023-12-09 07:48:47 +0100 | bliminse | (~bliminse@user/bliminse) (*.net *.split) |
2023-12-09 07:48:47 +0100 | motherfsck | (~motherfsc@user/motherfsck) (*.net *.split) |
2023-12-09 07:48:47 +0100 | TheCatCollective | (NyaaTheKit@user/calculuscat) (*.net *.split) |
2023-12-09 07:48:47 +0100 | Logio | (em@kapsi.fi) (*.net *.split) |
2023-12-09 07:48:47 +0100 | leeb | (~leeb@tk2-243-31079.vs.sakura.ne.jp) (*.net *.split) |
2023-12-09 07:48:47 +0100 | benmachine | (bm380@pip.srcf.societies.cam.ac.uk) (*.net *.split) |
2023-12-09 07:48:55 +0100 | Logio | (em@kapsi.fi) |
2023-12-09 07:48:58 +0100 | <edwardk> | the weather loaches are longer than the koi are now, but are narrow. and are generally peaceful. so they won't fit down the koi's gullets. |
2023-12-09 07:48:59 +0100 | stefan-_ | (~cri@42dots.de) |
2023-12-09 07:49:00 +0100 | [Leary] | (~Leary]@user/Leary/x-0910699) |
2023-12-09 07:49:01 +0100 | telser | (~quassel@user/telser) |
2023-12-09 07:49:02 +0100 | dolio | (~dolio@130.44.134.54) |
2023-12-09 07:49:04 +0100 | koz | (~koz@121.99.240.58) |
2023-12-09 07:49:04 +0100 | swistak | (~swistak@185.21.216.141) |
2023-12-09 07:49:05 +0100 | <edwardk> | and the koi don't have teeth to nip them |
2023-12-09 07:49:07 +0100 | trev | (~trev@user/trev) |
2023-12-09 07:49:08 +0100 | hamess | (~hamess@user/hamess) |
2023-12-09 07:49:10 +0100 | motherfsck | (~motherfsc@user/motherfsck) |
2023-12-09 07:49:11 +0100 | qqq | (~qqq@92.43.167.61) |
2023-12-09 07:49:12 +0100 | sabino | (~sabino@user/sabino) |
2023-12-09 07:49:20 +0100 | xxpor | (~xxpor@user/xxpor) |
2023-12-09 07:49:21 +0100 | elkcl | (~elkcl@broadband-95-84-226-240.ip.moscow.rt.ru) |
2023-12-09 07:49:23 +0100 | andjjj23_ | (~irc@107.170.228.47) |
2023-12-09 07:49:27 +0100 | qhong | (~qhong@rescomp-21-400677.stanford.edu) |
2023-12-09 07:49:29 +0100 | <edwardk> | so the loaches can't eat the koi now, and when the sizes invert won't be eaten in turn |
2023-12-09 07:49:31 +0100 | actioninja | (~actioninj@user/actioninja) |
2023-12-09 07:49:33 +0100 | jjhoo | (~jahakala@user/jjhoo) |
2023-12-09 07:49:34 +0100 | bliminse | (~bliminse@user/bliminse) |
2023-12-09 07:49:37 +0100 | Sgeo | (~Sgeo@user/sgeo) |
2023-12-09 07:49:43 +0100 | <iqubic> | I see. |
2023-12-09 07:49:46 +0100 | nerdypepper | (~nerdypepp@user/nerdypepper) |
2023-12-09 07:49:46 +0100 | <edwardk> | the SAEs are stupidly fast and will be big enough to avoid problems |
2023-12-09 07:49:54 +0100 | haskellbridge | (~haskellbr@069-135-003-034.biz.spectrum.com) |
2023-12-09 07:49:54 +0100 | ChanServ | +v haskellbridge |
2023-12-09 07:50:02 +0100 | mobivme | (~mobivme@112.201.111.217) |
2023-12-09 07:50:12 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 252 seconds) |
2023-12-09 07:50:21 +0100 | leeb | (~leeb@tk2-243-31079.vs.sakura.ne.jp) |
2023-12-09 07:50:37 +0100 | <edwardk> | the closest thing to a risk is that the loaches kind of don't care about contact. and will just come right up into my hand when i feed them etc. and in general lounge around on sirius when he's eating, and will even try to dart under him to steal bloodworms and the like. and i keep expecting one to get eaten |
2023-12-09 07:50:49 +0100 | <edwardk> | but when they are bigger than risk will go to zero |
2023-12-09 07:51:00 +0100 | <edwardk> | and they have _some_ modicum of self-preservation |
2023-12-09 07:51:21 +0100 | <edwardk> | i've been planning on adding a couple of high-fin banded sharks to the mix (technically they are loaches, not actual sharks) |
2023-12-09 07:52:01 +0100 | <edwardk> | because they can go outside with the koi when spring comes. and with the koi pond remodel i'm doing they'll have time and space to get to full size (1m+) |
2023-12-09 07:52:33 +0100 | ski | . o O ( <https://justacarguy.blogspot.com/2017/10/gaston-lagaffe-most-famous-blunderer-in.html> ) |
2023-12-09 07:53:29 +0100 | <ski> | and next winter ? |
2023-12-09 07:53:39 +0100 | <edwardk> | they'll be fine. they can handle michigan winters |
2023-12-09 07:53:55 +0100 | <iqubic> | I'm gonna go get some dinner. I appreciate y'all being so nice to a trans woman like me. |
2023-12-09 07:53:58 +0100 | TMA | (tma@twin.jikos.cz) |
2023-12-09 07:54:01 +0100 | <edwardk> | the problem with these guys is the big koi in the back are like 2ft+ long and as fry they would have fit right in their mouths. |
2023-12-09 07:54:06 +0100 | analoq | (~yashi@user/dies) (Ping timeout: 245 seconds) |
2023-12-09 07:54:06 +0100 | tomku | (~tomku@user/tomku) |
2023-12-09 07:54:07 +0100 | tessier | (~treed@ec2-184-72-149-67.compute-1.amazonaws.com) |
2023-12-09 07:54:19 +0100 | <edwardk> | koi will eat anything that fits in their mouth, including koi |
2023-12-09 07:54:38 +0100 | lg1882 | (~lg188@82.18.98.230) |
2023-12-09 07:54:38 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2023-12-09 07:54:38 +0100 | lg188 | (~lg188@82.18.98.230) |
2023-12-09 07:54:38 +0100 | benmachine | (bm380@pip.srcf.societies.cam.ac.uk) |
2023-12-09 07:54:49 +0100 | lg188 | (~lg188@82.18.98.230) (Ping timeout: 255 seconds) |
2023-12-09 07:55:06 +0100 | <edwardk> | so the fact that they were born so late in the year meant i had a problem. i couldn't put them in the main pond without getting them eaten, and i couldn't net off an area in the pond to keep them safe, because it'd be too shallow for them to be able to winter. |
2023-12-09 07:55:16 +0100 | <edwardk> | so a gigantic aquarium plan was born |
2023-12-09 07:55:40 +0100 | nitrix | (~nitrix@user/nitrix) |
2023-12-09 07:55:54 +0100 | <edwardk> | but now i have a stingray who may decide he's not so stunted after all and may balloon up to 60cm around. whereupon i'll have to build an even bigger aquarium (since he can't go outside) |
2023-12-09 07:56:02 +0100 | analoq | (~yashi@user/dies) |
2023-12-09 07:56:08 +0100 | <iqubic> | We need more women in the Haskell world. Well, I'm trans, but I still think that counts. |
2023-12-09 07:56:09 +0100 | <ski> | ah, the cold itself wasn't the problem, but the lack of depth |
2023-12-09 07:56:30 +0100 | <edwardk> | iqubic: agreed on both fronts |
2023-12-09 07:56:50 +0100 | <iqubic> | Thank you for being so supportive of me! |
2023-12-09 07:56:52 +0100 | <edwardk> | well lack of depth was going to make the cold a problem for them if i netted off a region in the main pond |
2023-12-09 07:57:29 +0100 | <edwardk> | but i could put loaches, koi and high-fin banded sharks all in a pond without problem. they can all survive my temperatures here |
2023-12-09 07:57:41 +0100 | ski | nods |
2023-12-09 07:58:59 +0100 | <edwardk> | the stingray was basically aquired after our oldest koi (28 years old!) passed away a couple weeks ago. =( |
2023-12-09 07:59:36 +0100 | <edwardk> | my niece had grown attached to him (as had we all), and sirius gave her something to pay attention to that needed a lot of attention instead |
2023-12-09 07:59:44 +0100 | <edwardk> | kind of like grieving a dog by getting a puppy |
2023-12-09 08:00:14 +0100 | <edwardk> | and for me its been an exercise in high tech. |
2023-12-09 08:00:34 +0100 | <ski> | how old's the stingray ? |
2023-12-09 08:01:39 +0100 | <ski> | oh, you said "who was languishing in far too small a tank at the local fish store for like 3 years and is a bit stunted" |
2023-12-09 08:01:48 +0100 | <edwardk> | how much can i automate the tank? automatic water changes. custom ozone dosing system balanced by an ORP sensor, a huge amount of UV filtration, a sump with a saltwater style refugium to both add water mass and a place for nitrates to go, planting the tanks to sink more nitrates, jerry-rigging a saltwater skimmer with ozone so it can foam fresh water to take out heavy particulates, getting reverse osmosis setup to clean up the incoming |
2023-12-09 08:01:48 +0100 | <edwardk> | water.. |
2023-12-09 08:01:57 +0100 | <edwardk> | yeah, he's about 3-4 years old |
2023-12-09 08:02:12 +0100 | <edwardk> | life expectancy about 19 years |
2023-12-09 08:02:22 +0100 | peterbecich1 | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2023-12-09 08:02:26 +0100 | <edwardk> | koi and loaches are also a 20+ year life expectancy |
2023-12-09 08:02:44 +0100 | <ski> | "planting" ? |
2023-12-09 08:02:47 +0100 | <edwardk> | SAEs about 10 years old |
2023-12-09 08:03:03 +0100 | <edwardk> | put down a layer of soil, then a layer of sand, then put actual plants in the water |
2023-12-09 08:03:11 +0100 | <ski> | ah |
2023-12-09 08:03:46 +0100 | lg1882 | (~lg188@82.18.98.230) (Read error: Connection reset by peer) |
2023-12-09 08:04:06 +0100 | lg1882 | (~lg188@82.18.98.230) |
2023-12-09 08:04:16 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 255 seconds) |
2023-12-09 08:04:17 +0100 | peterbecich1 | peterbecich |
2023-12-09 08:04:17 +0100 | benmachine | (bm380@pip.srcf.societies.cam.ac.uk) (Read error: Connection reset by peer) |
2023-12-09 08:04:21 +0100 | <edwardk> | added soething like 4800gph worth of powerheads (lateral waterflow) 3600gph of actual water movement, so i'm turning over the water about 16x per hour _in_ the tank, and about 12x per hour down to the sump below the tank where there's a bunch of filtration, biological media, other plants/algae that are less sightly in a side tank that breeds copepods and daphnia for snacks |
2023-12-09 08:04:27 +0100 | benmachine | (bm380@pip.srcf.societies.cam.ac.uk) |
2023-12-09 08:04:37 +0100 | <edwardk> | that refugium then trickle feeds back into the main tank |
2023-12-09 08:05:21 +0100 | <edwardk> | and another 800gph of uv filtration, then dosing ozone and co2 into the main tank to keep the fish and plants happy respectively |
2023-12-09 08:06:13 +0100 | gdown | (~gavin@h69-11-149-109.kndrid.broadband.dynamic.tds.net) (Remote host closed the connection) |
2023-12-09 08:06:26 +0100 | <edwardk> | the ozone oxidizes stuff in the water to keep the water column clean and is tuned down to where it won't make a bunch of hydrogen peroxide and kill my fish and won't _quite_ kill off all main tank algae/diatoms, and the co2 is tuned up high enough that plants can survive a bunch of fish that historically are considered very very bad for plants |
2023-12-09 08:07:12 +0100 | <edwardk> | i have to run that because the koi would otherwise just root up my plants and toss them everywhere, so it lets them have a strong enough root system to survive and a fast enough growth rate to not just die off when the leaves get nibbled. |
2023-12-09 08:07:44 +0100 | <edwardk> | i'd have covered the entire bed of the tank in carpeting plants, but sirius naps in the sand |
2023-12-09 08:07:57 +0100 | <edwardk> | sorry for the long fishy tangent |
2023-12-09 08:08:35 +0100 | <edwardk> | getting the aquarium home https://usercontent.irccloud-cdn.com/file/wTAFJq8x/aquarium-6.jpg https://usercontent.irccloud-cdn.com/file/YbzYbPiR/aquarium-7.jpg https://usercontent.irccloud-cdn.com/file/w30O1IOq/aquarium-8.jpg |
2023-12-09 08:08:45 +0100 | <ski> | nah, it's interesting |
2023-12-09 08:08:49 +0100 | <edwardk> | but you can see in those photos, getting the aquarium home was a monster job. |
2023-12-09 08:09:11 +0100 | <edwardk> | a 1 ton package we had to pick up on a flatbed, and offload with a tracked hi-lo |
2023-12-09 08:09:24 +0100 | <edwardk> | (garage for scale!) |
2023-12-09 08:09:28 +0100 | <ski> | big-ass container |
2023-12-09 08:10:05 +0100 | <xerox> | taller than the skid steer |
2023-12-09 08:10:13 +0100 | <edwardk> | yeah |
2023-12-09 08:10:30 +0100 | igemnace | (~ian@user/igemnace) (Quit: WeeChat 4.1.2) |
2023-12-09 08:10:33 +0100 | <edwardk> | was terrifying unloading that sucker with just me and my nephew |
2023-12-09 08:10:57 +0100 | <ski> | wonder how you got that indoors, even |
2023-12-09 08:10:59 +0100 | <edwardk> | hired a small army to get it into the house with rented glass suction cups |
2023-12-09 08:11:18 +0100 | <edwardk> | payed a moving company so they'd be bonded and insured so the only at-risk steps were getting it from the freight yard to my door |
2023-12-09 08:11:18 +0100 | <xerox> | ski: they lifted the house on top of it, easier |
2023-12-09 08:11:23 +0100 | <edwardk> | damn nea |
2023-12-09 08:11:24 +0100 | <edwardk> | er near |
2023-12-09 08:11:25 +0100 | <ski> | ah, makes sense |
2023-12-09 08:12:08 +0100 | <edwardk> | if we have to do a larger tank for sirius (e.g. rip out the pool table and put in a 700+ gallon tank in its place), then we'd actually have it built in-place. |
2023-12-09 08:12:27 +0100 | <edwardk> | and do an overhead sump instead of underneath |
2023-12-09 08:12:43 +0100 | <edwardk> | by running water, etc. up into the attic nearby |
2023-12-09 08:13:29 +0100 | <ski> | @wn sump |
2023-12-09 08:13:30 +0100 | <lambdabot> | *** "sump" wn "WordNet (r) 3.0 (2006)" |
2023-12-09 08:13:30 +0100 | <lambdabot> | sump |
2023-12-09 08:13:31 +0100 | <edwardk> | easier with a tank with that much surface area to allow a smaller sump to siphon _down_ into the main display tank than it is to have a massive sump that can soak the 1 inch or so of water that would siphon down into it on power failure |
2023-12-09 08:13:31 +0100 | <lambdabot> | n 1: an oil reservoir in an internal combustion engine |
2023-12-09 08:13:33 +0100 | <lambdabot> | 2: a well or other hole in which water has collected |
2023-12-09 08:13:35 +0100 | <lambdabot> | 3: a covered cistern; waste water and sewage flow into it [syn: |
2023-12-09 08:13:37 +0100 | <lambdabot> | {cesspool}, {cesspit}, {sink}, {sump}] |
2023-12-09 08:14:18 +0100 | <edwardk> | https://www.youtube.com/watch?v=xVPC3CZDC68&t=35s |
2023-12-09 08:14:40 +0100 | <edwardk> | basically for a tank that big you don't want to hang something on the back or have a big intrusive unit inside the main tank |
2023-12-09 08:14:55 +0100 | <edwardk> | so you build out a separate plumbing system for all the filtration and to provide extra water volume |
2023-12-09 08:16:32 +0100 | <edwardk> | when power is lost the pumps that return water up to the tank start actually taking water _down_ into the sump system. and in my case that'd be about 2000 cubic inches of water (8.6 gallons, a couple of big buckets basically) |
2023-12-09 08:16:45 +0100 | <edwardk> | so i have to have extra volume down there for that eventuality should i lose power |
2023-12-09 08:17:14 +0100 | <edwardk> | but if i had a tank with 2.5-3.5x the surface area on top then i'd have to sink even more, so the sump would have to be oversized just for powerloss issues. |
2023-12-09 08:17:18 +0100 | <ski> | mm |
2023-12-09 08:17:20 +0100 | <ski> | (UPS ?) |
2023-12-09 08:17:30 +0100 | LaoJi | (~LaoJi@156.252.21.210) |
2023-12-09 08:17:36 +0100 | <edwardk> | otoh, if i use a smaller sump and put it overhead, then the main display tank just has to sink the extra sump backflow |
2023-12-09 08:17:55 +0100 | <edwardk> | i have the UPS but if i lose power for more than a few hours the failure mode would be a flood |
2023-12-09 08:18:20 +0100 | <ski> | yeh |
2023-12-09 08:19:05 +0100 | [_] | (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer) |
2023-12-09 08:20:06 +0100 | <edwardk> | so i've been carefully kitting things out so it overflows into a system with a couple of siphon fallbacks to drain down into the overflow, set up a ups so it can shut down the pumps gradually, blah blah blah |
2023-12-09 08:20:30 +0100 | <edwardk> | once the automated water changer comes online the whole thing will be controlled by an in wall panel |
2023-12-09 08:20:34 +0100 | <edwardk> | a bit overkill perhaps |
2023-12-09 08:20:35 +0100 | [itchyjunk] | (~itchyjunk@user/itchyjunk/x-7353470) |
2023-12-09 08:21:11 +0100 | <edwardk> | but you don't want an automated water changer to go wrong, or ... flooded house. same problem |
2023-12-09 08:22:38 +0100 | <ski> | (reminds me of someone, up in Canada, i think, who got their house (well, whole neighbourhood), flooded, a few years back, due to some water barrier that had been put up, then forgotten about for years) |
2023-12-09 08:22:44 +0100 | <edwardk> | figuring out the ozone system for the indoor system basically set me up for doing the same thing for the backyard pond. there i can use a wetland/bog filter and a huge 'foam fractionator' and should be able to get crystal clear water |
2023-12-09 08:22:48 +0100 | LaoJi | (~LaoJi@156.252.21.210) (Quit: Client closed) |
2023-12-09 08:22:54 +0100 | <edwardk> | my old setup was dirty and nasty and i didn't know any better |
2023-12-09 08:23:24 +0100 | <edwardk> | but i _had_ to do better for the stingray, and after washy (the 28yo koi who died) passed away, i'm not going to subject any more koi to those kinds of conditions. |
2023-12-09 08:25:02 +0100 | <edwardk> | (freshwater stingrays are a recent biological adaptation in geological time, so they still have the osmotic regulation behavior of a saltwater fish... in otherwords, he pees a lot, so produces a ton of ammonia into the water column, but then he;s also super sensitive to it, because biologically they just haven't had time to adapt to the the amazon river basin converting to fresh water over time.) so if i don't keep the tank water super |
2023-12-09 08:25:02 +0100 | <edwardk> | clean he'll just die |
2023-12-09 08:25:18 +0100 | <edwardk> | but then koi are super messy fish too |
2023-12-09 08:25:37 +0100 | <edwardk> | so once it became clear that that was what i was signing up for, i basically had to science the heck out of it |
2023-12-09 08:26:40 +0100 | <edwardk> | the loaches can survive in anything, the koi can kind of do the same, but sirius, not so much |
2023-12-09 08:26:53 +0100 | <ski> | river basin, like at the delta ? |
2023-12-09 08:27:24 +0100 | <ski> | (or the area that's dewatered by the river ?) |
2023-12-09 08:27:54 +0100 | <edwardk> | black diamond stingrays are found in the Tapajós, Xingu and Tocantins basins in south america |
2023-12-09 08:28:18 +0100 | <ski> | mhm |
2023-12-09 08:28:28 +0100 | ski | tries to recall the term |
2023-12-09 08:28:44 +0100 | <edwardk> | just don't step on him, or he can put you in the hospital screaming in pain for a couple days |
2023-12-09 08:29:08 +0100 | <edwardk> | otoh he's super friendly |
2023-12-09 08:29:14 +0100 | <ski> | you handle him ? |
2023-12-09 08:29:19 +0100 | <edwardk> | and loves to be touched and hand fed |
2023-12-09 08:29:20 +0100 | <edwardk> | yeah |
2023-12-09 08:29:26 +0100 | <ski> | nice :) |
2023-12-09 08:29:49 +0100 | sabino | (~sabino@user/sabino) (Quit: Lambda _ -> x) |
2023-12-09 08:30:44 +0100 | <edwardk> | 'like at the delta / in the bottom of the rivers' |
2023-12-09 08:31:37 +0100 | <edwardk> | there they are much more dangerous, because you can accidentally step on them in the muddy water and get stung and then the jagged barb and venom are a much bigger deal and are likely to get infected, etc. |
2023-12-09 08:31:55 +0100 | acidjnk_new | (~acidjnk@p200300d6e72b9380b928f2c2e25446fb.dip0.t-ipconnect.de) |
2023-12-09 08:31:56 +0100 | <ski> | (hm, guess i may've been thinking of "impluvium" or "drainage basin") |
2023-12-09 08:31:57 +0100 | <edwardk> | decided to adopt him on steve irwin day. didn't realize it at the time. crikey. |
2023-12-09 08:32:00 +0100 | benjaminl | (~benjaminl@user/benjaminl) (Remote host closed the connection) |
2023-12-09 08:32:36 +0100 | <ski> | so, they're used to muddy water, then ? |
2023-12-09 08:32:53 +0100 | benjaminl | (~benjaminl@user/benjaminl) |
2023-12-09 08:32:58 +0100 | <edwardk> | well, in the rainforest you get water that has lots of tannins in it, so its darker brown and lower pH |
2023-12-09 08:33:19 +0100 | <edwardk> | i've been compensating by adding catappa leaves and mopani wood to the tank to leach tannins over time |
2023-12-09 08:33:54 +0100 | <edwardk> | and letting the oxidation levels i can achieve from the ozone handle most of the decoloration of the water that would usually ensue, and waterchanges handle the rest |
2023-12-09 08:34:29 +0100 | <ski> | (hm, may've also confused with "alluvial") |
2023-12-09 08:34:56 +0100 | ski | nods |
2023-12-09 08:35:07 +0100 | <edwardk> | they are happier on sand than in mud, but they have spiracles next to their eyes, which can let them beathe out of either below the disc or above the disc, letting them settle down into the substrate and still breathe even in mud or sand |
2023-12-09 08:35:57 +0100 | <edwardk> | in the wild they usually eat crustaceans out of the substrate, not very good at catching fish. they are electrosensitive, which compensates for the fact that they can't see below the disc |
2023-12-09 08:36:32 +0100 | <ski> | hm, some can send an electric shock, iirc ? |
2023-12-09 08:37:00 +0100 | <edwardk> | none of the freshwater kind can though |
2023-12-09 08:37:09 +0100 | <ski> | mhm |
2023-12-09 08:38:01 +0100 | <ski> | bloodworms are water worms ? |
2023-12-09 08:38:24 +0100 | <edwardk> | he's basically the smartest thing i can get my hands on that has a decent life expectancy. a cephalopod like a cuttlefish or octopi may be smarter, but you can't get anything that lives more than like 1.5-2.5 years that could be kept in a home aquarium at all, even an enormous one |
2023-12-09 08:38:48 +0100 | <edwardk> | because all the cephalopods are basically anti-social asshole escape artists that die after or during giving birth |
2023-12-09 08:39:14 +0100 | <edwardk> | yeah, red nasty little things, easily bought in frozen bulk from the fish store |
2023-12-09 08:39:14 +0100 | <ski> | hm, didn't know that |
2023-12-09 08:39:39 +0100 | <edwardk> | i adore cuttlefish, but i don't think i could take having basically a lifecycle pet like that |
2023-12-09 08:39:55 +0100 | <edwardk> | where you have have a few of them because they keep dying off sequentially |
2023-12-09 08:41:30 +0100 | <edwardk> | i'm not vegan but have enough vegan friends that i don't feel too bad about feeding sirius, because well bivalves have like 13 neurons, and the worms aren't _much_ smarter. |
2023-12-09 08:42:23 +0100 | <edwardk> | and he only really likes the bloodworms and clams anyways |
2023-12-09 08:43:03 +0100 | <edwardk> | but with octopi or cuttlefish i'd basically have to feed live |
2023-12-09 08:43:24 +0100 | <ski> | some birds use stones to crack open clams. or drop them from a high altitude |
2023-12-09 08:43:56 +0100 | <edwardk> | he's really figured out how to weaponize the glass of the aquarium for it. so much he keeps a corner of the aquarium bare for clam cracking duty |
2023-12-09 08:44:30 +0100 | <ski> | as long as it doesn't damage the glass, with repeated hammerings around the same spot |
2023-12-09 08:45:02 +0100 | <edwardk> | its tempered at least |
2023-12-09 08:53:36 +0100 | <ski> | well, time to sleep, perhaps (?) |
2023-12-09 08:54:43 +0100 | <edwardk> | yeah i should get a couple hours before my flight |
2023-12-09 08:54:47 +0100 | <edwardk> | wish me luck =) |
2023-12-09 08:55:02 +0100 | <ski> | good night, pleasant dreams. and good luch |
2023-12-09 08:55:04 +0100 | <ski> | luck |
2023-12-09 09:00:30 +0100 | <petrichor> | time for the western europe morning crew to pick up :D |
2023-12-09 09:04:05 +0100 | <xerox> | petrichor: sorry only had 1 goldfish as a kid and that was it |
2023-12-09 09:07:57 +0100 | <petrichor> | yeah, i just have a cat and recently also a dog, unless you also count the ramshorn snails in the pond |
2023-12-09 09:09:27 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2023-12-09 09:10:04 +0100 | <edwardk> | hah |
2023-12-09 09:10:16 +0100 | <edwardk> | i have a couple of cats too. the fish were sort of accidental |
2023-12-09 09:11:01 +0100 | <edwardk> | mostly its just that one of the cats likes to close my laptop whenever she detects me writing haskell |
2023-12-09 09:11:20 +0100 | <edwardk> | so far the fish have demonstrated more restraint |
2023-12-09 09:11:26 +0100 | <edwardk> | perhaps due to circumstances |
2023-12-09 09:11:49 +0100 | <petrichor> | kitty only permits imperative programming >_< |
2023-12-09 09:13:45 +0100 | <petrichor> | i would love to have a cephalopod friend but that would be way too much commitment with my level of executive functioning... XD |
2023-12-09 09:15:52 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 268 seconds) |
2023-12-09 09:18:23 +0100 | <ski> | "whenever she detects me writing haskell" -- heh, wonder how that happens :þ |
2023-12-09 09:26:12 +0100 | fendor | (~fendor@2a02:8388:1605:d100:267b:1353:13d7:4f0c) |
2023-12-09 09:29:14 +0100 | ski | . o O ( "ceiling cat" <https://lambdacats.github.io/unsafeperformio/>,"simon cat" <https://lambdacats.github.io/fixed-in-head/>,"laptop" <https://lambdacats.github.io/multicore/> ) |
2023-12-09 09:35:44 +0100 | maars | (uid160334@id-160334.uxbridge.irccloud.com) (Quit: Connection closed for inactivity) |
2023-12-09 09:37:19 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 240 seconds) |
2023-12-09 09:39:29 +0100 | <petrichor> | presumably any time his hands are on the keyboard... :p |
2023-12-09 09:41:35 +0100 | akegalj | (~akegalj@78-1-124-77.adsl.net.t-com.hr) |
2023-12-09 09:49:02 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:11bf:d345:9651:e652) (Remote host closed the connection) |
2023-12-09 09:50:08 +0100 | tzh | (~tzh@c-71-193-181-0.hsd1.or.comcast.net) (Quit: zzz) |
2023-12-09 09:54:56 +0100 | todi | (~todi@p4fd1aa52.dip0.t-ipconnect.de) (Ping timeout: 245 seconds) |
2023-12-09 09:55:05 +0100 | todi1 | (~todi@p5dca55c4.dip0.t-ipconnect.de) |
2023-12-09 09:56:47 +0100 | coot | (~coot@89-69-206-216.dynamic.chello.pl) |
2023-12-09 10:00:47 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 10:03:36 +0100 | _ht | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) |
2023-12-09 10:11:57 +0100 | newsham | (~newsham@2603-800c-2c01-6825-1466-59ff-d06f-d621.res6.spectrum.com) |
2023-12-09 10:12:29 +0100 | <newsham> | is there a way to tell haskell that a pattern match against an empty set cant happen? or do you just omit it from the patterns in match and func defns? |
2023-12-09 10:12:49 +0100 | <newsham> | `f Void = ...` |
2023-12-09 10:14:19 +0100 | phma | (phma@2001:5b0:210f:7288:e7e3:fefd:fd87:d9a3) (Read error: Connection reset by peer) |
2023-12-09 10:15:19 +0100 | econo_ | (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity) |
2023-12-09 10:15:39 +0100 | phma | (~phma@2001:5b0:2143:b148:7b24:e989:5355:982f) |
2023-12-09 10:17:36 +0100 | <tomsmeding> | newsham: have you tried just omitting it? |
2023-12-09 10:17:45 +0100 | <tomsmeding> | the pattern match checker should be able to determine that the match is unnecessary |
2023-12-09 10:18:15 +0100 | <tomsmeding> | that is, _if_ the pattern is really unnecessary! Remember that haskell is lazy, so values may well be 'undefined' that is not yet evaluated, and you _do_ need to match those |
2023-12-09 10:18:43 +0100 | <tomsmeding> | if you're in this situation, a typical trick is writing 'f x = case x of {}' using EmptyCase |
2023-12-09 10:19:59 +0100 | <tomsmeding> | see the definition of 'absurd' in base: https://hackage.haskell.org/package/base-4.17.0.0/docs/src/Data.Void.html#absurd |
2023-12-09 10:20:13 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2023-12-09 10:21:14 +0100 | <newsham> | i would prefer to be explicit about it. |
2023-12-09 10:22:12 +0100 | <newsham> | `absurd` is what i want. thank you. |
2023-12-09 10:22:36 +0100 | bilegeek | (~bilegeek@2600:1008:b049:5a95:99c5:8ca9:6c97:5a13) (Quit: Leaving) |
2023-12-09 10:22:58 +0100 | <ski> | `EmptyCase' would also work fine |
2023-12-09 10:24:14 +0100 | <ski> | (for a GADT matching, where some cases would be impossible in the current situation, you'd just omit those. if it's matching in the definiendums, though, you'd need at least one case left, or else it thinks you've forgotten to provide a definition) |
2023-12-09 10:24:17 +0100 | flounders | (~flounders@24.246.176.178) (Quit: WeeChat 4.1.1) |
2023-12-09 10:25:09 +0100 | <ski> | Agda has an "absurd pattern", that can be used instead, in cases like this |
2023-12-09 10:26:23 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:1fe:ac5a:8c23:9cce) |
2023-12-09 10:28:06 +0100 | <ski> | conceptually, it's the neutral element of disjunctive / "or"- patterns. just like the wildcard pattern `_' is the neutral element of conjunctive patterns (`@' in haskell, generalized to allow an arbitrary pattern on both sides) |
2023-12-09 10:28:39 +0100 | harveypwca | (~harveypwc@2601:246:c280:7940:585a:99af:3e4c:209b) (Quit: Leaving) |
2023-12-09 10:29:05 +0100 | lane1 | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 10:29:30 +0100 | igemnace | (~ian@user/igemnace) |
2023-12-09 10:30:26 +0100 | <newsham> | yah thats what confused me because i started to use the agda syntax and couldnt remember the haskell syntax :) |
2023-12-09 10:30:51 +0100 | <newsham> | coprodUnitLeft :: Iso a (CoProd Zero a) |
2023-12-09 10:30:51 +0100 | <newsham> | coprodUnitLeft = IsoProof{ isoAB = unitLeft, isoBA = unUnitLeft } |
2023-12-09 10:30:52 +0100 | <newsham> | where unitLeft = InR |
2023-12-09 10:30:52 +0100 | <newsham> | unUnitLeft = uncoprod absurd id |
2023-12-09 10:31:26 +0100 | <newsham> | not that i know agda all that well but i was looking at agda code recently and i guess that syntax stuck in my head |
2023-12-09 10:31:36 +0100 | <ski> | yea, makes sense |
2023-12-09 10:31:39 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 256 seconds) |
2023-12-09 10:32:28 +0100 | <ski> | personally, i write |
2023-12-09 10:32:36 +0100 | <ski> | foo ‾ = ‾ |
2023-12-09 10:32:38 +0100 | <ski> | rather than |
2023-12-09 10:32:42 +0100 | <ski> | foo () |
2023-12-09 10:35:01 +0100 | LaoJi | (~LaoJi@156.252.21.210) |
2023-12-09 10:35:17 +0100 | LaoJi | (~LaoJi@156.252.21.210) (Client Quit) |
2023-12-09 10:35:33 +0100 | <tomsmeding> | fancy overline |
2023-12-09 10:36:56 +0100 | rosco | (~rosco@175.136.152.56) (Quit: Lost terminal) |
2023-12-09 10:41:51 +0100 | acidjnk_new | (~acidjnk@p200300d6e72b9380b928f2c2e25446fb.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2023-12-09 10:43:01 +0100 | tcard | (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Read error: Connection reset by peer) |
2023-12-09 10:43:27 +0100 | tcard | (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) |
2023-12-09 10:44:14 +0100 | <newsham> | whats the preferred codepad for haskell these days? i think hpaste and codepad went away? |
2023-12-09 10:44:26 +0100 | todi1 | todi |
2023-12-09 10:45:45 +0100 | <ski> | @where paste |
2023-12-09 10:45:45 +0100 | <lambdabot> | Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com |
2023-12-09 10:47:09 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) |
2023-12-09 10:47:24 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2023-12-09 10:48:24 +0100 | <newsham> | https://play-haskell.tomsmeding.com/saved/XlVvX7z6 |
2023-12-09 10:57:16 +0100 | bollu | (~bollu@159.65.151.13) (Quit: The Lounge - https://thelounge.chat) |
2023-12-09 10:57:50 +0100 | bollu | (~bollu@159.65.151.13) |
2023-12-09 10:57:58 +0100 | <ski> | s/coswap/mirror/ |
2023-12-09 10:58:08 +0100 | whatsupdoc | (uid509081@id-509081.hampstead.irccloud.com) |
2023-12-09 10:59:19 +0100 | <ski> | no `prod :: (a -> b) -> (a -> c) -> (a -> Prod b c)',`coprodMap :: (a0 -> a1) -> (b0 -> b1) -> (CoProd a0 b0 -> CoProd a1 b1)' ? |
2023-12-09 10:59:52 +0100 | lane1 | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 255 seconds) |
2023-12-09 11:01:28 +0100 | <newsham> | not yet i guess :) |
2023-12-09 11:01:48 +0100 | not_reserved | (~not_reser@194.124.76.8) (Quit: Client closed) |
2023-12-09 11:03:29 +0100 | <newsham> | also didnt do `(a :+ b) : * c` yet |
2023-12-09 11:03:56 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) (Quit: WeeChat 4.1.0) |
2023-12-09 11:04:19 +0100 | <ski> | exponentials, too ? |
2023-12-09 11:06:02 +0100 | <newsham> | lots to do |
2023-12-09 11:06:17 +0100 | danza | (~danza@151.47.25.81) |
2023-12-09 11:07:24 +0100 | <ski> | data Proc a b = MkProc (a -> (b,Proc a b)) |
2023-12-09 11:07:26 +0100 | <ski> | or |
2023-12-09 11:07:57 +0100 | <ski> | data Proc a b = forall s. MkProc (s,(s,a) -> (s,b)) |
2023-12-09 11:08:25 +0100 | <ski> | in Charity, you define this something like |
2023-12-09 11:08:39 +0100 | <ski> | datatype s -> Proc a b |
2023-12-09 11:08:41 +0100 | <ski> | where |
2023-12-09 11:08:54 +0100 | <ski> | MkProc : s * a -> s * b |
2023-12-09 11:09:18 +0100 | <ski> | @where Charity |
2023-12-09 11:09:18 +0100 | <lambdabot> | http://pll.cpsc.ucalgary.ca/charity1/www/home.html |
2023-12-09 11:10:19 +0100 | Tlsx | (rscastilho@189.61.140.215) |
2023-12-09 11:12:24 +0100 | Tlsx | (rscastilho@189.61.140.215) (Remote host closed the connection) |
2023-12-09 11:17:28 +0100 | Lord_of_Life_ | (~Lord@user/lord-of-life/x-2819915) |
2023-12-09 11:18:06 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds) |
2023-12-09 11:18:50 +0100 | Lord_of_Life_ | Lord_of_Life |
2023-12-09 11:19:15 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) (Ping timeout: 256 seconds) |
2023-12-09 11:19:25 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) |
2023-12-09 11:25:18 +0100 | idgaen | (~idgaen@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) |
2023-12-09 11:26:51 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Quit: Leaving) |
2023-12-09 11:28:17 +0100 | <danza> | !bots |
2023-12-09 11:29:31 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 245 seconds) |
2023-12-09 11:30:24 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2023-12-09 11:30:42 +0100 | machinedgod | (~machinedg@93-136-130-2.adsl.net.t-com.hr) |
2023-12-09 11:33:32 +0100 | <todi> | !bots |
2023-12-09 11:33:57 +0100 | <todi> | !list |
2023-12-09 11:35:31 +0100 | machinedgod | (~machinedg@93-136-130-2.adsl.net.t-com.hr) (Remote host closed the connection) |
2023-12-09 11:35:36 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) |
2023-12-09 11:36:43 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) (Quit: WeeChat 4.1.0) |
2023-12-09 11:37:04 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2023-12-09 11:38:02 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) |
2023-12-09 11:38:15 +0100 | machinedgod | (~machinedg@93-136-130-2.adsl.net.t-com.hr) |
2023-12-09 11:39:35 +0100 | YoungFrog | (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) (Ping timeout: 264 seconds) |
2023-12-09 11:41:47 +0100 | YoungFrog | (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) |
2023-12-09 11:42:29 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
2023-12-09 11:42:29 +0100 | finn_elija | (~finn_elij@user/finn-elija/x-0085643) |
2023-12-09 11:42:29 +0100 | finn_elija | FinnElija |
2023-12-09 11:44:46 +0100 | <edwardk> | newsham: my preferred method is `f = \case`. and then just move on without proving any cases |
2023-12-09 11:46:31 +0100 | <newsham> | hey edk. you're still around. neat. whats the backslash here? |
2023-12-09 11:46:57 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) |
2023-12-09 11:47:06 +0100 | <newsham> | oh, lambda. |
2023-12-09 11:48:54 +0100 | <newsham> | absurd :: Zero -> a |
2023-12-09 11:48:54 +0100 | <newsham> | absurd = \case |
2023-12-09 11:48:56 +0100 | <newsham> | cool thats easier |
2023-12-09 11:51:11 +0100 | akegalj | (~akegalj@78-1-124-77.adsl.net.t-com.hr) (Quit: leaving) |
2023-12-09 11:51:23 +0100 | <newsham> | i guess you're saying you would just use '\case' in place of absurd. gonna keep the absurd in there for my mental note for the time being. not trying to make this super haskell looking (not using any of prelude even), just trying to do this from scratch in a way that reads cleanly to me for now. |
2023-12-09 11:51:37 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 255 seconds) |
2023-12-09 11:51:44 +0100 | <edwardk> | that is "LambdaCase" syntax |
2023-12-09 11:51:58 +0100 | <edwardk> | foo = \case [] -> ...; (x:xs) -> ... |
2023-12-09 11:52:09 +0100 | sawilagar | (~sawilagar@user/sawilagar) |
2023-12-09 11:52:17 +0100 | <edwardk> | it introduces a layout block like foo blah = case blah of |
2023-12-09 11:53:57 +0100 | <newsham> | yup, got it. |
2023-12-09 11:54:54 +0100 | target_i | (~target_i@217.175.14.39) |
2023-12-09 11:59:29 +0100 | <newsham> | i was watching some of your talks recently, inspirational. |
2023-12-09 11:59:29 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2023-12-09 12:00:18 +0100 | <newsham> | "i found other people had better ways of doing what I was doing... so I adopted their methods" |
2023-12-09 12:04:55 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) (Quit: WeeChat 4.1.0) |
2023-12-09 12:05:37 +0100 | alexherbo2 | (~alexherbo@2a02-8440-b214-7d9d-8410-795e-9151-6da8.rev.sfr.net) (Remote host closed the connection) |
2023-12-09 12:06:10 +0100 | Tlsx | (rscastilho@189.61.140.215) |
2023-12-09 12:06:10 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) |
2023-12-09 12:06:59 +0100 | machinedgod | (~machinedg@93-136-130-2.adsl.net.t-com.hr) (Ping timeout: 260 seconds) |
2023-12-09 12:08:53 +0100 | Tlsx | (rscastilho@189.61.140.215) (Remote host closed the connection) |
2023-12-09 12:10:13 +0100 | alexherbo2 | (~alexherbo@2a02-8440-b210-cea0-a800-a38a-3c94-a861.rev.sfr.net) |
2023-12-09 12:11:14 +0100 | <tromp> | AoC day 9 is literally a 3-liner in Haskell |
2023-12-09 12:11:26 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 256 seconds) |
2023-12-09 12:11:49 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) |
2023-12-09 12:12:40 +0100 | Tuplanolla | (~Tuplanoll@91-159-68-236.elisa-laajakaista.fi) |
2023-12-09 12:14:29 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) (Ping timeout: 240 seconds) |
2023-12-09 12:21:04 +0100 | yaroot | (~yaroot@p3152107-ipngn5801souka.saitama.ocn.ne.jp) (Ping timeout: 256 seconds) |
2023-12-09 12:23:16 +0100 | <ncf> | zipWith subtract`ap`tail, the aztec god of discrete derivatives |
2023-12-09 12:24:26 +0100 | <danza> | % :t zipWith ((-) . ap . tail) -- type error |
2023-12-09 12:24:26 +0100 | <yahb2> | zipWith ((-) . ap . tail) -- type error ; :: Num ([a] -> [b]) => [[a -> b]] -> [[a] -> [b]] -> [[a] -> [b]] |
2023-12-09 12:24:47 +0100 | <danza> | was a bit too pessimistic ^^ |
2023-12-09 12:25:09 +0100 | <ncf> | :t zipWith subtract`ap`tail |
2023-12-09 12:25:11 +0100 | <lambdabot> | Num c => [c] -> [c] |
2023-12-09 12:25:26 +0100 | <danza> | oh, thanks |
2023-12-09 12:26:03 +0100 | igemnace | (~ian@user/igemnace) (Remote host closed the connection) |
2023-12-09 12:27:17 +0100 | <srk> | I can't decide if someRecordName_field or someRecordNameField :(( |
2023-12-09 12:27:40 +0100 | <danza> | just `field` and some extensions |
2023-12-09 12:29:02 +0100 | <srk> | that was bad last time I've tried but I don't remember why |
2023-12-09 12:29:24 +0100 | <srk> | maybe due to lenses |
2023-12-09 12:29:35 +0100 | <srk> | danza: don't give me a third option! :D |
2023-12-09 12:31:17 +0100 | yaroot | (~yaroot@2400:4052:ac0:d901:1cf4:2aff:fe51:c04c) |
2023-12-09 12:33:41 +0100 | tremon | (~tremon@83.80.159.219) |
2023-12-09 12:34:16 +0100 | danza | is under the impression that third options are underrated |
2023-12-09 12:34:38 +0100 | machinedgod | (~machinedg@93-136-130-2.adsl.net.t-com.hr) |
2023-12-09 12:35:29 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) |
2023-12-09 12:36:35 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) (Read error: Connection reset by peer) |
2023-12-09 12:36:53 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2023-12-09 12:37:06 +0100 | <srk> | there's also 4th like _someRecordName_field |
2023-12-09 12:37:45 +0100 | <srk> | consequences of any choice surface only after you try to generate lenses heh |
2023-12-09 12:37:47 +0100 | <probie> | I'm a fan of just `field` and `-XNoFieldSelectors` :p |
2023-12-09 12:39:46 +0100 | idgaen | (~idgaen@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 4.1.1) |
2023-12-09 12:41:05 +0100 | <probie> | and `-XDuplicateRecordFields` |
2023-12-09 12:41:26 +0100 | alexherbo2 | (~alexherbo@2a02-8440-b210-cea0-a800-a38a-3c94-a861.rev.sfr.net) (Remote host closed the connection) |
2023-12-09 12:41:45 +0100 | alexherbo2 | (~alexherbo@2a02-8440-b210-cea0-a800-a38a-3c94-a861.rev.sfr.net) |
2023-12-09 12:43:07 +0100 | mrd | (~mrd@user/mrd) |
2023-12-09 12:44:29 +0100 | machinedgod | (~machinedg@93-136-130-2.adsl.net.t-com.hr) (Ping timeout: 240 seconds) |
2023-12-09 12:46:41 +0100 | yaroot | (~yaroot@2400:4052:ac0:d901:1cf4:2aff:fe51:c04c) (Read error: Connection reset by peer) |
2023-12-09 12:46:55 +0100 | yaroot | (~yaroot@p2987138-ipngn7501souka.saitama.ocn.ne.jp) |
2023-12-09 12:47:46 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2023-12-09 12:52:03 +0100 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2023-12-09 12:55:30 +0100 | [_] | (~itchyjunk@user/itchyjunk/x-7353470) |
2023-12-09 12:55:55 +0100 | igemnace | (~ian@user/igemnace) |
2023-12-09 12:56:46 +0100 | krei-se | (~krei-se@p5085dea2.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2023-12-09 12:58:59 +0100 | [itchyjunk] | (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 256 seconds) |
2023-12-09 12:59:08 +0100 | krei-se | (~krei-se@p5085dea2.dip0.t-ipconnect.de) |
2023-12-09 13:04:23 +0100 | danza | (~danza@151.47.25.81) (Ping timeout: 260 seconds) |
2023-12-09 13:07:48 +0100 | acidjnk_new | (~acidjnk@p200300d6e72b9380b928f2c2e25446fb.dip0.t-ipconnect.de) |
2023-12-09 13:08:12 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2023-12-09 13:08:59 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2023-12-09 13:12:13 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) (Quit: WeeChat 4.1.0) |
2023-12-09 13:12:39 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) |
2023-12-09 13:16:11 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) (Ping timeout: 264 seconds) |
2023-12-09 13:17:02 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) (Client Quit) |
2023-12-09 13:17:18 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) |
2023-12-09 13:26:30 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) |
2023-12-09 13:32:25 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) (Ping timeout: 255 seconds) |
2023-12-09 13:36:54 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2023-12-09 13:39:14 +0100 | mrd | (~mrd@user/mrd) (Ping timeout: 250 seconds) |
2023-12-09 13:42:14 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) |
2023-12-09 13:42:48 +0100 | ht_ | (~Thunderbi@194.110.115.49) |
2023-12-09 13:43:14 +0100 | _ht | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Ping timeout: 256 seconds) |
2023-12-09 13:43:14 +0100 | ht_ | _ht |
2023-12-09 13:46:01 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 256 seconds) |
2023-12-09 13:46:14 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) |
2023-12-09 13:50:08 +0100 | driib | (~driib@vmi931078.contaboserver.net) (Quit: The Lounge - https://thelounge.chat) |
2023-12-09 13:51:36 +0100 | maars | (uid160334@id-160334.uxbridge.irccloud.com) |
2023-12-09 13:51:49 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2023-12-09 13:53:23 +0100 | newsham | (~newsham@2603-800c-2c01-6825-1466-59ff-d06f-d621.res6.spectrum.com) (Quit: Client closed) |
2023-12-09 13:57:04 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2023-12-09 14:01:56 +0100 | sawilagar | (~sawilagar@user/sawilagar) (Remote host closed the connection) |
2023-12-09 14:02:20 +0100 | sawilagar | (~sawilagar@user/sawilagar) |
2023-12-09 14:04:50 +0100 | andreabedini | (~andreabed@159.196.202.200) |
2023-12-09 14:07:41 +0100 | gmg | (~user@user/gehmehgeh) |
2023-12-09 14:08:47 +0100 | driib | (~driib@vmi931078.contaboserver.net) |
2023-12-09 14:15:49 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2023-12-09 14:22:07 +0100 | Unhammer | (~Unhammer@user/unhammer) |
2023-12-09 14:23:12 +0100 | <Unhammer> | Hi, "The Network.Wai.HTTP2 module was removed. " in 3.2.0 – how do I ensure I get HTTP2-support when doing Warp.run on a Wai.Application when running wai 3.2.3 ? |
2023-12-09 14:26:55 +0100 | andreabedini | (~andreabed@159.196.202.200) (Quit: andreabedini) |
2023-12-09 14:28:08 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2023-12-09 14:29:53 +0100 | pretty_dumm_guy | (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) |
2023-12-09 14:36:48 +0100 | <Unhammer> | Oh, hm if I use runTLS I get http2 with no other changes; maybe it just doesn't support h2c |
2023-12-09 14:41:34 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) (Ping timeout: 260 seconds) |
2023-12-09 14:45:03 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2023-12-09 14:55:01 +0100 | <Unhammer> | So that lets me locally reproduce my actual problem: I'm proxying server-sent events, and when running under tls1.2/http2, the browser will sometimes get "partial" chunks – anyone aware why this would happen? |
2023-12-09 14:55:03 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2023-12-09 14:55:11 +0100 | <Unhammer> | https://gist.github.com/unhammer/4edf172ef8ae7722232f16e5fb57ab71 is the haskell proxy code |
2023-12-09 14:55:33 +0100 | <Unhammer> | I'm requesting from the proxy from js, and then reading the response stream from js |
2023-12-09 14:56:00 +0100 | <Unhammer> | when going directly, I'm getting at least one full line at a time |
2023-12-09 14:56:13 +0100 | <Unhammer> | but when going via the proxy, it sometimes chops lines in the middle so they can't be parsed |
2023-12-09 14:56:59 +0100 | <exarkun> | Sure. HTTP bodies are not line-oriented. You need a proper parser if you have line-oriented data you want to extract from othem. |
2023-12-09 14:59:21 +0100 | <exarkun> | A really simple line parser is "append new data to the buffer, split the buffer on line separator, consume the successfully split prefix, save the suffix as the buffer, repeat" |
2023-12-09 14:59:36 +0100 | <exarkun> | but maybe you can find a better one in the javascript ecosystem |
2023-12-09 15:01:00 +0100 | bienjensu | (~user@user/bienjensu) |
2023-12-09 15:01:09 +0100 | zzz | (~z@user/zero) |
2023-12-09 15:02:28 +0100 | zero- | (~z@user/zero) |
2023-12-09 15:04:47 +0100 | zero | (~z@user/zero) (Ping timeout: 260 seconds) |
2023-12-09 15:04:47 +0100 | zero- | zero |
2023-12-09 15:06:25 +0100 | zzz | (~z@user/zero) (Ping timeout: 276 seconds) |
2023-12-09 15:07:58 +0100 | <haskellbridge> | 12<Celestial> I have no idea how to use lenses idiomatically |
2023-12-09 15:08:30 +0100 | <haskellbridge> | 12<Celestial> ```hs |
2023-12-09 15:08:31 +0100 | <haskellbridge> | 12<Celestial> onTick :: ApplicationState -> ApplicationState |
2023-12-09 15:08:32 +0100 | <haskellbridge> | 12<Celestial> onTick st' |
2023-12-09 15:08:34 +0100 | <haskellbridge> | 12<Celestial> | view paused st' = st' |
2023-12-09 15:08:35 +0100 | <haskellbridge> | 12<Celestial> | view (sort . finished) st' = st' |
2023-12-09 15:08:36 +0100 | <haskellbridge> | 12<Celestial> | Just z <- right $ view (sort . values) st' = set (sort . values) z st' |
2023-12-09 15:08:38 +0100 | <haskellbridge> | 12<Celestial> | otherwise = set (sort . finished) True st' |
2023-12-09 15:08:39 +0100 | <haskellbridge> | 12<Celestial> ``` |
2023-12-09 15:08:40 +0100 | <haskellbridge> | 12<Celestial> this works but feels sloppy and i don't know what to do about it lol |
2023-12-09 15:09:00 +0100 | <haskellbridge> | 12<Celestial> I can combine the top two guards but that's about it? |
2023-12-09 15:10:55 +0100 | <[exa]> | Celestial: you might need more operators |
2023-12-09 15:11:23 +0100 | <[exa]> | e.g. view (x.y.z) obj == obj ^. x.y.z |
2023-12-09 15:11:38 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2023-12-09 15:12:14 +0100 | <[exa]> | also if your ApplicationState is a State, you can use stuff like `sort.finished .= True` |
2023-12-09 15:12:33 +0100 | <haskellbridge> | 12<Celestial> you mean `MonadState`? |
2023-12-09 15:12:42 +0100 | <haskellbridge> | 12<Celestial> or whatever the typeclass is |
2023-12-09 15:12:47 +0100 | <[exa]> | yeah something like that |
2023-12-09 15:13:08 +0100 | <haskellbridge> | 12<Celestial> it's not but I guess I could make it that? |
2023-12-09 15:13:41 +0100 | <[exa]> | like, you're passing the st' in anyway, so I guess a properly positioned runState or runStateT would do it |
2023-12-09 15:15:01 +0100 | <[exa]> | then you can go with the usual monadic helpers like unlessM (use paused) $ unlessM (use $ sort.finished) $ do ... |
2023-12-09 15:15:16 +0100 | <[exa]> | `use` = `view` from state |
2023-12-09 15:16:25 +0100 | <haskellbridge> | 12<Celestial> Thanks! |
2023-12-09 15:16:25 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2023-12-09 15:16:39 +0100 | <haskellbridge> | 12<Celestial> I guess this is already better: |
2023-12-09 15:16:40 +0100 | <haskellbridge> | 12<Celestial> ```hs |
2023-12-09 15:16:41 +0100 | <haskellbridge> | 12<Celestial> onTick :: ApplicationState -> ApplicationState |
2023-12-09 15:16:42 +0100 | <haskellbridge> | 12<Celestial> onTick st |
2023-12-09 15:16:44 +0100 | <haskellbridge> | 12<Celestial> | (st ^. paused) || (st ^. sort . finished) = st |
2023-12-09 15:16:45 +0100 | <haskellbridge> | 12<Celestial> | Just z <- right $ st ^. sort . values = set (sort . values) z st |
2023-12-09 15:16:46 +0100 | <haskellbridge> | 12<Celestial> | otherwise = st & sort . finished .~ True |
2023-12-09 15:16:48 +0100 | <haskellbridge> | 12<Celestial> ``` |
2023-12-09 15:17:35 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) (Quit: WeeChat 4.1.1) |
2023-12-09 15:17:38 +0100 | <[exa]> | btw pls pastebin :] |
2023-12-09 15:17:57 +0100 | <[exa]> | ah yeah I'd say this is already good enough |
2023-12-09 15:18:06 +0100 | lg1882 | (~lg188@82.18.98.230) (Quit: Bye.) |
2023-12-09 15:18:26 +0100 | <[exa]> | with State you're simply going to trade off some `st` occurences for other things dragged in |
2023-12-09 15:18:41 +0100 | <[exa]> | might be useful if you did more state changes in 1 step |
2023-12-09 15:19:15 +0100 | <haskellbridge> | 12<Celestial> I removed some of the spaces and it looks fine |
2023-12-09 15:19:18 +0100 | <haskellbridge> | 12<Celestial> thanks again :) |
2023-12-09 15:20:49 +0100 | <[exa]> | kinda wondering, is there a good way to combine the patterns with monads |
2023-12-09 15:20:57 +0100 | <[exa]> | s/patterns/guards/ |
2023-12-09 15:21:02 +0100 | <haskellbridge> | 12<Celestial> Oh I just realized I get the state monad thing for free |
2023-12-09 15:21:22 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2023-12-09 15:21:38 +0100 | <haskellbridge> | 12<Celestial> I was just using this as a hof which simply calls `modify tickHandler` in an `EventM` |
2023-12-09 15:22:01 +0100 | <haskellbridge> | 12<Celestial> if I instead allow it to handle that itself and not force `modify` I can utilize all the state monad shenaningans |
2023-12-09 15:22:03 +0100 | <haskellbridge> | 12<Celestial> amazing |
2023-12-09 15:22:38 +0100 | <[exa]> | ah the sublime feeling of things clicking together and glue disappearing |
2023-12-09 15:22:57 +0100 | <haskellbridge> | 12<Celestial> haha indeed |
2023-12-09 15:23:10 +0100 | <haskellbridge> | 12<Celestial> lens is still new to me |
2023-12-09 15:23:21 +0100 | <haskellbridge> | 12<Celestial> but so is everything in haskell, really |
2023-12-09 15:23:29 +0100 | azimut_ | (~azimut@gateway/tor-sasl/azimut) |
2023-12-09 15:23:42 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2023-12-09 15:23:43 +0100 | cimento | (CO2@gateway/vpn/protonvpn/cimento) (Quit: WeeChat 4.1.2) |
2023-12-09 15:24:38 +0100 | cimento | (CO2@gateway/vpn/protonvpn/cimento) |
2023-12-09 15:33:06 +0100 | lg1882 | (~lg188@82.18.98.230) |
2023-12-09 15:38:06 +0100 | tomsmeding | . o O ( what is the line count limit for the bridge to send stuff to the built-in pastebin ) |
2023-12-09 15:39:31 +0100 | ft | (~ft@p3e9bc784.dip0.t-ipconnect.de) (Remote host closed the connection) |
2023-12-09 15:40:50 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 260 seconds) |
2023-12-09 15:40:57 +0100 | billchenchina | (~billchenc@2a0d:2580:ff0c:1:e3c9:c52b:a429:5bfe) |
2023-12-09 15:43:57 +0100 | [_] | [itchyjunk] |
2023-12-09 15:44:05 +0100 | ft | (~ft@p3e9bc784.dip0.t-ipconnect.de) |
2023-12-09 15:46:05 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) (Read error: Connection reset by peer) |
2023-12-09 15:46:22 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2023-12-09 15:48:30 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) |
2023-12-09 15:48:53 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) |
2023-12-09 15:49:59 +0100 | idgaen | (~idgaen@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) |
2023-12-09 15:51:42 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2023-12-09 15:52:22 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2023-12-09 15:53:52 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 276 seconds) |
2023-12-09 15:54:17 +0100 | kaskal- | (~kaskal@2001:4bb8:2d2:5771:29a:c01c:fefc:78b5) (Quit: ZNC - https://znc.in) |
2023-12-09 15:54:22 +0100 | lg1882 | (~lg188@82.18.98.230) (Ping timeout: 260 seconds) |
2023-12-09 15:54:37 +0100 | kaskal | (~kaskal@89.144.222.250) |
2023-12-09 15:54:48 +0100 | <ephemient> | [exa]: LambdaCase/MultiWayIf? |
2023-12-09 15:56:46 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2023-12-09 15:57:01 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2023-12-09 15:57:54 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) (Quit: WeeChat 4.1.1) |
2023-12-09 15:59:43 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 276 seconds) |
2023-12-09 15:59:56 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) |
2023-12-09 16:00:03 +0100 | m1dnight | (~christoph@78-22-4-67.access.telenet.be) |
2023-12-09 16:00:06 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) |
2023-12-09 16:02:52 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2023-12-09 16:06:04 +0100 | ht_ | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) |
2023-12-09 16:07:54 +0100 | _ht | (~Thunderbi@194.110.115.49) (Ping timeout: 260 seconds) |
2023-12-09 16:07:54 +0100 | ht_ | _ht |
2023-12-09 16:12:16 +0100 | <Unhammer> | exarkun: i know, but the upstream server always sends full lines per chunk (if i print chunk in that gist i never see a split line, but on the js side i do) |
2023-12-09 16:14:05 +0100 | <Unhammer> | And i can't figure out if the issue is on the consuming or serving side, since it works fine with http1 / no tls |
2023-12-09 16:18:03 +0100 | notzmv | (~zmv@user/notzmv) (Ping timeout: 260 seconds) |
2023-12-09 16:23:15 +0100 | dhil | (~dhil@2001:8e0:2014:3100:3783:1717:6803:631d) |
2023-12-09 16:29:39 +0100 | <[exa]> | tomsmeding: where do we find that |
2023-12-09 16:32:02 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2023-12-09 16:32:11 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) (Ping timeout: 256 seconds) |
2023-12-09 16:33:46 +0100 | gawen | (~gawen@user/gawen) (Ping timeout: 256 seconds) |
2023-12-09 16:33:54 +0100 | gawen_ | (~gawen@user/gawen) |
2023-12-09 16:37:54 +0100 | lg1882 | (~lg188@82.18.98.230) |
2023-12-09 16:41:36 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2023-12-09 16:44:55 +0100 | cimento | (CO2@gateway/vpn/protonvpn/cimento) (Quit: WeeChat 4.1.2) |
2023-12-09 16:49:54 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) (Read error: Connection reset by peer) |
2023-12-09 16:49:57 +0100 | mechap | (~mechap@user/mechap) |
2023-12-09 16:50:11 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2023-12-09 16:54:07 +0100 | Simikando | (~Simikando@adsl-dyn56.91-127-158.t-com.sk) (Remote host closed the connection) |
2023-12-09 16:56:43 +0100 | <ski> | [exa] : i don't really think so |
2023-12-09 16:57:08 +0100 | <ski> | (well, i guess perhaps in my reflective syntax .. i should probably try to work some more on it) |
2023-12-09 16:59:43 +0100 | azimut_ | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 240 seconds) |
2023-12-09 17:00:26 +0100 | <tomsmeding> | [exa]: I think you ask geekosaur :p |
2023-12-09 17:01:18 +0100 | <ski> | (sorry, re guards and monads, in case it was unclear) |
2023-12-09 17:02:21 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
2023-12-09 17:04:27 +0100 | <geekosaur> | hm? |
2023-12-09 17:05:19 +0100 | aruns | (~aruns@user/aruns) |
2023-12-09 17:05:56 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2023-12-09 17:06:05 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2023-12-09 17:06:15 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2023-12-09 17:06:33 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2023-12-09 17:12:28 +0100 | <tomsmeding> | geekosaur: what's the limit on the number of lines in a message before the bridge puts it in the built-in pastebin |
2023-12-09 17:13:40 +0100 | <geekosaur> | this bridge doesn't have a pastebin, sadly; it splits on lines and sends separate messages |
2023-12-09 17:13:52 +0100 | <geekosaur> | it's sent some pretty long things that way |
2023-12-09 17:13:59 +0100 | <tomsmeding> | ah I see |
2023-12-09 17:14:12 +0100 | <tomsmeding> | so ∞, then :) |
2023-12-09 17:14:23 +0100 | <geekosaur> | probably for the best as my machine isn't accessible from outside so the message would effectively disappear |
2023-12-09 17:14:37 +0100 | <tomsmeding> | oh lol |
2023-12-09 17:15:08 +0100 | <tomsmeding> | how does that work with matrix? Can you run appservices on a machine without a public IP as long as the matrix server it's attached (matrix.org, in this case?) to is publicly accessible? |
2023-12-09 17:15:20 +0100 | <geekosaur> | will be discussing with the infra team about getting a vm to run it on |
2023-12-09 17:15:38 +0100 | <geekosaur> | no, appservices need to run on the same machine as the homeserver |
2023-12-09 17:15:49 +0100 | <geekosaur> | matterbridge doesn't use an appserver |
2023-12-09 17:16:09 +0100 | tomsmeding | thought homeservers needed a public IP |
2023-12-09 17:16:28 +0100 | <geekosaur> | right, no homeserver here |
2023-12-09 17:16:47 +0100 | <tomsmeding> | then I clearly don't know enough about matrix stuff to be commenting on this :p |
2023-12-09 17:17:12 +0100 | <tomsmeding> | oh it's just a matrix client? |
2023-12-09 17:17:28 +0100 | <geekosaur> | matterbridge is dumb, it uses a dedicated account on each service and relays messages not from that account |
2023-12-09 17:17:32 +0100 | <tomsmeding> | which works because it's not plumbed, it's just a bot on both sides |
2023-12-09 17:17:33 +0100 | <tomsmeding> | _right_ |
2023-12-09 17:17:36 +0100 | <tomsmeding> | okay makes sense |
2023-12-09 17:17:37 +0100 | <geekosaur> | otherwise it's just a normal matrix and irc client |
2023-12-09 17:17:53 +0100 | <geekosaur> | which makes it easy to set up but quite dumb |
2023-12-09 17:17:57 +0100 | <tomsmeding> | yep |
2023-12-09 17:18:24 +0100 | <geekosaur> | when I move it to a haskell.org machine I'm going to look at setting up a homeserver and heisenbridge as an appservice instead |
2023-12-09 17:18:41 +0100 | <geekosaur> | sadly, it still doesn't do puppeting, at least on the IRC side |
2023-12-09 17:18:48 +0100 | <tomsmeding> | meh |
2023-12-09 17:19:36 +0100 | <geekosaur> | the only bridge that does is EMS's appservice_irc, but that one won't be permitted for the same reason the original bridge went away |
2023-12-09 17:21:24 +0100 | cimento | (CO2@gateway/vpn/protonvpn/cimento) |
2023-12-09 17:21:40 +0100 | <geekosaur> | IRC puppeting is a lot of load and a lot of state in the bridge, and hard to get right |
2023-12-09 17:21:55 +0100 | <geekosaur> | and in particular a lot of load on libera's servers |
2023-12-09 17:22:13 +0100 | <geekosaur> | not that I'm planning to puppet 20,000+ users like EMS was |
2023-12-09 17:23:19 +0100 | <geekosaur> | it took like half an hour to reestablish IRC puppets every time they restarted the bridge |
2023-12-09 17:24:01 +0100 | <geekosaur> | it was much easier matrix-side because the homeserver retains the state for puppets the same way it does for ordinary users |
2023-12-09 17:31:14 +0100 | Guest10 | (~Guest10@ool-18bc2e74.dyn.optonline.net) |
2023-12-09 17:31:33 +0100 | shapr | (~user@2600:1700:c640:3100:6b1f:4416:e400:c56a) (Ping timeout: 256 seconds) |
2023-12-09 17:32:25 +0100 | Guest10 | (~Guest10@ool-18bc2e74.dyn.optonline.net) (Client Quit) |
2023-12-09 17:32:36 +0100 | Guest10 | (~Guest10@ool-18bc2e74.dyn.optonline.net) |
2023-12-09 17:44:44 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2023-12-09 17:44:57 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2023-12-09 17:45:33 +0100 | fendor | (~fendor@2a02:8388:1605:d100:267b:1353:13d7:4f0c) (Remote host closed the connection) |
2023-12-09 17:45:47 +0100 | mikess | (~sam@user/mikess) |
2023-12-09 17:46:06 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2023-12-09 17:55:20 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2023-12-09 18:00:12 +0100 | arkoinad | (~abhinav@c-67-169-139-16.hsd1.ca.comcast.net) |
2023-12-09 18:00:15 +0100 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) |
2023-12-09 18:01:26 +0100 | billchenchina | (~billchenc@2a0d:2580:ff0c:1:e3c9:c52b:a429:5bfe) (Remote host closed the connection) |
2023-12-09 18:01:44 +0100 | billchenchina | (~billchenc@103.152.35.21) |
2023-12-09 18:03:40 +0100 | <tri> | hello, test sending message |
2023-12-09 18:05:20 +0100 | econo_ | (uid147250@id-147250.tinside.irccloud.com) |
2023-12-09 18:05:45 +0100 | <tri> | instance Semigroup (Person [x] [y]) where (Person first1 last1) <> (Person first2 last2) = Person (first1 ++ first2) (last1 ++ last2) |
2023-12-09 18:05:48 +0100 | <tri> | data Trivial = Trivial deriving (Eq, Show) |
2023-12-09 18:06:20 +0100 | <tri> | sorry for spamming, just pasted a block of code into irssi and it auto sent... |
2023-12-09 18:07:32 +0100 | <geekosaur> | generally we don't paste code directly into IRC, it ends up a mess especially if someone else sends something in the middle of it |
2023-12-09 18:07:35 +0100 | <geekosaur> | @where paste |
2023-12-09 18:07:35 +0100 | <lambdabot> | Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com |
2023-12-09 18:09:01 +0100 | <tri> | thank you, i just installed irrsi and see if it can handle multiline chat. Clearly it cannot |
2023-12-09 18:09:19 +0100 | <geekosaur> | nope, IRC doesn't handle it |
2023-12-09 18:09:34 +0100 | <geekosaur> | it's an old protocol and not very smart |
2023-12-09 18:10:34 +0100 | <tri> | yea it striked me as odd when many haskellers choose IRC over slack or discord, guess im the younger generation haha |
2023-12-09 18:11:10 +0100 | <geekosaur> | there's a fairly large community on matrix also, #haskell:matrix.org |
2023-12-09 18:11:40 +0100 | <geekosaur> | and the FP discord, although I don't have a link for that off the top of my head |
2023-12-09 18:12:18 +0100 | <tri> | oh ok, I think I have ran into the FP discord before. That shouldn't be hard to look up |
2023-12-09 18:13:17 +0100 | <monochrom> | Slack Discord Matrix etc didn't even exist back then. There were only IRC, mailing lists, and newsgroups. |
2023-12-09 18:13:23 +0100 | <dsal> | I use slack and discord, but many in my generation find it odd to centralize communication onto a centralized proprietary service. |
2023-12-09 18:14:02 +0100 | <monochrom> | But it is true that it is now IRC and mailing lists that are dying. (newsgroups already did.) |
2023-12-09 18:15:28 +0100 | <dsal> | A few minutes ago, I looked up an old computer I'd bought in my email. The footer had a link that said "Check the status of this order anytime in your Google Checkout Account." The link was to checkout.google.com (NXDOMAIN). Lies. |
2023-12-09 18:17:10 +0100 | <dsal> | I have so many dead links to services that were cool for a bit, but now gone. So much good information in dead or closed services that you won't be able to find. |
2023-12-09 18:18:19 +0100 | <[exa]> | ski: yeah, monads vs guards :] actually recalled that I though about that already once and found that there wouldn't be many better solutions than something like `choice` + monadFail |
2023-12-09 18:18:19 +0100 | <tri> | @dsal i guess you are pointing out the reason as to why we use oos then |
2023-12-09 18:18:19 +0100 | <lambdabot> | Maybe you meant: keal eval |
2023-12-09 18:18:53 +0100 | <[exa]> | tri: @nick doesn't work on irc, we use just nick: (and even then it doesn't semantically mean anything, just some irc clients highlight messages that contain your nick) |
2023-12-09 18:18:53 +0100 | <tri> | oss i mean |
2023-12-09 18:19:26 +0100 | <monochrom> | That is also Richard Stallman's reason. |
2023-12-09 18:20:11 +0100 | <tri> | i just checked out Matrix and it seems like a better client for chatting, it at least has the chat history |
2023-12-09 18:20:16 +0100 | <dsal> | tri: Yeah. I like having things that work after companies die. :) I wrote my GoPro stuff because, while I greatly appreciate their unsustainably cheap storage, I assume they'll shut it down someday: https://dustin.sallings.org/2020/04/29/gopro-plus.html |
2023-12-09 18:20:26 +0100 | <monochrom> | Before he began, he was really scarred by a printer company going bust therefore no one could fix a bug in his printer's driver. |
2023-12-09 18:20:31 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 18:21:01 +0100 | <hc> | Actually, it's Free Software, not oss ;-) |
2023-12-09 18:21:03 +0100 | <dsal> | I tried running a Matrix instance at one point and it seemed unnecessarily hard to get started. |
2023-12-09 18:21:04 +0100 | <probie> | tri: Lack of chat history is a feature |
2023-12-09 18:21:31 +0100 | <geekosaur> | luckily you don't need to run one, you can use an existing homeserver |
2023-12-09 18:22:12 +0100 | <dsal> | Back when I used to do stuff with xmpp, I could spin up my own servers and clients and stuff pretty easily and interact. I had all kinds of helpful XMPP services. |
2023-12-09 18:22:16 +0100 | <tri> | when i join irc, it's a clean slate, and personally I feel disconnected from the community because everyone can just use a new username everytime they join. And there is no history to retain my previous discussion |
2023-12-09 18:22:27 +0100 | <geekosaur> | I think they're planning to address rough edges in dendrite, but that's still in development |
2023-12-09 18:22:30 +0100 | <monochrom> | In line with this tangent, chat history is accessible until whoever maintains it goes bust. >:) |
2023-12-09 18:22:40 +0100 | <tri> | so it's like i don't get to know anybody |
2023-12-09 18:22:54 +0100 | <dsal> | tri: there's a history link in the discussion. Most of us have stable usernames. I've been connected for years and have my own local history for several channels. |
2023-12-09 18:23:05 +0100 | <probie> | The problem with the term "free software" is to people who aren't familiar with the term, you need to explain it means "free" as in "freedom" |
2023-12-09 18:23:07 +0100 | <dsal> | er, topic, not discussion. Brain wants to go outside. |
2023-12-09 18:23:07 +0100 | <monochrom> | But I don't use a new username every time I join. |
2023-12-09 18:23:07 +0100 | <geekosaur> | likewise |
2023-12-09 18:24:04 +0100 | <monochrom> | In fact, in the special case of libera, it has an account registering system, therefore encouraging people to be stable about their usernames. |
2023-12-09 18:25:22 +0100 | <geekosaur> | including reserving usernames so other people can't use them |
2023-12-09 18:26:45 +0100 | <tri> | i saw that, but im using irssi so it's a bit hard to get around |
2023-12-09 18:27:14 +0100 | <monochrom> | Then use hexchat. >:) |
2023-12-09 18:27:41 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2023-12-09 18:27:56 +0100 | notzmv | (~zmv@user/notzmv) |
2023-12-09 18:28:00 +0100 | <tri> | ok i'll check it out, im just looking for something user friendly |
2023-12-09 18:28:44 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 252 seconds) |
2023-12-09 18:28:45 +0100 | <geekosaur> | hexchat will be much friendlier than irssi, which is really intended for people comfortable with the command line |
2023-12-09 18:29:00 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) |
2023-12-09 18:29:14 +0100 | <geekosaur> | there's also KDE's Konversation, an IRC plugin for Thunderbord Mail if you use that, etc. |
2023-12-09 18:29:28 +0100 | <tri> | oh hexchat is not on Mac |
2023-12-09 18:29:33 +0100 | <geekosaur> | Quassel, Textual for Macs, etc. |
2023-12-09 18:29:41 +0100 | <geekosaur> | you want Textual then |
2023-12-09 18:29:47 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:1fe:ac5a:8c23:9cce) (Remote host closed the connection) |
2023-12-09 18:30:02 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:1fe:ac5a:8c23:9cce) |
2023-12-09 18:31:24 +0100 | <monochrom> | probie: "The Free Left" is now how I remember that in the free-forgetful adjunction, free is on the left. >:) |
2023-12-09 18:32:08 +0100 | tri_ | (~textual@ool-18bc2e74.dyn.optonline.net) |
2023-12-09 18:32:08 +0100 | <tri_> | tseting on textual |
2023-12-09 18:32:25 +0100 | <monochrom> | "Now there are two of them!" |
2023-12-09 18:33:30 +0100 | <tri_> | dsa: now i need to figure out how to get the chat history |
2023-12-09 18:34:21 +0100 | lane1 | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 18:34:37 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2023-12-09 18:34:46 +0100 | <tri> | can anyone tell me how to retain or at least view the chat history please |
2023-12-09 18:35:28 +0100 | <monochrom> | If you see the "topic" line or box, it has a lot of stuff, and there is a website holding logs by a volunteer. |
2023-12-09 18:36:29 +0100 | <tri_> | oh it's literally called logs |
2023-12-09 18:36:31 +0100 | <geekosaur> | IRC doesn't keep logs. Matrix does |
2023-12-09 18:36:51 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 256 seconds) |
2023-12-09 18:36:55 +0100 | <tri_> | alright thank you everyone, you are really helpful |
2023-12-09 18:37:04 +0100 | <geekosaur> | Various channels have their own log bots |
2023-12-09 18:37:35 +0100 | <monochrom> | In general this is IRC culture: 1. Global history is unimportant. 2. If you want to save up things when you are online, tell your software to do it yourself. |
2023-12-09 18:38:32 +0100 | <tri> | gotcha |
2023-12-09 18:39:02 +0100 | <monochrom> | I won't insist that this is the only right way, but I will insist that other ways are not more right. This is just another endian question. |
2023-12-09 18:39:17 +0100 | <[exa]> | tbh I find it quite healthily similar to how people talk normally |
2023-12-09 18:39:35 +0100 | <int-e> | monochrom is always fighting the holy war |
2023-12-09 18:39:38 +0100 | <[exa]> | 1] global history wth, 2] you can carry a tape recorder :D |
2023-12-09 18:40:10 +0100 | <tri> | [exa]: that's a good way to think about it |
2023-12-09 18:40:54 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2023-12-09 18:41:01 +0100 | <[exa]> | tri: as a result you won't ever do this "three hour search in slack workspace history on the cool link that you just cannot find" |
2023-12-09 18:41:06 +0100 | <[exa]> | it's just lost™ :D |
2023-12-09 18:41:17 +0100 | <[exa]> | time = saved |
2023-12-09 18:42:24 +0100 | <monochrom> | Yeah we don't mind answering a question for the second time where the first time was like 5 years ago :) |
2023-12-09 18:42:42 +0100 | hamess | (~hamess@user/hamess) (WeeChat 4.1.2) |
2023-12-09 18:42:56 +0100 | <[exa]> | ski: ........contemplating more on the previous -- given we've got this special syntax for `guard` and `fail`, I guess eventually adding `choice` to the mix wouldn't hurt too much, right. |
2023-12-09 18:43:44 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) (Read error: Connection reset by peer) |
2023-12-09 18:44:03 +0100 | euleritian | (~euleritia@77.22.252.56) |
2023-12-09 18:44:34 +0100 | coot | (~coot@89-69-206-216.dynamic.chello.pl) (Quit: coot) |
2023-12-09 18:44:48 +0100 | tzh | (~tzh@c-71-193-181-0.hsd1.or.comcast.net) |
2023-12-09 18:45:10 +0100 | Joao003 | (~Joao003@190.108.99.32) |
2023-12-09 18:47:00 +0100 | <ski> | tri : some reasons to prefer IRC : anyone can make clients; there isn't any single organization in control of the protocol; no officially blessed public logging/history; no inline images, sound clips, videos, page previews; less heavy on resources |
2023-12-09 18:47:04 +0100 | <ski> | tri : "everyone can just use a new username everytime they join" -- except you can register your nickname. and regulars tend to stick mostly to one or a few nicknames |
2023-12-09 18:47:51 +0100 | <tri> | gotcha |
2023-12-09 18:48:14 +0100 | <tri> | anyway i can filter out the joined and quit logs? |
2023-12-09 18:48:21 +0100 | <tri> | they are just noise |
2023-12-09 18:48:38 +0100 | <ski> | some clients support that |
2023-12-09 18:48:41 +0100 | ski | prefers not to |
2023-12-09 18:49:39 +0100 | ski | would not be surprised if Textual,Quassel,HexChat,Irssi all had ways to do that |
2023-12-09 18:49:42 +0100 | <[exa]> | tri: most clients support pretty wide /ignore syntax, something like /ignore * joins parts quits |
2023-12-09 18:49:47 +0100 | <[exa]> | your manual may vary |
2023-12-09 18:50:07 +0100 | <geekosaur> | https://help.codeux.com/textual/Frequently-Asked-Questions.kb# |
2023-12-09 18:50:28 +0100 | <ski> | [exa] : the `guard' one bineg ? |
2023-12-09 18:50:31 +0100 | <slideshow6052> | hi |
2023-12-09 18:50:35 +0100 | <ski> | lo slideshow6052 |
2023-12-09 18:50:44 +0100 | <slideshow6052> | ayy |
2023-12-09 18:50:55 +0100 | <[exa]> | ski: in the list comprehensions |
2023-12-09 18:50:59 +0100 | euleritian | (~euleritia@77.22.252.56) (Ping timeout: 264 seconds) |
2023-12-09 18:50:59 +0100 | <ski> | right |
2023-12-09 18:51:03 +0100 | <geekosaur> | hm, that was kinda useless, it's apparently javascript instead of an actual link |
2023-12-09 18:51:08 +0100 | <ski> | (monad comprehensions) |
2023-12-09 18:51:14 +0100 | <[exa]> | (also) |
2023-12-09 18:51:52 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) |
2023-12-09 18:51:58 +0100 | <slideshow6052> | is there a built in function which takes [a->a] and an a and keeps applying it? |
2023-12-09 18:52:04 +0100 | <slideshow6052> | i tried hoogle but i didnt find |
2023-12-09 18:52:10 +0100 | <slideshow6052> | but it seems like it should be there |
2023-12-09 18:52:57 +0100 | <ski> | i usually call that `compose', defined as `foldr (.) id' or `flip (foldr ($))' |
2023-12-09 18:53:26 +0100 | <slideshow6052> | i mean sometihng like g (f:fs) x = g fs (f x) |
2023-12-09 18:53:32 +0100 | <slideshow6052> | ah i see |
2023-12-09 18:54:12 +0100 | Guest10 | (~Guest10@ool-18bc2e74.dyn.optonline.net) (Quit: Client closed) |
2023-12-09 18:54:20 +0100 | <ski> | ok, sounds like you're looking for `foldl (.) id' / `flip (foldr (&))', then |
2023-12-09 18:54:42 +0100 | <ski> | `revCompose', i guess you could call it |
2023-12-09 18:55:18 +0100 | <ski> | (er, `flip (foldl (&))', i meant) |
2023-12-09 18:56:12 +0100 | <ski> | although .. i suppose it would probably make more sense to use foldl' for this, given that we will be bulky in the list regardless |
2023-12-09 18:56:14 +0100 | <[exa]> | slideshow6052: kinda sounds like `fix` tbh |
2023-12-09 18:56:28 +0100 | <[exa]> | ah I missed hte [] |
2023-12-09 18:56:41 +0100 | <ski> | @type iterate |
2023-12-09 18:56:42 +0100 | <lambdabot> | (a -> a) -> a -> [a] |
2023-12-09 18:58:25 +0100 | <[exa]> | :t ala Endo foldMap --- do we have this loaded? |
2023-12-09 18:58:26 +0100 | <lambdabot> | Foldable t => t (b -> b) -> b -> b |
2023-12-09 18:58:36 +0100 | <[exa]> | yay! |
2023-12-09 18:58:51 +0100 | <ski> | @type flip (scanl (&)) |
2023-12-09 18:58:52 +0100 | <lambdabot> | [a -> a] -> a -> [a] |
2023-12-09 18:59:29 +0100 | <Joao003> | context? |
2023-12-09 18:59:45 +0100 | <ski> | composing a list of functions |
2023-12-09 19:00:10 +0100 | <ski> | [exa] : how would the `choice' work ? |
2023-12-09 19:00:23 +0100 | <Joao003> | oh so like you have a list and you run each of them in order on an argument? |
2023-12-09 19:00:43 +0100 | <ski> | <slideshow6052> is there a built in function which takes [a->a] and an a and keeps applying it? |
2023-12-09 19:01:46 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2023-12-09 19:02:04 +0100 | <Joao003> | applyAll but it applies from the last function to the first function |
2023-12-09 19:02:21 +0100 | <Joao003> | @type applyAll |
2023-12-09 19:02:22 +0100 | <lambdabot> | error: Variable not in scope: applyAll |
2023-12-09 19:02:25 +0100 | <Joao003> | ... |
2023-12-09 19:02:31 +0100 | <Joao003> | in diagramslib |
2023-12-09 19:02:33 +0100 | <Joao003> | ... |
2023-12-09 19:02:39 +0100 | wryish | (~wryish@216.246.119.62) |
2023-12-09 19:02:46 +0100 | <Joao003> | hoogle sucks when you're trying to find in prelude only |
2023-12-09 19:03:24 +0100 | <ski> | @hoogle applyAll |
2023-12-09 19:03:24 +0100 | <lambdabot> | Diagrams.Util applyAll :: [a -> a] -> a -> a |
2023-12-09 19:03:37 +0100 | <ski> | is basically `compose' |
2023-12-09 19:03:45 +0100 | <Joao003> | @type compose |
2023-12-09 19:03:45 +0100 | <lambdabot> | error: |
2023-12-09 19:03:46 +0100 | <lambdabot> | • Variable not in scope: compose |
2023-12-09 19:03:46 +0100 | <lambdabot> | • Perhaps you meant one of these: |
2023-12-09 19:04:18 +0100 | <ski> | @let compose :: [a -> a] -> (a -> a); compose = foldr (.) id |
2023-12-09 19:04:19 +0100 | <lambdabot> | Defined. |
2023-12-09 19:04:48 +0100 | <Joao003> | @type foldl1 (flip ($)) |
2023-12-09 19:04:49 +0100 | <lambdabot> | error: |
2023-12-09 19:04:49 +0100 | <lambdabot> | • Occurs check: cannot construct the infinite type: a ~ a -> a |
2023-12-09 19:04:49 +0100 | <lambdabot> | Expected type: a -> a -> a |
2023-12-09 19:05:04 +0100 | <Joao003> | @djinn [a -> a] -> a -> a |
2023-12-09 19:05:04 +0100 | <lambdabot> | Error: Undefined type [] |
2023-12-09 19:05:09 +0100 | <Joao003> | . |
2023-12-09 19:05:21 +0100 | <geekosaur> | djinn doesn't do recursive types, sadly |
2023-12-09 19:05:24 +0100 | <ski> | i'd argue that `compose' is more generally useful than `revCompose', since the former will work on infinite lists (and will be incremental, for long finite lists, if you pass in an incremental callback), while `revCompose' won't |
2023-12-09 19:05:33 +0100 | <ski> | Djinn doesn't understand lists |
2023-12-09 19:05:48 +0100 | <ski> | @type foldl (&) |
2023-12-09 19:05:49 +0100 | <lambdabot> | Foldable t => a -> t (a -> a) -> a |
2023-12-09 19:06:23 +0100 | <Joao003> | @type flip (foldl (&)) |
2023-12-09 19:06:24 +0100 | <lambdabot> | Foldable t => t (c -> c) -> c -> c |
2023-12-09 19:06:41 +0100 | pavonia | (~user@user/siracusa) (Quit: Bye!) |
2023-12-09 19:06:47 +0100 | <ski> | @type foldl (flip (.)) |
2023-12-09 19:06:48 +0100 | <lambdabot> | Foldable t => (a -> b) -> t (b -> b) -> a -> b |
2023-12-09 19:06:54 +0100 | <ski> | @type foldl (flip (.)) id |
2023-12-09 19:06:55 +0100 | <lambdabot> | Foldable t => t (b -> b) -> b -> b |
2023-12-09 19:07:55 +0100 | <Joao003> | > flip $ foldl $ (&) [*3, +4] 4 |
2023-12-09 19:07:57 +0100 | <lambdabot> | error: |
2023-12-09 19:07:57 +0100 | <lambdabot> | A section must be enclosed in parentheses thus: (* 3)error: |
2023-12-09 19:07:57 +0100 | <lambdabot> | A section must be enclosed in parentheses thus: (+ 4) |
2023-12-09 19:08:04 +0100 | <Joao003> | > flip $ foldl $ (&) [(*3), (+4)] 4 |
2023-12-09 19:08:06 +0100 | <lambdabot> | error: |
2023-12-09 19:08:06 +0100 | <lambdabot> | • Could not deduce (Num a0) |
2023-12-09 19:08:06 +0100 | <lambdabot> | from the context: (Foldable t, Num a, |
2023-12-09 19:08:19 +0100 | <Joao003> | > flip (foldl (&)) [(*3), (+4)] 4 |
2023-12-09 19:08:20 +0100 | <lambdabot> | 16 |
2023-12-09 19:08:26 +0100 | <Joao003> | works! |
2023-12-09 19:08:39 +0100 | <ski> | yea .. was just about to say to quit the `$'s |
2023-12-09 19:09:14 +0100 | <ski> | > flip (scanl (&)) [(3 *),(4 +)] 4 |
2023-12-09 19:09:16 +0100 | <lambdabot> | [4,12,16] |
2023-12-09 19:09:41 +0100 | <Joao003> | scanl gives you a list of partial results |
2023-12-09 19:09:57 +0100 | <ski> | yes (off-by-one, one could say) |
2023-12-09 19:10:02 +0100 | <Joao003> | so that's what you want? |
2023-12-09 19:10:18 +0100 | <ski> | ask slideshow6052 ? |
2023-12-09 19:10:50 +0100 | <slideshow6052> | oh for now i just used f (x:xs) t = f xs (go t x); f [] t = t |
2023-12-09 19:11:00 +0100 | <slideshow6052> | i need to improve this all later my code is very bad |
2023-12-09 19:11:01 +0100 | <ski> | and `go' ? |
2023-12-09 19:11:23 +0100 | <tri> | i already install a package by cabal install, how do i use it in my source file to later use in ghci? Do i need to cabal init it? |
2023-12-09 19:11:24 +0100 | <slideshow6052> | go is defiuned somewhere else |
2023-12-09 19:11:31 +0100 | <slideshow6052> | but look i just got it working isn't this cool |
2023-12-09 19:11:33 +0100 | <ski> | mhm |
2023-12-09 19:11:40 +0100 | <Joao003> | can you show us `go'? |
2023-12-09 19:11:40 +0100 | <slideshow6052> | ghci> runner (Lam X (Lam Y (Var Y))) |
2023-12-09 19:11:40 +0100 | <slideshow6052> | \X. \Y. Y : (a -> (b -> b)) |
2023-12-09 19:11:52 +0100 | <slideshow6052> | basic type inference thingy |
2023-12-09 19:12:34 +0100 | <ski> | slideshow6052 : you may want to make sure that `f' is strict in `t' |
2023-12-09 19:12:52 +0100 | <Joao003> | if you still code like this: f (x:xs) t = f xs (go t x); f [] t = t |
2023-12-09 19:12:58 +0100 | <Joao003> | you might need to learn about folding |
2023-12-09 19:13:13 +0100 | <ski> | slideshow6052 : also, (unless `runner' is in `IO'), i'd suggest not using `Show' like that |
2023-12-09 19:13:44 +0100 | <slideshow6052> | runner is M -> IO () |
2023-12-09 19:13:59 +0100 | <ski> | ok, ignore that comment, then :) |
2023-12-09 19:14:04 +0100 | <slideshow6052> | yes my code is very bad atm |
2023-12-09 19:14:08 +0100 | <slideshow6052> | i still need to learn lots |
2023-12-09 19:14:16 +0100 | <Joao003> | i can help! |
2023-12-09 19:14:17 +0100 | <slideshow6052> | one sec i will go eat and then tidy it a bit and post it on here |
2023-12-09 19:14:34 +0100 | <slideshow6052> | and then you guys can suggest if you are not cringing at it too much haha |
2023-12-09 19:14:44 +0100 | <slideshow6052> | thank you |
2023-12-09 19:14:53 +0100 | <Joao003> | ^_^ |
2023-12-09 19:15:20 +0100 | <monochrom> | tri: There are two ways, depending on how toy your use case is. More toy: You have to include "--lib" in "cabal install --lib", then you can use it in raw ghci. More productional: Forget "cabal install", use "cabal init" and edit the *.cabal file to list dependencies. |
2023-12-09 19:15:51 +0100 | forell | (~forell@user/forell) (Quit: ZNC - https://znc.in) |
2023-12-09 19:16:08 +0100 | forell | (~forell@user/forell) |
2023-12-09 19:16:45 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2023-12-09 19:16:59 +0100 | <tri> | so i need to import that lib in to a haskell file first, and then will load that hs file into ghci |
2023-12-09 19:17:24 +0100 | <tri> | so i used cabal install, is it ok to use wihtout the --lib flag? |
2023-12-09 19:17:49 +0100 | <tri> | anyway, my hs file (i didn't use cabal init) complains that it doesn't see the lib when import |
2023-12-09 19:17:55 +0100 | <monochrom> | It is harmless. It just almost doesn't do anything. |
2023-12-09 19:18:11 +0100 | <tri> | im using the QuickCheck library |
2023-12-09 19:18:18 +0100 | <tri> | so i cabal install QuickCheck |
2023-12-09 19:18:23 +0100 | <monochrom> | Yeah you need --lib for libraries. |
2023-12-09 19:19:18 +0100 | <tri> | right, i saw the cabal install log to suggest using --lib so i ran it again with cabal install --lib QuickCheck. This time it says Resolving Dependencies.. Up to date |
2023-12-09 19:19:26 +0100 | <tri> | so clearly it's already on my system |
2023-12-09 19:19:29 +0100 | <monochrom> | Omitting --lib means you just want the executables. Well, QuickCheck comes with no executables. So vacuous success and nothing is done. :) |
2023-12-09 19:19:43 +0100 | <tri> | yea |
2023-12-09 19:19:52 +0100 | <tri> | I also see the package installed in .cabal directory |
2023-12-09 19:20:00 +0100 | <tri> | so that's on my system |
2023-12-09 19:20:14 +0100 | <tri> | but why my haskell file doesn't see it |
2023-12-09 19:20:20 +0100 | <sclv> | the lib flag should have added it to the ghc env file |
2023-12-09 19:20:29 +0100 | <sclv> | try and see if it works |
2023-12-09 19:20:46 +0100 | <monochrom> | In the Haskell code, you say "import Test.QuickCheck" etc. |
2023-12-09 19:21:13 +0100 | <monochrom> | At this point, you realize that package name ≠ module name because package ≠ module. |
2023-12-09 19:21:36 +0100 | <monochrom> | Soon you will discover many more levels of bureacracy than this. >:) |
2023-12-09 19:21:36 +0100 | <tri> | import Test.QuickCheck and import QuickCheck both squawked at me |
2023-12-09 19:22:15 +0100 | <tri> | monochrom: yes, im reading a book which use cabal sandbox, which is now removed from cabal so it's driving me crazy to figure cabal out |
2023-12-09 19:23:15 +0100 | <tri> | anyway, now i installed QuickCheck already, but hs file is not seeing it on import, where else do i need to configure this QuickCheck library? |
2023-12-09 19:23:15 +0100 | <sclv> | if you always use cabal packages and projects for development you need never call cabal install |
2023-12-09 19:23:23 +0100 | <Joao003> | What's your cabal version? |
2023-12-09 19:23:26 +0100 | <monochrom> | cabal sandbox commands can be easily mapped to today's cabal commands. So you don't have to give up the *.cabal file way. |
2023-12-09 19:23:33 +0100 | <sclv> | how are you loading the file? ghci or cabal? |
2023-12-09 19:23:44 +0100 | <tri> | i use ghci |
2023-12-09 19:24:06 +0100 | <tri> | and i am writing code in a .hs file, which later will be loaded into ghci |
2023-12-09 19:24:25 +0100 | <tri> | my cabal version is 3.6.2.0 |
2023-12-09 19:25:39 +0100 | <tri> | can someone help me? adding a package must not be this hard... |
2023-12-09 19:26:18 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2023-12-09 19:26:20 +0100 | <sclv> | cabal install —lib should have updated a ghc environment file to enable ghci to find the lib |
2023-12-09 19:26:41 +0100 | <sclv> | if thats not happening you should look at the env file, and the output of the install lib cmd |
2023-12-09 19:26:42 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2023-12-09 19:26:52 +0100 | <sclv> | or just use a package as we recommend! |
2023-12-09 19:27:34 +0100 | <tri> | what's the ghci env file name? |
2023-12-09 19:27:41 +0100 | <Joao003> | i'm here after a long break from haskell, can you challenge me so i can see if i forgot some stuff? |
2023-12-09 19:28:28 +0100 | <tri> | sclv: and also what do you recommend again? |
2023-12-09 19:29:00 +0100 | <sclv> | when you launch ghci it will tell you the env file it is loading |
2023-12-09 19:29:07 +0100 | ACuriousMoose | (~ACuriousM@142.166.18.53) |
2023-12-09 19:29:45 +0100 | <tri> | sclv: yea i see quickcheck is mentioned in the env file |
2023-12-09 19:29:48 +0100 | <sclv> | what we recommend is creating a package by running “cabal init” and adding your deps to the deps of that package, then developing that package. then you never need to manage deps manually |
2023-12-09 19:30:08 +0100 | <sclv> | ok if quickcheck is in the env file, then loading a file using it with ghci should now work |
2023-12-09 19:31:37 +0100 | <tri> | sclv: yea i can loads into ghci now, BUT the hs file still have compile error. Meaning, the language server doesn't see the package |
2023-12-09 19:31:41 +0100 | <monochrom> | I think I should see the exact error message first. |
2023-12-09 19:31:45 +0100 | <tri> | ok |
2023-12-09 19:31:49 +0100 | <tri> | i will screenshot |
2023-12-09 19:32:04 +0100 | <sclv> | use the pastebin in the channel desc |
2023-12-09 19:32:14 +0100 | <monochrom> | Oh language server. I don't know how to get that to work. I don't use it. |
2023-12-09 19:32:19 +0100 | jle` | (~jle`@2603-8001-3b02-84d4-bd21-edb6-1dc1-99d4.res6.spectrum.com) |
2023-12-09 19:32:23 +0100 | <sclv> | https://paste.tomsmeding.com/ |
2023-12-09 19:32:58 +0100 | <sclv> | language server doesn’t work well with random files. you need a package for it |
2023-12-09 19:32:59 +0100 | <tri> | monochrom: you are telling me you don't rely on real-time feedback of the language server? and have to compile the code to see where errors are?? |
2023-12-09 19:33:06 +0100 | Guest0 | (~Guest0@31.193.221.194) |
2023-12-09 19:33:38 +0100 | <tri> | like you guys just type in the text editor blindly without any syntax checking??? |
2023-12-09 19:33:45 +0100 | <monochrom> | I use emacs and its haskell-mode, it's just a ctrl-c ctrl-r away. |
2023-12-09 19:33:51 +0100 | <sclv> | most seasoned haskellers do. we’ve been writing well before there were ides |
2023-12-09 19:34:12 +0100 | <tri> | mother of god... |
2023-12-09 19:34:19 +0100 | <Joao003> | tri: (´°o°)´ =⊥_⊥ |
2023-12-09 19:34:43 +0100 | <tri> | you guys are hardcore... |
2023-12-09 19:34:50 +0100 | <sclv> | we out here, just rawdogging syntax. |
2023-12-09 19:34:59 +0100 | <tri> | it's like hiking with bare feet |
2023-12-09 19:35:08 +0100 | <monochrom> | NO |
2023-12-09 19:35:19 +0100 | <monochrom> | It's merely like hiking without jetpack. |
2023-12-09 19:35:22 +0100 | <Joao003> | we don't use ides, we use NOTEPAD |
2023-12-09 19:35:43 +0100 | <tri> | ok, notepad is too far |
2023-12-09 19:35:51 +0100 | <monochrom> | My analogy is deliberate. It is a roast. Jetpack defeats the point of hiking. |
2023-12-09 19:35:53 +0100 | <Joao003> | NOTEPAD and GHCI |
2023-12-09 19:36:12 +0100 | <slideshow6052> | ok i am back |
2023-12-09 19:36:22 +0100 | <yushyin> | i use C-x M-c M-butterfly |
2023-12-09 19:36:23 +0100 | <slideshow6052> | and here to be roasted |
2023-12-09 19:36:29 +0100 | <yushyin> | like a real programmer |
2023-12-09 19:36:52 +0100 | <Joao003> | Think of syntax highlighting as that smart kid in class who knows everything |
2023-12-09 19:37:13 +0100 | <slideshow6052> | here is the code https://paste.tomsmeding.com/jkKXglCM |
2023-12-09 19:37:20 +0100 | <slideshow6052> | please give feedback/advice |
2023-12-09 19:38:33 +0100 | <monochrom> | What's wrong with IDEs is they solve the symptom not the root problem. |
2023-12-09 19:38:55 +0100 | <tri> | ok i will try cabal init now. |
2023-12-09 19:39:14 +0100 | <Guest0> | Hey, I wanted to ask if there is a way to comunicate with the os without having to rely on FFI, to do things like opening sockets without third party libs. |
2023-12-09 19:39:50 +0100 | TheCatCollective | (NyaaTheKit@user/calculuscat) |
2023-12-09 19:40:13 +0100 | <monochrom> | And therefore we will still be stuck with "plain text files" for another decade. |
2023-12-09 19:40:30 +0100 | <[exa]> | Guest0: does libc count as "third party lib" ? |
2023-12-09 19:41:22 +0100 | <Joao003> | ô_ǒ |
2023-12-09 19:41:23 +0100 | <[exa]> | Guest0: or, like, do you want to do the syscall directly yourself? (that would be possible but not easily at all :D ) |
2023-12-09 19:41:51 +0100 | <Guest0> | Yeah i was thinking about the syscall |
2023-12-09 19:42:33 +0100 | <[exa]> | tri: btw I was trying some of the haskell IDE possibilities but in the end just editing stuff without disturbance and then calmly reading the ghc output to find about what's wrong turned out to be most productive |
2023-12-09 19:43:33 +0100 | <Joao003> | [exa]: Ü |
2023-12-09 19:43:34 +0100 | <monochrom> | Well, my students use vscode and hls, it's really helpful to them, they have shown me what it looks like. |
2023-12-09 19:43:42 +0100 | <monochrom> | I just don't need that much handholding. |
2023-12-09 19:44:04 +0100 | <slideshow6052> | i like ghicd |
2023-12-09 19:44:08 +0100 | <monochrom> | I need a little bit of aid and handholding, but not that much. |
2023-12-09 19:44:15 +0100 | <[exa]> | like, I might have some attention disorder or so but I tend to be quite disturbed by the stupid IDE tricks like "you certainly wanted to write this other parenthesis, here it is for you!" and "you didn't finish writing yet, lemme put a thiiiiiiiiick red warning all over the place" |
2023-12-09 19:44:24 +0100 | <slideshow6052> | it runs ghci in another terminal and refershes each time you write the file |
2023-12-09 19:44:51 +0100 | <monochrom> | I need to be told my errors, yes. But it's just a hot key away, I don't need it real time. |
2023-12-09 19:44:51 +0100 | <slideshow6052> | but i am not good at haskell so my opinion is not that relevant |
2023-12-09 19:45:11 +0100 | <monochrom> | I need auto-completion, yes. But it's just a hot key away, I don't need it real time. |
2023-12-09 19:45:24 +0100 | <[exa]> | Guest0: well that might require you to somehow put stuff into the output of c--, i.e. to pipe the description of your syscall all the way through Core, STG and other language layers |
2023-12-09 19:45:54 +0100 | <[exa]> | Guest0: tbh having a tiny FFI'd urchin instead will just help (also for making sure that stack behaves as the (expected) C stack etc.) |
2023-12-09 19:46:12 +0100 | <Guest0> | where can I read more about it? |
2023-12-09 19:46:33 +0100 | <[exa]> | good question. :D |
2023-12-09 19:46:45 +0100 | <[exa]> | people usually don't want to do this with haskell so you might need darker magicks |
2023-12-09 19:46:58 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2023-12-09 19:47:02 +0100 | <monochrom> | And I certainly don't appreciate how the hi-tech way also comes with the hi-brow ideology that insists on packages and "project"s. |
2023-12-09 19:47:20 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2023-12-09 19:47:23 +0100 | <[exa]> | Guest0: if no one responds here I'd try in #ghc and ask for pointers |
2023-12-09 19:47:26 +0100 | <monochrom> | Everything is not a package. Everything is not a project. |
2023-12-09 19:47:56 +0100 | <glguy> | slideshow6052: I use ghcid - especially when doing advent of code problems. I have it using -r so that my solutions run every time I save |
2023-12-09 19:47:57 +0100 | <Guest0> | Thanks a lot :) |
2023-12-09 19:48:10 +0100 | <[exa]> | monochrom: "apparently you weren't able to set up your project, here, try copilot to help you set up your project 50000% faster" |
2023-12-09 19:48:24 +0100 | <geekosaur> | the problem with doing linux syscalls directly is they change a lot. glibc hides this for you and knows which syscall to use with which kernel |
2023-12-09 19:48:44 +0100 | dsrt^ | (~cd@c-98-242-74-66.hsd1.ga.comcast.net) |
2023-12-09 19:49:09 +0100 | <int-e> | [exa]: have we gone meta yet? "how to structure your project to get the most out of copilot"? |
2023-12-09 19:49:23 +0100 | ski | . o O ( "It looks like you're trying to write Smalltalk in Haskell; here, let me helpfully translate your program to Smalltalk and fire up Squeak for you." ) |
2023-12-09 19:50:00 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) |
2023-12-09 19:50:04 +0100 | <int-e> | copy-lot |
2023-12-09 19:50:14 +0100 | <[exa]> | Guest0: on a very side note, if you just want to play with it, I've got my stupid-but-working assembly project here and it can certainly do syscalls from haskellish lazy evaluation directly: https://gitea.blesmrt.net/exa/uskel |
2023-12-09 19:50:55 +0100 | <Guest0> | Yeah I'll take a look |
2023-12-09 19:51:16 +0100 | bienjensu | (~user@user/bienjensu) (Ping timeout: 246 seconds) |
2023-12-09 19:51:41 +0100 | <[exa]> | int-e: that reminds me that stupid note I saw in nature the last week.... here https://www.nature.com/articles/d41586-023-03739-3 |
2023-12-09 19:51:46 +0100 | <ski> | slideshow6052 : right. i'd not use `Show' like that |
2023-12-09 19:52:33 +0100 | <int-e> | [exa]: Perfect, I'll take it. (It's a different niche, of course.) |
2023-12-09 19:53:25 +0100 | <monochrom> | Speaking of copi vs copy, when I was reading a Unix book a long time ago and when it came to uucp, it said "Unix-to-Unix CoPy", and for a decade I separated that into Co Py and wondered what it meant. |
2023-12-09 19:53:41 +0100 | <ski> | slideshow6052 : `Show' is for generating a string representation of *Haskell* code that, in the appropriate environment, will evaluate to an equal value. different `Show' instances are intended to work together. if we use `show' on `Maybe Lam', the result will be a mix of Haskell and non-Haskell |
2023-12-09 19:55:01 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 276 seconds) |
2023-12-09 19:57:12 +0100 | <[exa]> | Guest0: it's unlikely to be useful for anything practical, take the label "if you just want to tinker with stuff" seriously :D |
2023-12-09 19:57:42 +0100 | <monochrom> | Rust is great at explaining the Show business, by starting off with two classes instead of one, becasue "print it out for normal output" is different from "print it out for debugging messages". |
2023-12-09 19:57:57 +0100 | <ski> | slideshow6052 : even disregarding that, you should not be defining `show' for recursive datatypes, you should be defining `showsPrec', because (a) efficiency; and (b) handling brackets (which you do not do at all, currently, so your output is broken). anyway, if you want to pretty-print, define your own function for that, please don't use `Show' for pretty-printing or custom output format |
2023-12-09 19:59:04 +0100 | <slideshow6052> | ah i see |
2023-12-09 19:59:10 +0100 | <monochrom> | or rather, "for users" vs "for another programmer". |
2023-12-09 19:59:21 +0100 | <slideshow6052> | yeah i was using the repl a lot and got annoyed by Arr t1 t2 instead of t1 -> t2 |
2023-12-09 19:59:27 +0100 | <slideshow6052> | But youre right, i'll change that |
2023-12-09 19:59:34 +0100 | <slideshow6052> | also what do you mean by handling brackets? |
2023-12-09 19:59:49 +0100 | <ski> | slideshow6052 : you should probably use `data Substitution = Subst Int T deriving Show', mapping only (ids of) tyvars to types |
2023-12-09 19:59:57 +0100 | <monochrom> | "(x -> y) -> z" vs "x -> (y -> z)" |
2023-12-09 20:00:11 +0100 | <ski> | (also, "substitution" usually means not just a single mapping, but potentially mapping many identifiers to things) |
2023-12-09 20:00:38 +0100 | <ski> | monochrom : yea, they actually handled that case correctly (although redundantly, given right-associatedness of `->') |
2023-12-09 20:01:08 +0100 | <slideshow6052> | oh yep good point |
2023-12-09 20:01:09 +0100 | <ski> | slideshow6052 : `App (App Tru Tru) Tru' and `App Tru (App Tru Tru)' will display the same |
2023-12-09 20:01:27 +0100 | <monochrom> | Well, the issue becomes very accute when you have two infix operators. "x -> y * z". |
2023-12-09 20:02:19 +0100 | <slideshow6052> | are you using backticks by any chance? because my irc client i think automatically turns those into monospace but it looks weird with your message |
2023-12-09 20:02:23 +0100 | <monochrom> | at which point, you will eventually come to appreciate showsPrec, one way or another. |
2023-12-09 20:02:23 +0100 | Guest0 | (~Guest0@31.193.221.194) (Quit: Client closed) |
2023-12-09 20:02:39 +0100 | <haskellbridge> | 12<Celestial> Do I need to list all the modules my program has under `other-modules` in the cabal file or can I somehow tell it to take every file under the hs-source-dir? |
2023-12-09 20:02:58 +0100 | <ski> | slideshow6052 : i'm using TeX-style quotes, yes |
2023-12-09 20:02:58 +0100 | <slideshow6052> | oh right i see |
2023-12-09 20:03:06 +0100 | <geekosaur> | Celestial, you need to list all of them |
2023-12-09 20:03:29 +0100 | <monochrom> | Currently you have to list them all. A future cabal version plans to offer a wildcard syntax. |
2023-12-09 20:03:45 +0100 | pagnol | (~user@2a02:a210:a3c:b00:3e0f:bab7:90e2:2f26) |
2023-12-09 20:03:59 +0100 | erty | (~user@user/aeroplane) (Ping timeout: 268 seconds) |
2023-12-09 20:04:10 +0100 | <haskellbridge> | 12<Celestial> thanks, it's getting quite annoying to explicitly list all of them even though its "just" like 10 modules |
2023-12-09 20:04:28 +0100 | <pagnol> | Hi, would anyone happen to have a snippet that shows how to set up lsp with Haskell in (vanilla) Emacs? |
2023-12-09 20:04:47 +0100 | <monochrom> | "cabal sdist" is why some kind of "other-modules:" is necessary. (Wildcard or not being an orthogonal question.) |
2023-12-09 20:04:56 +0100 | <slideshow6052> | ah i see |
2023-12-09 20:06:17 +0100 | __monty__ | (~toonn@user/toonn) |
2023-12-09 20:06:21 +0100 | <slideshow6052> | i heard that using explicit recursion is less preferable to folds. for example, i list out the same cases for substTy, fv, and tvars. but how can i improve this? |
2023-12-09 20:06:46 +0100 | <monochrom> | I don't believe in that religion. |
2023-12-09 20:07:23 +0100 | <monochrom> | You and whoever you work with define what's elegant, then code to that. |
2023-12-09 20:07:43 +0100 | <monochrom> | The religion I believe in is simply "write for your audience". |
2023-12-09 20:08:06 +0100 | <ski> | slideshow6052 : in your `compose', i suppose i'd put the new element at the front, rather than at the back. also, in `go', i think you probably want to substitute everywhere inside y' .. not just check if it's itself a tyvar, and then substitute |
2023-12-09 20:08:15 +0100 | <monochrom> | OK, the other religion I believe in is "learn everything, know your options", so learn both ways and appreciate them. |
2023-12-09 20:08:32 +0100 | <ski> | slideshow6052 : i'd also use an accumulator for `fv' |
2023-12-09 20:08:39 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) (Read error: Connection reset by peer) |
2023-12-09 20:08:58 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2023-12-09 20:10:45 +0100 | <ski> | slideshow6052 : ditto for `tyvars' .. also, i think `rename' can run into trouble, since it's not doing simultaneous substitution |
2023-12-09 20:12:31 +0100 | <slideshow6052> | sorry to be a pain but would you mind using normal quotes or symmetric backticks instead? because the message atm is matching your opening and closing backticks and looks weird |
2023-12-09 20:12:58 +0100 | <slideshow6052> | i was following along with a lecture and that's the way we showed it so that's why i kept it at the back in compose |
2023-12-09 20:13:25 +0100 | <ski> | slideshow6052 : perhaps `unify' should fail gracefully, instead of `error'ing out on mismatch (or occurs check) |
2023-12-09 20:13:45 +0100 | <slideshow6052> | oh yep i should do that |
2023-12-09 20:14:23 +0100 | ski | would second both monochrom's statements there |
2023-12-09 20:14:34 +0100 | <slideshow6052> | yes i agree |
2023-12-09 20:14:34 +0100 | <ski> | learn why some people think |
2023-12-09 20:14:44 +0100 | <slideshow6052> | do you have any way how i could use folds here though |
2023-12-09 20:14:46 +0100 | <int-e> | ski: good one, why do we think? |
2023-12-09 20:14:47 +0100 | <slideshow6052> | like a starting idea |
2023-12-09 20:14:51 +0100 | <int-e> | it's so painful |
2023-12-09 20:15:01 +0100 | <ski> | learn why some people think explicit recursion is less preferable. learn how to not use explicit recursion. then decide for yourself, possibly on a case-by-case basis |
2023-12-09 20:15:26 +0100 | <slideshow6052> | ok i think i understand why but my issue is i don't see how i can use it in my program here |
2023-12-09 20:17:04 +0100 | <int-e> | for me it's mostly about having fewer stupid helper functions (which then require a name) |
2023-12-09 20:17:10 +0100 | <monochrom> | Yeah recognizing a catamorphism is not easy. Until you realize that it is purely syntactical and mechanical, there is nothing to understand, just shut up and calculate. :) |
2023-12-09 20:17:29 +0100 | <slideshow6052> | like i define the same pattern for functions involving T a few times.. but each case is a bit different so i don't see how it's gonna help |
2023-12-09 20:18:22 +0100 | <int-e> | foldl (+) 0 replaces sum = go 0 where go acc [] = acc; go acc (x:xs) = go (acc + x) xs |
2023-12-09 20:18:44 +0100 | <int-e> | (of course `sum` exists, but imagine it was a less common binary operation instead of (+)) |
2023-12-09 20:19:18 +0100 | <ski> | slideshow6052 : i don't think you should be using `State' for `Context'. `Reader' is more suited for that (or simply pass it as an explicit argument) |
2023-12-09 20:19:48 +0100 | <slideshow6052> | i i didn't know about reader ill look into that |
2023-12-09 20:19:54 +0100 | <Joao003> | int-e: or even sum [] = 0; sum (x:xs) = x + sum xs |
2023-12-09 20:19:57 +0100 | <slideshow6052> | yes initially i wanted to split that whole thing into two functions |
2023-12-09 20:20:02 +0100 | <int-e> | And emphasis is on *stupid*. If the function does something interesting I usually start with explicit recursion and keep it that way even if it's a fold. |
2023-12-09 20:20:08 +0100 | <int-e> | Joao003: that's a foldr though |
2023-12-09 20:20:28 +0100 | <Joao003> | but it does the same thing |
2023-12-09 20:21:07 +0100 | <int-e> | > (foldr (+) x [1..3], foldl (+) x [1..3]) |
2023-12-09 20:21:08 +0100 | <lambdabot> | (1 + (2 + (3 + x)),x + 1 + 2 + 3) |
2023-12-09 20:21:09 +0100 | <ski> | slideshow6052 : `State' for the `T' part (iow `fresh_tyvar') seems reasonable |
2023-12-09 20:21:16 +0100 | <Joao003> | i'm waiting for a challenge |
2023-12-09 20:21:24 +0100 | <slideshow6052> | like in C or something i can have a simple global called type_Var and each time I want a fresh one i just increase that by 1. but i was a bit confused on how to do it if i split it up. because then i would need to have an extra param for gen and also return an extra param from the other function telling me how much i incremented fresh_Var by. so i did that |
2023-12-09 20:21:24 +0100 | chiselfuse | (~chiselfus@user/chiselfuse) (Remote host closed the connection) |
2023-12-09 20:21:29 +0100 | <int-e> | it's only the same because + is (hopefully!) associative and commutative |
2023-12-09 20:21:39 +0100 | <monochrom> | Yeah Context (environment) is definitely a Reader. |
2023-12-09 20:22:00 +0100 | chiselfuse | (~chiselfus@user/chiselfuse) |
2023-12-09 20:22:13 +0100 | <slideshow6052> | oh ye i added the context there later as i realised while working on it that i didn't know which tyvars refer to which param haha so i just made it a tuple |
2023-12-09 20:22:27 +0100 | <ski> | and yea, `gen' could also use more graceful failure than `error |
2023-12-09 20:22:29 +0100 | <ski> | ' |
2023-12-09 20:23:41 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 245 seconds) |
2023-12-09 20:24:01 +0100 | <ski> | slideshow6052 : state for your current variable counter is fine. but it's not suited for the environment/context |
2023-12-09 20:24:02 +0100 | <monochrom> | If you use mutable state for environment, you are opening yourself to a bug or a lot of chore. |
2023-12-09 20:24:08 +0100 | <ski> | ^ |
2023-12-09 20:24:28 +0100 | <slideshow6052> | but i still need state then right? |
2023-12-09 20:24:35 +0100 | <ski> | yes, for the variable counter |
2023-12-09 20:24:35 +0100 | <slideshow6052> | how can i have a state and redaer? |
2023-12-09 20:24:47 +0100 | <ski> | StateT T (Reader Context) |
2023-12-09 20:24:50 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) |
2023-12-09 20:24:54 +0100 | <monochrom> | RWS >:) |
2023-12-09 20:25:18 +0100 | <Joao003> | i don't understand this state stuff |
2023-12-09 20:25:18 +0100 | <ski> | or the other way around |
2023-12-09 20:25:22 +0100 | <ski> | @unmtl StateT T (Reader Context) a |
2023-12-09 20:25:22 +0100 | <lambdabot> | T -> Context -> (a, T) |
2023-12-09 20:25:24 +0100 | <ski> | @unmtl ReaderT Context (State T) a |
2023-12-09 20:25:24 +0100 | <lambdabot> | Context -> T -> (a, T) |
2023-12-09 20:25:32 +0100 | <slideshow6052> | what does rws mean? |
2023-12-09 20:25:39 +0100 | <ski> | @unmtl StateT T (ReaderT Context Maybe) a |
2023-12-09 20:25:39 +0100 | <lambdabot> | T -> Context -> Maybe (a, T) |
2023-12-09 20:25:45 +0100 | <ski> | for graceful failure |
2023-12-09 20:25:47 +0100 | <monochrom> | It's a monolith of reader-writer-state |
2023-12-09 20:25:58 +0100 | <ski> | or use `Either TypeError' instead of `Maybe' |
2023-12-09 20:26:13 +0100 | <ski> | @unmtl RWS r w s a |
2023-12-09 20:26:13 +0100 | <lambdabot> | r -> s -> (a, s, w) |
2023-12-09 20:26:22 +0100 | <Joao003> | reciting: i don't understand this state stuff |
2023-12-09 20:26:29 +0100 | <ski> | @unmtl ReaderT r (WriterT w (State s)) a |
2023-12-09 20:26:29 +0100 | <lambdabot> | r -> s -> (a, w, s) |
2023-12-09 20:26:41 +0100 | <slideshow6052> | sorry how do i read this |
2023-12-09 20:26:45 +0100 | <slideshow6052> | what is StateT |
2023-12-09 20:26:56 +0100 | <ski> | it's the monad transformer version of `State' |
2023-12-09 20:27:18 +0100 | <ski> | used for combining state effects with other monads |
2023-12-09 20:27:21 +0100 | <slideshow6052> | ... |
2023-12-09 20:27:26 +0100 | <Joao003> | and what is a `State'? |
2023-12-09 20:27:26 +0100 | <slideshow6052> | so you can combine monads? |
2023-12-09 20:27:37 +0100 | <ski> | no, you can combine monad transformers with a monad |
2023-12-09 20:27:51 +0100 | <ski> | you don't combine monads themselves, typically |
2023-12-09 20:28:02 +0100 | <monochrom> | If M is a monad, then StateT S M a gives you S -> M (a, S), so you have both state and M effects. |
2023-12-09 20:28:37 +0100 | <ski> | (you can do `IO (IO Something)' or `Parser (TypeCheck Something)', if you like, i suppose .. but it's not what's meant by "combining" here) |
2023-12-09 20:29:00 +0100 | <ski> | @unmtl StateT S M a |
2023-12-09 20:29:00 +0100 | <lambdabot> | S -> M (a, S) |
2023-12-09 20:29:24 +0100 | <slideshow6052> | so what will be the type of my gen function if i wanted to both read and write? |
2023-12-09 20:29:31 +0100 | <slideshow6052> | also i never knew about this |
2023-12-09 20:29:35 +0100 | <slideshow6052> | just learnt about monads |
2023-12-09 20:29:48 +0100 | <slideshow6052> | and now you're telling me there's all this haha |
2023-12-09 20:29:57 +0100 | <slideshow6052> | i guess there is always more haskll |
2023-12-09 20:29:57 +0100 | <ski> | `@unmtl' will show you the "underlying" implementation, to double-check that you get the behaviour that you want |
2023-12-09 20:31:05 +0100 | <monochrom> | It is also OK to omit transformers for now and handroll your own monad that newtypes "S -> Context -> (a, S)". Which is what I do to my students. |
2023-12-09 20:31:29 +0100 | <ski> | slideshow6052 : i guess your `[Constraint]' argument to `gen' could also possibly be part of your state |
2023-12-09 20:31:42 +0100 | <slideshow6052> | monochrom would you happen to hvae an example worksheet or lecture or something for that? |
2023-12-09 20:31:52 +0100 | <ski> | (and your `[Goal]' part also could. but that could be a little bit more awkward, i guess) |
2023-12-09 20:33:07 +0100 | <ski> | in any case, it's probably a good idea to make your custom `TypeCheck' monad anyway, instead of explicitly naming `State',&c. in type signatures |
2023-12-09 20:33:12 +0100 | <monochrom> | Yeah https://www.cs.utoronto.ca/~trebla/CSCC24-2023-Summer/10-semantics-2.html#model look for MutM |
2023-12-09 20:33:40 +0100 | <monochrom> | In fact, I didn't even mention "monad". >:) |
2023-12-09 20:34:13 +0100 | <ski> | newtype TypeCheck a = MkTC {runTC :: State (T,Context) a} -- your current monad |
2023-12-09 20:34:29 +0100 | <ski> | gen :: [Constraint] -> [Goal] -> TypeCheck [Constraint] |
2023-12-09 20:34:31 +0100 | aruns | (~aruns@user/aruns) (Ping timeout: 245 seconds) |
2023-12-09 20:34:31 +0100 | <ski> | and so on |
2023-12-09 20:34:40 +0100 | <monochrom> | Later on, you also find out that I really have some kind of "Context -> MutM a" but I kept the "Context ->" separate. (It doesn't matter either way.) |
2023-12-09 20:34:59 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2023-12-09 20:35:39 +0100 | <ski> | newtype TypeCheck a = MkTC {runTC :: (T,Context) -> (a,T,Context)} -- or, if you prefer being explicit, and making your own `Monad' instance |
2023-12-09 20:35:57 +0100 | <statusbot> | Maintenance update: Hackage server going down for upgrade. -- http://status.haskell.org/pages/maintenance/537c07b0cf1fad5830000093/6574bd68258f4509bf35a548 |
2023-12-09 20:35:59 +0100 | <ski> | newtype TypeCheck a = MkTC {runTC :: StateT T (ReaderT Context (Either TypeError)) a} -- what we suggested |
2023-12-09 20:36:03 +0100 | <slideshow6052> | oh this all looks very useful thanks |
2023-12-09 20:36:09 +0100 | <slideshow6052> | thanks ski i have made notes of this |
2023-12-09 20:36:22 +0100 | <ski> | newtype TypeCheck a = MkTC {runTC :: T -> Context -> Either TypeError (a,T)} -- which amounts to this |
2023-12-09 20:37:16 +0100 | <slideshow6052> | unfortunately i won't be able to do any more haskell for a few months :( but i will be back with vengeance haha |
2023-12-09 20:37:24 +0100 | <slideshow6052> | i will implement your suggestions too |
2023-12-09 20:37:27 +0100 | falafel | (~falafel@94.red-79-153-65.dynamicip.rima-tde.net) |
2023-12-09 20:39:13 +0100 | <ski> | slideshow6052 : with a `newtype', using `StateT',&c., you can use `deriving (Functor,Applicative,Monad)' (if you enable the extensions for that). with the explicit version, you'll need to make your own instances of `Functor',`Applicative',`Monad' (although the first two can just defer to the last one, using `fmap = liftM', and `pure = return',`(<*>) = ap') |
2023-12-09 20:40:40 +0100 | <ski> | slideshow6052 : "i won't be able to do any more haskell for a few months" -- effective immediately ? |
2023-12-09 20:40:49 +0100 | not_reserved | (~not_reser@185.216.201.100) |
2023-12-09 20:41:33 +0100 | <monochrom> | I haven't done Haskell for months. But it was Lean instead so it was OK. >:) |
2023-12-09 20:41:54 +0100 | <monochrom> | "I now understand recursion." |
2023-12-09 20:42:44 +0100 | <slideshow6052> | yeh basically, well ill do a bit more tonight but i have other stuff to do |
2023-12-09 20:42:51 +0100 | ski | nods |
2023-12-09 20:43:14 +0100 | <slideshow6052> | but on the plus side, next semester im taking a class which uses agda |
2023-12-09 20:43:23 +0100 | <slideshow6052> | so i think that may be useful for haskell understanding |
2023-12-09 20:43:23 +0100 | <ski> | sounds fun |
2023-12-09 20:43:25 +0100 | <monochrom> | QED |
2023-12-09 20:43:31 +0100 | <ski> | QEF ! |
2023-12-09 20:43:53 +0100 | <ski> | (Quod Erat Faciendum) |
2023-12-09 20:44:05 +0100 | <ski> | ("Which was to be constructed". Euclid) |
2023-12-09 20:46:50 +0100 | <monochrom> | Oh hey OO has factorem abstractum. >:) |
2023-12-09 20:47:08 +0100 | jargon | (~jargon@32.sub-174-238-226.myvzw.com) |
2023-12-09 20:48:39 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) (Read error: Connection reset by peer) |
2023-12-09 20:48:58 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2023-12-09 20:51:01 +0100 | <slideshow6052> | but that you guys for help and have a good night |
2023-12-09 20:51:04 +0100 | <statusbot> | Maintenance update: Hackage Server back up, update complete. -- http://status.haskell.org/pages/maintenance/537c07b0cf1fad5830000093/6574bd68258f4509bf35a548 |
2023-12-09 20:51:05 +0100 | <slideshow6052> | or morning depending were you are |
2023-12-09 20:51:23 +0100 | <ski> | yw, good night, pleasant dreams |
2023-12-09 20:51:50 +0100 | <slideshow6052> | :) |
2023-12-09 20:53:23 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 260 seconds) |
2023-12-09 20:53:44 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) |
2023-12-09 20:54:36 +0100 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) (Quit: Lost terminal) |
2023-12-09 20:56:31 +0100 | renzhi | (~xp@2607:fa49:6500:b100::3ce6) |
2023-12-09 20:57:13 +0100 | euleritian | (~euleritia@dynamic-046-114-206-176.46.114.pool.telefonica.de) (Read error: Connection reset by peer) |
2023-12-09 20:57:26 +0100 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) |
2023-12-09 20:57:30 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2023-12-09 20:58:50 +0100 | cimento | (CO2@gateway/vpn/protonvpn/cimento) (Quit: WeeChat 4.1.2) |
2023-12-09 21:00:35 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 264 seconds) |
2023-12-09 21:01:15 +0100 | <tomsmeding> | is statusbot new? |
2023-12-09 21:01:34 +0100 | tri_ | (~textual@ool-18bc2e74.dyn.optonline.net) (Quit: Textual IRC Client: www.textualapp.com) |
2023-12-09 21:02:57 +0100 | <monochrom> | No, it's been around for a while. |
2023-12-09 21:03:20 +0100 | cimento | (CO2@gateway/vpn/protonvpn/cimento) |
2023-12-09 21:05:10 +0100 | <geekosaur> | it just doesn't say very much |
2023-12-09 21:05:30 +0100 | <geekosaur> | which is generally a good thing because a chatty statusbot means infrastructure problems |
2023-12-09 21:10:31 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 240 seconds) |
2023-12-09 21:13:54 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2023-12-09 21:14:12 +0100 | <Joao003> | just asking: do you use lambdabot or yahb2 for demoing code on this channel? |
2023-12-09 21:15:06 +0100 | <monochrom> | Yes I toss a coin and choose one. Unless when it matters. |
2023-12-09 21:15:53 +0100 | <Joao003> | > putStrLn "lambdabot." |
2023-12-09 21:15:55 +0100 | <lambdabot> | <IO ()> |
2023-12-09 21:15:58 +0100 | <sclv> | statusbot only posts when infra admins are disrupting service (or dealing with an unplanned service disruption) |
2023-12-09 21:16:03 +0100 | <ski> | usually lambdabot, unless i want/need something specific that yahb2 provides |
2023-12-09 21:16:05 +0100 | lane1 | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Ping timeout: 256 seconds) |
2023-12-09 21:16:14 +0100 | <Joao003> | % putStrLn "lambdabot. but yahb2 for io" |
2023-12-09 21:16:14 +0100 | <yahb2> | lambdabot. but yahb2 for io |
2023-12-09 21:17:29 +0100 | <tomsmeding> | geekosaur: fair :) |
2023-12-09 21:18:43 +0100 | <tomsmeding> | Joao003: lambdabot has a more packages in the environment, but yahb2 doesn't have the SafeHaskell requirement |
2023-12-09 21:21:37 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2023-12-09 21:21:50 +0100 | aruns | (~aruns@user/aruns) |
2023-12-09 21:26:43 +0100 | pagnol | (~user@2a02:a210:a3c:b00:3e0f:bab7:90e2:2f26) (Ping timeout: 255 seconds) |
2023-12-09 21:27:00 +0100 | coot | (~coot@89-69-206-216.dynamic.chello.pl) |
2023-12-09 21:28:14 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 21:35:57 +0100 | <tri> | hey sorry for a simple question, I have data Person a = PersonCtr a, how do i constraint a to use be of a typeclass, say Num? |
2023-12-09 21:36:10 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) (Remote host closed the connection) |
2023-12-09 21:36:33 +0100 | lane | (~lane@pool-98-113-180-17.nycmny.fios.verizon.net) |
2023-12-09 21:36:35 +0100 | <tri> | to be clear, i don't want to make an instance of of (Person a) under Num, just constraint the type variable a |
2023-12-09 21:36:52 +0100 | <tri> | I feel like i should know this, but probably having a brain fart |
2023-12-09 21:37:07 +0100 | <ski> | (no need to be sorry for asking simple questions) |
2023-12-09 21:37:17 +0100 | <geekosaur> | you don't, because if you did it would only check it on creation but not make it available when you really want it |
2023-12-09 21:37:30 +0100 | <ski> | the general answer is, you typically don't |
2023-12-09 21:37:54 +0100 | <tri> | oh yea i think i read about it, that we don't constaint typeclass on type variable |
2023-12-09 21:38:04 +0100 | <tri> | but only on function argument |
2023-12-09 21:38:51 +0100 | <ski> | (you can pack a constraint with `GADTs' .. but it's not that common that this is sensible. and the legacy way of saying `data Num a => Person a = PersonCtr a' is most likely not what you want (it's mostly useless), due to what geekosaur said) |
2023-12-09 21:39:22 +0100 | <ski> | if you have a lot of constraints, you can make a constraint synonym |
2023-12-09 21:39:50 +0100 | <ski> | type MyConstraints a = (Show a,Read a,Integral a) |
2023-12-09 21:41:25 +0100 | <tri> | ski: i've never seen that syntax before, is it uncommon? because I don't want to dive too much into the advanced, corner of haskell just yet, im still learning from a book |
2023-12-09 21:42:30 +0100 | <tomsmeding> | tri: you remembered correctly, you'll need to put that constraint on the functions using Person that require that constraint |
2023-12-09 21:42:34 +0100 | <ski> | yes, it's uncommon, since it's basically useless |
2023-12-09 21:42:53 +0100 | <tri> | ok thank you everyone |
2023-12-09 21:43:09 +0100 | <ski> | (this is like a deprecated corner) |
2023-12-09 21:43:23 +0100 | <tomsmeding> | there are various reasons why putting the constraint _in the data type_ is typically not what you want, even if there are some tricks that let you do it (GADTs) |
2023-12-09 21:43:48 +0100 | <tri> | yea, i heard ocaml have GADT, but let's not go there :) |
2023-12-09 21:44:04 +0100 | <tri> | totally not knowing what im talking about, just picked it up from a podcast |
2023-12-09 21:44:04 +0100 | <ski> | GHC does, too |
2023-12-09 21:45:32 +0100 | <tri> | 🙂 |
2023-12-09 21:45:37 +0100 | <tri> | oh i can send emoji |
2023-12-09 21:45:41 +0100 | <tri> | cool |
2023-12-09 21:45:55 +0100 | ski | , thankfully, can't see them |
2023-12-09 21:45:59 +0100 | <tri> | LOL |
2023-12-09 21:47:02 +0100 | Guest10 | (~Guest10@ool-18bc2e74.dyn.optonline.net) |
2023-12-09 21:47:08 +0100 | billchenchina | (~billchenc@103.152.35.21) (Quit: Leaving) |
2023-12-09 21:50:37 +0100 | coot | (~coot@89-69-206-216.dynamic.chello.pl) (Quit: coot) |
2023-12-09 21:51:31 +0100 | trev | (~trev@user/trev) (Quit: trev) |
2023-12-09 21:52:11 +0100 | falafel | (~falafel@94.red-79-153-65.dynamicip.rima-tde.net) (Ping timeout: 264 seconds) |
2023-12-09 21:56:34 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2023-12-09 21:56:52 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2023-12-09 21:58:02 +0100 | `2jt | (~jtomas@90.162.208.36) |
2023-12-09 22:00:14 +0100 | fendor | (~fendor@2a02:8388:1605:d100:267b:1353:13d7:4f0c) |
2023-12-09 22:01:32 +0100 | <haskellbridge> | 14<mauke> 😛 |
2023-12-09 22:02:01 +0100 | <monochrom> | Unpopular opinion: Emojis are overrated. |
2023-12-09 22:02:18 +0100 | <Joao003> | Unpopular opinion: we should use emoticons more |
2023-12-09 22:02:36 +0100 | ski | prefers smileys |
2023-12-09 22:03:09 +0100 | <tomsmeding> | 1😃 |
2023-12-09 22:04:43 +0100 | <Joao003> | Ô_Ǒ |
2023-12-09 22:05:24 +0100 | <Joao003> | 💀💀💀💀 |
2023-12-09 22:05:41 +0100 | <tomsmeding> | monochrom: happy now with the on-topic conversation? :) |
2023-12-09 22:05:47 +0100 | <Joao003> | y e s |
2023-12-09 22:06:02 +0100 | <[exa]> | c'mon guys people's ancient terminals explode on widechar unicode |
2023-12-09 22:06:09 +0100 | <Joao003> | lol |
2023-12-09 22:06:25 +0100 | <Joao003> | Ô_Ǒ |
2023-12-09 22:06:46 +0100 | <haskellbridge> | 12<Celestial> o_O |
2023-12-09 22:08:24 +0100 | Guest10 | (~Guest10@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 250 seconds) |
2023-12-09 22:08:43 +0100 | <Joao003> | .-. |
2023-12-09 22:09:45 +0100 | [exa] | slaps hood of pdp-7 printer "this baby does 300 standard width characters per second! you need no emoji!" |
2023-12-09 22:10:15 +0100 | <Joao003> | (`v•-•v´) |
2023-12-09 22:16:04 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 256 seconds) |
2023-12-09 22:16:09 +0100 | Joao003 | wants to be challenged |
2023-12-09 22:21:11 +0100 | <EvanR> | an old oscilliscope-like vector graphs display should be able to handle whatever unicode is required xD |
2023-12-09 22:21:15 +0100 | <EvanR> | graphics* |
2023-12-09 22:21:41 +0100 | <monochrom> | Now that's hardcore. |
2023-12-09 22:23:11 +0100 | <tri> | https://paste.tomsmeding.com/qZEXIezR |
2023-12-09 22:23:20 +0100 | <tri> | please help me with the above |
2023-12-09 22:23:43 +0100 | <tri> | im trying to implement a semigroup for Identity a = Identity a (Eq, Show) |
2023-12-09 22:23:54 +0100 | <monochrom> | instance Semigroup a => Semigroup (Identity a) |
2023-12-09 22:24:00 +0100 | <tri> | and stuck at using quickCheck to run random test for it |
2023-12-09 22:24:00 +0100 | <monochrom> | then you will not be stuck |
2023-12-09 22:24:13 +0100 | <tri> | oh hmm |
2023-12-09 22:24:55 +0100 | aruns | (~aruns@user/aruns) (Ping timeout: 246 seconds) |
2023-12-09 22:25:04 +0100 | <monochrom> | Hrm you really want x<>y = x? I guess that's also a semigroup. |
2023-12-09 22:25:32 +0100 | <monochrom> | But you can only quickcheck-test a type you pick, not "test polymorphic type". |
2023-12-09 22:25:32 +0100 | <tri> | oh i see what you saying, yea im not focus on the actual semigroup implementation |
2023-12-09 22:25:40 +0100 | <tri> | oh |
2023-12-09 22:25:52 +0100 | <[exa]> | tri: check out First in Data.Monoid |
2023-12-09 22:26:02 +0100 | <tri> | yea i know about First |
2023-12-09 22:26:35 +0100 | <tri> | I understand semigroup & monoid, just that im try to use the test library quickcheck and get stuck |
2023-12-09 22:26:48 +0100 | <ski> | pick say `Int' for `a' |
2023-12-09 22:27:05 +0100 | <tri> | yea but a could be anything right, is there anyway to run test for all? |
2023-12-09 22:27:13 +0100 | <ski> | no |
2023-12-09 22:27:23 +0100 | <tomsmeding> | "all types" is kind of a large number of types :) |
2023-12-09 22:28:06 +0100 | <monochrom> | There is still no "choose a random type". |
2023-12-09 22:28:07 +0100 | <ski> | but since `Semigroup (Identity a)' doesn't depend on any `Semigroup a', you're only depending on `Eq a'. `Eq Int' should be fine |
2023-12-09 22:28:12 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:1fe:ac5a:8c23:9cce) (Remote host closed the connection) |
2023-12-09 22:28:13 +0100 | <tomsmeding> | as in, if you give me a list of all types, I'll write the quickcheck code to test them all |
2023-12-09 22:28:56 +0100 | <tri> | yea i skipped the chapter on quickcheck so now struggling with it 🙁 |
2023-12-09 22:29:07 +0100 | <tri> | thanks for the help guys |
2023-12-09 22:29:08 +0100 | <ski> | (you could pick `a' as `Bool', but then you might miss counterexamples that require three different values. `Int' or `Integer' will probably work satisfactorially) |
2023-12-09 22:29:59 +0100 | falafel | (~falafel@94.red-79-153-65.dynamicip.rima-tde.net) |
2023-12-09 22:30:10 +0100 | <tri> | hmm, so how do i prove my <> implementation for Identity a is a monoid? |
2023-12-09 22:30:21 +0100 | <tri> | i mean semigroup |
2023-12-09 22:30:28 +0100 | <ski> | (and your `Semigroup (Identity a)' code does not depend on which type is picked for `a', it's parametric. so the only dependency of the particular choice of `a' would be `Eq a' (and `Arbitrary a', yes)) |
2023-12-09 22:31:04 +0100 | <ski> | testing can (in general) only show the presence of errors, not the absence |
2023-12-09 22:31:42 +0100 | <Logio> | tri: pen and paper usually works for proving |
2023-12-09 22:31:43 +0100 | <ski> | tri : pick `a' as `Int' or `Integer' |
2023-12-09 22:32:00 +0100 | <tri> | i have to prove that (Identity a <> Identity a) <> Identity a == Identity a <> (Identity a <> Identity a) |
2023-12-09 22:32:10 +0100 | <tri> | so i have to prove it for all type right? |
2023-12-09 22:32:20 +0100 | <ski> | s/a/a0/,s/a/a1/,s/a/a2/ |
2023-12-09 22:32:43 +0100 | <ski> | if you're doing a proof (so no QuickCheck), yes |
2023-12-09 22:33:08 +0100 | <tri> | oh ok |
2023-12-09 22:33:29 +0100 | _ht | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Remote host closed the connection) |
2023-12-09 22:34:09 +0100 | machinedgod | (~machinedg@93-136-130-2.adsl.net.t-com.hr) |
2023-12-09 22:34:26 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:1fe:ac5a:8c23:9cce) |
2023-12-09 22:34:43 +0100 | <tri> | i maybe too pedantic here, but is it common that we implement Monoid for custom business app type? Because that's my learning goal, to apply haskell to F#, and C# |
2023-12-09 22:34:43 +0100 | <ski> | (nitpick, the proof would presumably be for `... = ...', not for `... == ... = True', btw) |
2023-12-09 22:35:11 +0100 | <tri> | and if i ever implement a Monoid for a business type, but can't prove that it's correct, then it's a hazard |
2023-12-09 22:35:11 +0100 | <ski> | monoid is useful for various "summary" operations |
2023-12-09 22:35:35 +0100 | <ski> | it can also be useful, if you want to parallelize some computation |
2023-12-09 22:36:07 +0100 | <tri> | yea i read about Monoid being the foundation for parallelizing stuff, but that's too low-level and i may never go there |
2023-12-09 22:37:13 +0100 | <tri> | Im imagining about implement a monoid function for an order (i work at a trading company), and not being able to prove that function follows monoidal rule, then it's hazardous code |
2023-12-09 22:37:28 +0100 | <tri> | im not sure if that's a realistic scenario im thinking of |
2023-12-09 22:37:47 +0100 | <ski> | > sortBy (comparing length <> compare) (words "The quick brown fox jumps over the lazy dog") -- primarily sort on word length, secondarily on lexicographic order of words (having the same length) |
2023-12-09 22:37:49 +0100 | <lambdabot> | ["The","dog","fox","the","lazy","over","brown","jumps","quick"] |
2023-12-09 22:37:57 +0100 | <ski> | @where monoids |
2023-12-09 22:37:57 +0100 | <lambdabot> | comment on "Monoids? In my programming language?" by Cale in 2008 (or 2009 ?) at <http://www.reddit.com/r/programming/comments/7cf4r/monoids_in_my_programming_language/c06adnx> about a use of ` |
2023-12-09 22:37:57 +0100 | <lambdabot> | instance Monoid a => Monoid (rho -> a)' |
2023-12-09 22:39:57 +0100 | <monochrom> | I don't know what "business type" means. Is there a mathematical definition? |
2023-12-09 22:40:53 +0100 | tri- | (~igloo@ool-18bc2e74.dyn.optonline.net) |
2023-12-09 22:40:59 +0100 | <monochrom> | But the tautological answer is the only correct answer ever. Iff you find an operator that makes it a monoid and you find it useful. |
2023-12-09 22:41:41 +0100 | tri- | (~igloo@ool-18bc2e74.dyn.optonline.net) (Remote host closed the connection) |
2023-12-09 22:41:51 +0100 | <tri> | oh sorry didn't mean to type that above sentence, was a keyboard misttyped |
2023-12-09 22:42:29 +0100 | <monochrom> | Configurations are usually monoids. |
2023-12-09 22:43:12 +0100 | <monochrom> | It's pretty much the same reason First a is a monoid, and you do it for every field in your configuration record. |
2023-12-09 22:43:27 +0100 | tri- | (~igloo@ool-18bc2e74.dyn.optonline.net) |
2023-12-09 22:44:05 +0100 | Guest10 | (~Guest10@ool-18bc2e74.dyn.optonline.net) |
2023-12-09 22:44:06 +0100 | tri- | (~igloo@ool-18bc2e74.dyn.optonline.net) (Remote host closed the connection) |
2023-12-09 22:44:29 +0100 | fendor | (~fendor@2a02:8388:1605:d100:267b:1353:13d7:4f0c) (Remote host closed the connection) |
2023-12-09 22:44:51 +0100 | <monochrom> | In this case though it is useful because "defaultConfig <> stuffFromConfigFile <> stuffFromCmdLine <> ..." is extremely convenient and clear. |
2023-12-09 22:45:05 +0100 | Guest10 | (~Guest10@ool-18bc2e74.dyn.optonline.net) (Client Quit) |
2023-12-09 22:46:10 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2023-12-09 22:48:56 +0100 | falafel | (~falafel@94.red-79-153-65.dynamicip.rima-tde.net) (Ping timeout: 256 seconds) |
2023-12-09 22:48:57 +0100 | <fluffyballoon> | Is there any good place to report bugs? There's a doc typo ("stirctly" -> "strictly") in https://hackage.haskell.org/package/strict-0.5/docs/src/System.IO.Strict.html#getContents |
2023-12-09 22:49:47 +0100 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 264 seconds) |
2023-12-09 22:51:23 +0100 | <geekosaur> | most packages have a bug tracker listed on their top hackage page |
2023-12-09 22:51:40 +0100 | <monochrom> | You take a step back to https://hackage.haskell.org/package/strict-0.5 , then look for "home page" etc. |
2023-12-09 22:53:53 +0100 | <fluffyballoon> | Thank you geekosaur and monochrom, I was looking for mailing lists, instead. |
2023-12-09 22:58:25 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2023-12-09 22:59:13 +0100 | jtomas | (~jtomas@90.162.208.36) |
2023-12-09 23:00:52 +0100 | mechap | (~mechap@user/mechap) (Quit: WeeChat 4.1.2) |
2023-12-09 23:01:38 +0100 | mechap | (~mechap@user/mechap) |
2023-12-09 23:02:23 +0100 | `2jt | (~jtomas@90.162.208.36) (Ping timeout: 264 seconds) |
2023-12-09 23:12:17 +0100 | <Joao003> | @type fix (pure []) |
2023-12-09 23:12:18 +0100 | <lambdabot> | [a] |
2023-12-09 23:12:26 +0100 | <Joao003> | @type fix |
2023-12-09 23:12:27 +0100 | <lambdabot> | (a -> a) -> a |
2023-12-09 23:12:49 +0100 | <Joao003> | @type fix (pure :: List) |
2023-12-09 23:12:50 +0100 | <lambdabot> | error: |
2023-12-09 23:12:50 +0100 | <lambdabot> | • Pattern synonym ‘List’ used as a type |
2023-12-09 23:12:50 +0100 | <lambdabot> | • In an expression type signature: List |
2023-12-09 23:12:55 +0100 | <Joao003> | @type fix (pure :: [a]) |
2023-12-09 23:12:55 +0100 | <ski> | Monad (rho ->) |
2023-12-09 23:12:56 +0100 | <lambdabot> | error: |
2023-12-09 23:12:56 +0100 | <lambdabot> | • Couldn't match expected type ‘[a2]’ |
2023-12-09 23:12:56 +0100 | <lambdabot> | with actual type ‘a1 -> f0 a1’ |
2023-12-09 23:13:18 +0100 | <ski> | @type fix (pure :: (->) [a] [a]) |
2023-12-09 23:13:19 +0100 | <lambdabot> | error: |
2023-12-09 23:13:19 +0100 | <lambdabot> | • Occurs check: cannot construct the infinite type: a1 ~ [a1] |
2023-12-09 23:13:19 +0100 | <lambdabot> | Expected type: [a1] -> [a1] |
2023-12-09 23:13:24 +0100 | <Joao003> | What does that mean |
2023-12-09 23:13:41 +0100 | <ski> | @type fix (pure [] :: (->) [a] [a]) |
2023-12-09 23:13:42 +0100 | <lambdabot> | [a] |
2023-12-09 23:13:53 +0100 | <ski> | (sorry, missed spelling out the `[]') |
2023-12-09 23:14:22 +0100 | <Joao003> | Is that really the type of the list [[[[[...]]]]] |
2023-12-09 23:14:27 +0100 | <ski> | no |
2023-12-09 23:14:41 +0100 | <Joao003> | Then what is it |
2023-12-09 23:14:48 +0100 | <ski> | pure :: a -> i a |
2023-12-09 23:15:01 +0100 | <ski> | pick this `a' to be `[a]', for a new tyvar `a' |
2023-12-09 23:15:08 +0100 | <ski> | pure :: [a] -> i [a] |
2023-12-09 23:15:08 +0100 | <monochrom> | It may be more interesting to wonder what fix (pure []) does. >:) |
2023-12-09 23:15:18 +0100 | <ski> | [] :: [a] |
2023-12-09 23:15:21 +0100 | <ski> | so |
2023-12-09 23:15:25 +0100 | <ski> | pure [] :: i [a] |
2023-12-09 23:15:57 +0100 | <ski> | now, pick `i' to be `(rho ->)' / `(->) rho' (which is an instance of `Functor',`Applicative', and `Monad') |
2023-12-09 23:16:08 +0100 | <ski> | pure [] :: (rho ->) [a] |
2023-12-09 23:16:18 +0100 | <ski> | pure [] :: (->) rho [a] |
2023-12-09 23:16:21 +0100 | <ski> | pure [] :: rho -> [a] |
2023-12-09 23:16:29 +0100 | <ski> | now, pick `rho' to be `[a]' |
2023-12-09 23:16:33 +0100 | <ski> | pure [] :: [a] -> [a] |
2023-12-09 23:16:40 +0100 | <ski> | fix :: (b -> b) -> b |
2023-12-09 23:16:44 +0100 | <ski> | pick `b' as `[a]' |
2023-12-09 23:16:51 +0100 | <ski> | fix :: ([a] -> [a]) -> [a] |
2023-12-09 23:16:54 +0100 | <ski> | finally |
2023-12-09 23:17:03 +0100 | <ski> | fix (pure []) :: [a] |
2023-12-09 23:17:37 +0100 | <ski> | `pure []' here is basically `\xs -> []' |
2023-12-09 23:18:11 +0100 | <ski> | so `fix (pure [])' is `let xs = (\xs -> []) xs in xs', which is `let xs = [] in xs', which is `[]' |
2023-12-09 23:18:23 +0100 | <Joao003> | am i the only one who hates having to quote like `this' |
2023-12-09 23:19:28 +0100 | Joao003 | (~Joao003@190.108.99.32) (Quit: Bye!) |
2023-12-09 23:19:54 +0100 | <geekosaur> | I think ski's the only one who uses Oxford quotes |
2023-12-09 23:19:59 +0100 | <geekosaur> | (here at least) |
2023-12-09 23:20:20 +0100 | <ski> | (afaicr, yea) |
2023-12-09 23:20:37 +0100 | <monochrom> | I think there are two: you and someone else today. |
2023-12-09 23:21:00 +0100 | <monochrom> | earlier today |
2023-12-09 23:21:23 +0100 | <geekosaur> | I use ` because some IRC clients recognize it as "use fixed width font" |
2023-12-09 23:21:50 +0100 | <ski> | ingrained habit, on my end |
2023-12-09 23:22:19 +0100 | <monochrom> | It's telephone games all the way down. All is lost. |
2023-12-09 23:22:23 +0100 | driib | (~driib@vmi931078.contaboserver.net) (Quit: The Lounge - https://thelounge.chat) |
2023-12-09 23:23:09 +0100 | <ski> | "telephone games" ? |
2023-12-09 23:23:18 +0100 | coot | (~coot@89-69-206-216.dynamic.chello.pl) |
2023-12-09 23:23:28 +0100 | <ski> | hm, is that the same as what's apparently called "chinese whispers" in english ? |
2023-12-09 23:23:37 +0100 | <monochrom> | Yes. |
2023-12-09 23:23:56 +0100 | <ski> | hm, looks like it |
2023-12-09 23:24:03 +0100 | <ski> | (it's called something else, here) |
2023-12-09 23:24:44 +0100 | <monochrom> | If you have a linear sequence of people, or a layer cake of software, then every person/layer feels obliged to add a misinterpretation. |
2023-12-09 23:25:23 +0100 | <monochrom> | "to show that I understand" |
2023-12-09 23:26:32 +0100 | driib | (~driib@vmi931078.contaboserver.net) |
2023-12-09 23:28:01 +0100 | <ski> | reminds me of that idea that the longer the chain of command, the greater the chance of the field information getting distorted along the way up, and the greater the chance of directions to implement also getting distorted, on the way down |
2023-12-09 23:32:44 +0100 | dhil | (~dhil@2001:8e0:2014:3100:3783:1717:6803:631d) (Ping timeout: 268 seconds) |
2023-12-09 23:36:01 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
2023-12-09 23:38:31 +0100 | drdo4 | (~drdo@bl14-14-49.dsl.telepac.pt) |
2023-12-09 23:39:16 +0100 | drdo | (~drdo@bl14-14-49.dsl.telepac.pt) (Ping timeout: 276 seconds) |
2023-12-09 23:39:16 +0100 | drdo4 | drdo |
2023-12-09 23:47:13 +0100 | TobiasAbramovitz | (~TobiasAbr@71.134.151.220) |
2023-12-09 23:47:56 +0100 | <TobiasAbramovitz> | Hello, how is everyone doing today? |
2023-12-09 23:48:43 +0100 | <ski> | a bit sleepy |
2023-12-09 23:51:31 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) |
2023-12-09 23:51:47 +0100 | Sgeo | (~Sgeo@user/sgeo) |
2023-12-09 23:55:30 +0100 | tommy___ | (~tommy@2601:681:5a00:a260:2216:9438:8afd:c460) |
2023-12-09 23:56:37 +0100 | nate4 | (~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 246 seconds) |