Logs on 2024-08-08 (liberachat/#haskell)
| 00:00:10 | × | Tuplanolla quits (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
| 00:07:44 | × | tabaqui quits (~root@87.200.123.114) (Ping timeout: 260 seconds) |
| 00:07:59 | → | tabemann joins (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) |
| 00:09:07 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 264 seconds) |
| 00:22:13 | × | falafel quits (~falafel@2a0c:5a87:3104:4c01::bfe0) (Ping timeout: 248 seconds) |
| 00:48:41 | × | anpad quits (~pandeyan@user/anpad) (Quit: ZNC 1.8.2 - https://znc.in) |
| 00:50:02 | → | anpad joins (~pandeyan@user/anpad) |
| 00:58:47 | × | shoggouth quits (uid607148@user/shoggouth) (Quit: Connection closed for inactivity) |
| 01:02:52 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 01:11:38 | × | oo_miguel quits (~Thunderbi@78.10.207.46) (Ping timeout: 245 seconds) |
| 01:14:37 | × | euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
| 01:16:00 | → | euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
| 01:22:04 | × | xff0x quits (~xff0x@2405:6580:b080:900:bb9f:ea83:5088:5a06) (Ping timeout: 265 seconds) |
| 01:22:55 | → | joeyadams joins (~joeyadams@2603:6010:5100:2ed:3050:6687:6772:1195) |
| 01:24:35 | → | nunggu joins (~q@user/nunggu) |
| 01:26:35 | × | tomku quits (~tomku@user/tomku) (Ping timeout: 244 seconds) |
| 01:32:11 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 01:58:37 | × | waleee quits (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 244 seconds) |
| 01:58:58 | × | ZharMeny quits (~user@user/ZharMeny) (Quit: Fatal error 11: Segmentation fault) |
| 02:10:02 | → | xff0x joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) |
| 02:10:19 | × | whatsupdoc quits (uid509081@id-509081.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
| 02:11:15 | × | euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Remote host closed the connection) |
| 02:11:29 | → | euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
| 02:14:51 | × | gentauro quits (~gentauro@user/gentauro) (Read error: Connection reset by peer) |
| 02:18:30 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds) |
| 02:20:58 | → | gentauro joins (~gentauro@user/gentauro) |
| 02:30:39 | × | td_ quits (~td@i5387090B.versanet.de) (Ping timeout: 260 seconds) |
| 02:32:06 | → | td_ joins (~td@i53870904.versanet.de) |
| 02:51:46 | × | joeyadams quits (~joeyadams@2603:6010:5100:2ed:3050:6687:6772:1195) (Quit: Leaving) |
| 03:03:43 | × | aforemny quits (~aforemny@2001:9e8:6cc6:2f00:b85e:457c:6740:c35) (Ping timeout: 244 seconds) |
| 03:04:35 | → | aforemny joins (~aforemny@i59F516DA.versanet.de) |
| 03:08:45 | → | tomku joins (~tomku@user/tomku) |
| 03:09:30 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 03:10:33 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 03:10:57 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 244 seconds) |
| 03:11:56 | Lord_of_Life_ | is now known as Lord_of_Life |
| 03:34:49 | × | CrunchyFlakes quits (~CrunchyFl@ip92348280.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
| 03:37:14 | → | CrunchyFlakes joins (~CrunchyFl@146.52.130.128) |
| 03:52:23 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 265 seconds) |
| 04:01:55 | → | aforemny_ joins (~aforemny@2001:9e8:6cec:9200:56df:dd94:8882:31ea) |
| 04:03:08 | × | aforemny quits (~aforemny@i59F516DA.versanet.de) (Ping timeout: 255 seconds) |
| 04:10:55 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 04:26:57 | → | famubu joins (~julinuser@user/famubu) |
| 04:27:33 | <famubu> | Hi. I wished to use a package from hackage which provides a command invokable from the terminal. How can I install such a package? |
| 04:28:06 | <famubu> | I only know how to install with cabal, but that seems to work only when the package is added to a particular project? |
| 04:28:25 | <famubu> | Would `cabal get package-name` be the way to go? |
| 04:29:04 | <Axman6> | cabal install foo will install the executables that that package defines |
| 04:29:39 | <haskellbridge> | <bdub> but I believe the best way is too just insert as a dep in your .cabal rather than use cabal install correct me if I am wrong |
| 04:30:08 | <geekosaur> | it's an executable, not a library |
| 04:30:10 | <Axman6> | so `cabal install stylish-haskell` will install the stylish-haskell executable in ~/.cabal/bin/ |
| 04:30:18 | <geekosaur> | `cabal install pkgname` is the right thing to do |
| 04:31:41 | <geekosaur> | just make sure it's installing somewhere on your $PATH. if you're using old-style paths then it installs to ~/.cabal/bin; if XDG, it'll be ~/.local/bin |
| 04:31:53 | <geekosaur> | you can change both of these in the cabal config file |
| 04:32:10 | <geekosaur> | (~/.cabal/config or ~/.config/cabal/config) |
| 04:32:25 | → | danse-nr3 joins (~danse-nr3@user/danse-nr3) |
| 04:36:18 | <famubu> | Thanks. |
| 04:37:03 | <famubu> | I was trying to install this package: regex-genex. But cabal shows error when building one of its dependencies (stream-monad-0.3). I guess there's nothing to be done to fix that. |
| 04:38:08 | <famubu> | This was the error: https://bpa.st/FGDA |
| 04:38:10 | <haskellbridge> | <bdub> Never give into despair, the compiler is your friend |
| 04:38:40 | <haskellbridge> | <bdub> I am new myself to Haskell but sounds like a build error with versions of what your trying to work with |
| 04:39:16 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 265 seconds) |
| 04:40:04 | <famubu> | Oh.. |
| 04:40:43 | <haskellbridge> | <bdub> I am new myself so take that with a grain of salt |
| 04:40:50 | <mauke> | oh, that's some old code |
| 04:42:10 | <geekosaur> | yeh, it needs to be updated for MonadFail |
| 04:42:49 | <geekosaur> | https://hackage.haskell.org/package/base-4.20.0.1/docs/Control-Monad-Fail.html |
| 04:43:28 | <danse-nr3> | or switch to a different library famubu |
| 04:43:38 | <danse-nr3> | good morning all o/ |
| 04:43:49 | <mauke> | not exactly hard, but sucks if you're only trying to use some other package that has it as a dependency |
| 04:45:08 | <mauke> | alternatively, get a ghc version 8.6 or older (?) |
| 04:47:29 | <danse-nr3> | that seems an old version of regex-genex |
| 04:47:56 | <danse-nr3> | 0.6.1 |
| 04:48:46 | <danse-nr3> | well, not that old, but there is 0.7 |
| 04:49:15 | <danse-nr3> | checking reverse dependencies on hackage and your list of packages to install, i guess you are depending on it directly |
| 04:49:16 | <famubu> | Does anyone know of a similar library? I am looking for a way to generate strings corresponding a given regex. |
| 04:52:05 | <danse-nr3> | hmm version 0.7 on github imports stream-monad without bounds https://github.com/audreyt/regex-genex/blob/master/regex-genex.cabal#L23 |
| 04:53:40 | <danse-nr3> | but also last version of stream monad seems to derive monad fail without using MonadFail https://github.com/sebfisch/stream-monad/blob/master/src/Control/Monad/Stream.hs |
| 04:54:33 | <danse-nr3> | issues from ten years ago https://github.com/sebfisch/stream-monad/issues?q=is%3Aopen+is%3Aissue |
| 04:55:07 | <danse-nr3> | yeah different library i guess, but i cannot recommend one off the top of my head |
| 05:00:36 | <famubu> | Found this list: https://stackoverflow.com/questions/274011/random-text-generator-based-on-regex/43377488#43377488 |
| 05:00:43 | <famubu> | Going to try few of them. |
| 05:03:31 | <danse-nr3> | corresponding category on hackage doesn't seem very promising https://hackage.haskell.org/packages/#cat:Regex |
| 05:03:35 | → | michalz joins (~michalz@185.246.207.217) |
| 05:04:58 | × | down200 quits (~down200@shell.lug.mtu.edu) (Ping timeout: 245 seconds) |
| 05:05:17 | → | down200 joins (~down200@shell.lug.mtu.edu) |
| 05:10:00 | <probie> | Intrusive thought of the day, why write the verbose `foo x = let baz = bar x in quux baz` when you can just write `foo x|baz<-bar x=quux baz` |
| 05:11:54 | <mauke> | foo (bar -> baz) = |
| 05:12:19 | <danse-nr3> | foo = quux . bar |
| 05:12:51 | <mauke> | map f ((f -> x) : (map f -> xs)) = x : xs |
| 05:13:32 | <haskellbridge> | <bdub> f = q . b |
| 05:13:33 | <haskellbridge> | <bdub> lol I have no idea wtf is going on LOL |
| 05:13:34 | <haskellbridge> | <bdub> and I just said lol twice, that means its bedtime |
| 05:13:44 | <danse-nr3> | you sure the first is the same as the second probie? |
| 05:14:10 | <danse-nr3> | sleep well bdub |
| 05:15:12 | <Axman6> | foo(bar->(quux->x))=x |
| 05:16:03 | <Axman6> | C or Haskell? We'll never know |
| 05:16:06 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 260 seconds) |
| 05:16:07 | <probie> | % p = pure |
| 05:16:07 | <yahb2> | <no output> |
| 05:16:22 | <danse-nr3> | % :t pure |
| 05:16:22 | <yahb2> | pure :: Applicative f => a -> f a |
| 05:16:27 | <probie> | % do{n<-(+1);m<-(+2);p$n*m}$2 |
| 05:16:27 | <yahb2> | 12 |
| 05:16:46 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 05:17:14 | <probie> | % k = const |
| 05:17:14 | <yahb2> | <no output> |
| 05:18:19 | <probie> | % do{n<-(+1);m<-(+2);a<-k$42;k$42+n*m}$2 |
| 05:18:19 | <yahb2> | 54 |
| 05:19:27 | <probie> | I think I've been writing Haskell wrong this whole time |
| 05:19:41 | <danse-nr3> | yeah (-> a)'s monadic instance, but it's frowned upon by many |
| 05:20:43 | <danse-nr3> | personally i kind of like it |
| 05:21:22 | <haskellbridge> | <bdub> Just a newbie trying to learn.. why is it frowned upon by other haskellers? |
| 05:21:56 | <danse-nr3> | (-> a) being a monad. Not something you want to wrap your head around as a beginner i guess, may find it confusing |
| 05:22:56 | <haskellbridge> | <bdub> I get it.. ill stay in my little corner.... for now |
| 05:22:58 | <probie> | If you see an expression like `(*)<$>(+1)<*>(+2)` and haven't seen the idiom before, what do you do? You probably ask for the types of `(<$>)` and `(<*>)`, but what's returned doesn't tell you what is going on |
| 05:23:28 | <danse-nr3> | so |
| 05:24:01 | <probie> | and the correct response upon seeing it is to wonder how caleskell ended up in base |
| 05:24:16 | <Axman6> | I wrote some code the other day that looked like Foo (_brField <$> bar) (_barField2 <$> bar) (_barField3 <$> bar) and I was sure there must be a nice way to write it as something like Foo <$> _barField <*> _barField2 <*> _barField3 but I couldn't figur it out (though I think I have now... just needs to be passed to <$> bar) |
| 05:24:18 | × | krei-se quits (~krei-se@p57af2b6c.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 05:24:37 | <danse-nr3> | % :t \c -> && <$> (=='a') <*> (=='b') |
| 05:24:37 | <yahb2> | <interactive>:1:7: error: parse error on input ‘&&’ |
| 05:24:45 | <danse-nr3> | % :t \c -> (&&) <$> (=='a') <*> (=='b') |
| 05:24:45 | <yahb2> | \c -> (&&) <$> (=='a') <*> (=='b') :: p -> Char -> Bool |
| 05:24:49 | <haskellbridge> | <bdub> Isnt this called Penetrating? |
| 05:24:53 | <danse-nr3> | is the same as |
| 05:24:59 | <danse-nr3> | uh i wouldn't say so |
| 05:24:59 | <Axman6> | Hmmm, it could have been quite nice as bar <&> liftA3 Foo _f1 _f2 _f3 |
| 05:25:08 | <danse-nr3> | is the same as |
| 05:25:30 | <danse-nr3> | % :t \c -> c == 'a' && c=='b' |
| 05:25:30 | <yahb2> | \c -> c == 'a' && c=='b' :: Char -> Bool |
| 05:25:44 | <Axman6> | % data Foo = Foo {_f1 :: Bool, _f2 :: String, _f3 :: Int} |
| 05:25:44 | <yahb2> | <no output> |
| 05:25:44 | <danse-nr3> | in this case the latter is more readable |
| 05:26:06 | → | krei-se joins (~krei-se@p57af2d39.dip0.t-ipconnect.de) |
| 05:26:07 | <Axman6> | % :t liftA3 (,,) _f1 _f2 _f3 |
| 05:26:07 | <yahb2> | <interactive>:1:1: error: ; Variable not in scope: ; liftA3 ; :: (a0 -> b0 -> c0 -> (a0, b0, c0)) ; -> (Foo -> Bool) -> (Foo -> String) -> (Foo -> Int) -> t |
| 05:26:09 | <danse-nr3> | but when composing functions, using the instance can often be more readable in my opinion |
| 05:26:16 | <probie> | The most readable version is |
| 05:26:20 | <danse-nr3> | caleskell? |
| 05:26:28 | <Axman6> | % import Control.Applicative |
| 05:26:28 | <yahb2> | <no output> |
| 05:26:29 | <Axman6> | % :t liftA3 (,,) _f1 _f2 _f3 |
| 05:26:29 | <yahb2> | liftA3 (,,) _f1 _f2 _f3 :: Foo -> (Bool, String, Int) |
| 05:26:42 | × | rvalue quits (~rvalue@user/rvalue) (Read error: Connection reset by peer) |
| 05:27:13 | <Axman6> | Turns out what I really wanted was barbies though, and came across some code that was doing the same thing I was trying to, and it was beautiful |
| 05:27:17 | → | rvalue joins (~rvalue@user/rvalue) |
| 05:27:49 | <jackdk> | TraversableB or something, Axman6 ? |
| 05:28:54 | <danse-nr3> | % :t TraversableB |
| 05:28:54 | <yahb2> | <interactive>:1:1: error: ; Data constructor not in scope: TraversableB |
| 05:28:56 | <probie> | danse-nr3: once upon a time, base didn't have the `((->) r)` monad instance, but lambdabot did (I think it also had `Num` instances for functions). The person who maintained lambdabot at the time was called Cale (I think). |
| 05:29:24 | <danse-nr3> | oh i see. I gather you are amongst the (-> a) frowners (: |
| 05:29:28 | <probie> | https://hackage.haskell.org/package/barbies-2.1.1.0/docs/Data-Functor-Barbie.html#t:TraversableB |
| 05:29:46 | <Axman6> | jackdk: yeah. This was working in clash, where I wanted to be able to talk about a structure of signals, or a single of the structure |
| 05:29:57 | <danse-nr3> | not sure why barbie never sounded appealing to me |
| 05:29:59 | × | absence_ quits (torgeihe@hildring.pvv.ntnu.no) (Ping timeout: 255 seconds) |
| 05:30:39 | <haskellbridge> | <bdub> Who maintains the bot now? I am HEAVY into automation probie |
| 05:31:05 | <Axman6> | it's a pretty cool library, solves a lot of problems in quite an elegant way. Being able to talk about things like database tables using the type the contain is very nice |
| 05:31:21 | <geekosaur> | bdub: int-e |
| 05:31:57 | → | absence joins (~absence@hildring.pvv.ntnu.no) |
| 05:33:43 | <probie> | I'm not against `((->) r)` being a `Monad` at all. I'm even only slightly against preferring `f <$> g <*> h` over `\x -> f (g x) (h x)` |
| 05:34:33 | <danse-nr3> | oh your example looks better than mine probie |
| 05:36:08 | <danse-nr3> | but you said it was a mistake to have calaskell in base? Anyways i was also confused by your very first point about foo bar etcetera. Well sounds like i'm struggling to follow this chan lately |
| 05:38:58 | <geekosaur> | use of ((->) e) tends to be very hard to follow |
| 05:40:16 | <probie> | If I'm being completely serious for a moment, I don't think it's a mistake to have. It is a sane, sometimes useful monad instance and to exclude it would just cause orphan instances. However, I'm not keen on it being (ab)used extensively in normal Haskell code |
| 05:40:43 | × | danse-nr3 quits (~danse-nr3@user/danse-nr3) (Read error: Connection reset by peer) |
| 05:41:46 | <Axman6> | Apropos of nothing, I am so glad the C preprocessor is a functional language. |
| 05:41:47 | → | danse-nr3 joins (~danse-nr3@user/danse-nr3) |
| 05:41:50 | <Axman6> | or at least higher order |
| 05:43:49 | <probie> | After reading through so much "Whitney C" recently, I feel inspired to write my Haskell in a similar fashion |
| 05:44:00 | <danse-nr3> | i find (-> e) easier than, for instance, monad transformers |
| 05:45:56 | <mauke> | I find (e ->) easier |
| 05:51:57 | → | rosco joins (~rosco@175.136.158.234) |
| 05:55:50 | × | machinedgod quits (~machinedg@d50-99-47-73.abhsia.telus.net) (Ping timeout: 252 seconds) |
| 05:58:07 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 05:59:32 | <probie> | % f=foldr;c=flip;i=id |
| 05:59:32 | <yahb2> | <no output> |
| 05:59:45 | <probie> | % ([]&).f(c(.).(:))i$[1..5] |
| 05:59:45 | <yahb2> | <interactive>:69:2: error: ; Variable not in scope: (&) :: [a0] -> ([a1] -> [a1]) -> c |
| 05:59:55 | <probie> | % import Data.Function ((&)) |
| 05:59:55 | <yahb2> | <no output> |
| 06:00:03 | <probie> | % ([]&).f(c(.).(:))i$[1..5] |
| 06:00:03 | <yahb2> | [5,4,3,2,1] |
| 06:00:27 | <Axman6> | I'm quite proud of myself for thinking "Hmm, that's probably reverse" |
| 06:00:39 | <danse-nr3> | are you in the mood for showing us how haskell can get ugly probie? |
| 06:01:18 | <probie> | I think you mean "beautiful" |
| 06:01:38 | <danse-nr3> | well degustibus |
| 06:03:05 | <probie> | No Haskell can ever approach the beauty of BQN `+´∘((⌈`⌊(⌈`⌾⌽))-⊣)` or K `+/{((|\x)&||\|x)-x}` |
| 06:03:07 | → | CiaoSen joins (~Jura@2a05:5800:22f:a900:e6b9:7aff:fe80:3d03) |
| 06:04:12 | <danse-nr3> | expressive power /= beauty, but those look intriguing |
| 06:05:35 | × | jle` quits (~jle`@2603:8001:3b02:84d4:c4d5:25f2:175c:b94c) (Ping timeout: 244 seconds) |
| 06:06:33 | → | jle` joins (~jle`@2603:8001:3b02:84d4:ef66:1aba:fea9:c83b) |
| 06:06:35 | <probie> | Those code snippets solve https://www.geeksforgeeks.org/trapping-rain-water/ |
| 06:09:14 | × | famubu quits (~julinuser@user/famubu) (Quit: leaving) |
| 06:10:42 | <probie> | I don't think I can ever make Haskell that terse, but there's definitely room for improvement over the idiomatic style |
| 06:13:14 | <haskellbridge> | <bdub> Officially out! Catch all you B E A utiful people in a few hours |
| 06:14:28 | <danse-nr3> | geeksforgeeks doesn't seem to imply single-letter variables nor lack of spaces |
| 06:15:25 | <danse-nr3> | well see you later |
| 06:15:30 | × | danse-nr3 quits (~danse-nr3@user/danse-nr3) (Quit: on the move) |
| 06:18:33 | × | euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 252 seconds) |
| 06:19:15 | → | euleritian joins (~euleritia@dynamic-176-006-128-219.176.6.pool.telefonica.de) |
| 06:20:57 | <probie> | For those who are curious, the K implementation is roughly `sum . (\x -> zipWith (-) (zipWith min (scanl1 max x) (reverse (scanl1 max (reverse x)))) x)` |
| 06:22:44 | <Axman6> | The guy who does the Code Report youtube channel has some great videos on BQN and other array langs |
| 06:23:15 | <Axman6> | and he's done quite a few conference talks on them too |
| 06:26:31 | × | ft quits (~ft@p4fc2aa15.dip0.t-ipconnect.de) (Quit: leaving) |
| 06:29:03 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) |
| 06:29:34 | → | dsrt^ joins (dsrt@c-98-242-74-66.hsd1.ga.comcast.net) |
| 06:30:07 | <probie> | Someone's currently writing a simple interpreter for a dialect of APL in Haskell https://github.com/RubenVerg/tinyapl (it's not particularly fast since it uses lists, nor is it particularly usable, since is still missing some "core" functionality) |
| 06:35:38 | <Axman6> | Oh man, I forgot how much there was to define |
| 06:37:22 | <Axman6> | I wonder how much changing from list to Vector would change performance. Not even sure if it would help |
| 06:37:59 | <dminuoso> | I wouldnt be too quicky to put the blame on lists until I was staring at profiling data. |
| 06:39:57 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 06:40:00 | <probie> | It depends on the operation. It has obvious implications on uses of `⌷` (pronounced "squad") which is roughly like `!!` |
| 06:41:17 | <probie> | On the other hand, something like `+/⍳100` (`sum [1..100]`) probably benefits compared to using `Vector`, since it can run in constant space without ever making the entire array |
| 06:43:26 | <mauke> | I was fined, but later I was defined |
| 06:43:36 | <mauke> | unfortunately, in the end I was undefined |
| 06:44:00 | → | sord937 joins (~sord937@gateway/tor-sasl/sord937) |
| 06:44:48 | <Axman6> | I wonder if you could have a type somewhat similar to what repa does. so something like [1..100] would be represented internally as (Int -> a) |
| 06:44:50 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 06:48:53 | <Axman6> | I guess repa gets benefits from this from being able to inline things, a la stream fusion (and making calls to these functions in parallel) |
| 06:51:38 | → | JuanDaugherty joins (~juan@user/JuanDaugherty) |
| 07:01:35 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 07:05:31 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 07:07:52 | → | Inst joins (~Inst@user/Inst) |
| 07:09:05 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 248 seconds) |
| 07:09:09 | → | oo_miguel joins (~Thunderbi@78.10.207.46) |
| 07:10:07 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 07:20:47 | × | sawilagar quits (~sawilagar@user/sawilagar) (Remote host closed the connection) |
| 07:21:10 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 07:21:30 | → | kuribas joins (~user@2a02:1808:82:77e4:3737:2793:e72d:ca1e) |
| 07:21:43 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 264 seconds) |
| 07:23:08 | <Cale> | probie: true, it was me, haha |
| 07:25:25 | → | hayk joins (~hayk@37.252.90.243) |
| 07:28:05 | <lortabac> | Is there a way to test compilation errors? I made a typechecker plugin that forbids certain constraint combinations and would like to write automated tests for it |
| 07:28:59 | <c_wraith> | yes, though it's sort of hacky |
| 07:29:27 | <c_wraith> | well, specifically for type errors. |
| 07:29:49 | <c_wraith> | You can compile the test with -fdefer-type-errors, and ensure that the test raises the appropriate runtime exception |
| 07:29:52 | <probie> | Run GHC with `-fdefer-type-errors` and then catch them? |
| 07:30:03 | <probie> | rip, I'm too slow |
| 07:30:24 | <lortabac> | that was my first idea but it doesn't seem to work on my specific case |
| 07:30:59 | <c_wraith> | I'm not sure how deferring type errors interacts with typechecker plugins |
| 07:32:05 | × | kuribas quits (~user@2a02:1808:82:77e4:3737:2793:e72d:ca1e) (Ping timeout: 248 seconds) |
| 07:32:13 | <lortabac> | ah wait it probably works |
| 07:32:57 | <lortabac> | for some reason it didn't work in GHCI but if I set -fdefer-type-errors in cabal I see the errors appearing as warnings |
| 07:33:42 | <c_wraith> | setting it in ghci only affects code you type into ghci, not modules it loads |
| 07:33:59 | <c_wraith> | Ideally you'd use an OPTIONS_GHC pragma to enable it only in the module that needs it |
| 07:34:02 | <lortabac> | ok clear |
| 07:34:24 | <lortabac> | yes thanks for your suggestions |
| 07:44:12 | <lortabac> | actually I'm afraid I can't use this technique |
| 07:44:46 | <lortabac> | because no runtime error happens |
| 07:44:58 | → | danse-nr3 joins (~danse-nr3@user/danse-nr3) |
| 07:45:40 | <lortabac> | my plugin only adds extra restrictions to an otherwise valid Haskell program |
| 07:46:24 | <lortabac> | I guess I need to test these cases externally |
| 07:47:12 | <lortabac> | by compiling them in individual scripts and checking GHC's exit code |
| 07:47:20 | <haskellbridge> | <sm> seems easiest. shelltestrunner ? |
| 07:47:53 | × | euleritian quits (~euleritia@dynamic-176-006-128-219.176.6.pool.telefonica.de) (Read error: Connection reset by peer) |
| 07:48:15 | → | euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
| 07:48:39 | <lortabac> | thanks, shelltestrunner looks like a good option |
| 07:52:23 | → | kuribas joins (~user@ip-188-118-57-242.reverse.destiny.be) |
| 07:56:11 | → | machinedgod joins (~machinedg@d50-99-47-73.abhsia.telus.net) |
| 07:57:33 | × | hgolden quits (~hgolden@2603:8000:9d00:3ed1:1ee4:1b7c:94a7:8fa7) (Ping timeout: 252 seconds) |
| 07:57:44 | × | euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 260 seconds) |
| 07:59:42 | → | hgolden joins (~hgolden@2603:8000:9d00:3ed1:1ee4:1b7c:94a7:8fa7) |
| 08:00:40 | × | JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
| 08:04:23 | → | acidjnk_new joins (~acidjnk@p200300d6e72cfb06d8fe89eabbea3551.dip0.t-ipconnect.de) |
| 08:06:13 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 248 seconds) |
| 08:11:22 | → | euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
| 08:11:38 | × | tcard_ quits (~tcard@2400:4051:5801:7500:1e90:74c3:2754:ce8a) (Read error: Connection reset by peer) |
| 08:11:48 | → | tcard_ joins (~tcard@2400:4051:5801:7500:1e90:74c3:2754:ce8a) |
| 08:12:06 | → | Square joins (~Square@user/square) |
| 08:12:34 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 08:13:41 | × | tcard_ quits (~tcard@2400:4051:5801:7500:1e90:74c3:2754:ce8a) (Read error: Connection reset by peer) |
| 08:13:48 | → | tcard_ joins (~tcard@2400:4051:5801:7500:1e90:74c3:2754:ce8a) |
| 08:15:17 | × | mesaoptimizer quits (~mesaoptim@user/PapuaHardyNet) (Quit: mesaoptimizer) |
| 08:15:27 | → | mesaoptimizer joins (~mesaoptim@user/PapuaHardyNet) |
| 08:28:45 | → | tabaqui joins (~root@87.200.123.114) |
| 08:29:36 | × | econo_ quits (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity) |
| 08:32:19 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 244 seconds) |
| 08:32:32 | × | _d0t quits (~{-d0t-}@user/-d0t-/x-7915216) (Remote host closed the connection) |
| 08:33:22 | → | _d0t joins (~{-d0t-}@user/-d0t-/x-7915216) |
| 08:33:40 | <probie> | My attempt at "Whitney Haskell" is less revolting than I expected https://paste.tomsmeding.com/fyoq8LlH |
| 08:36:05 | <danse-nr3> | what is that referencing? Only found en.wikipedia.org/wiki/whitney_topologies |
| 08:38:53 | <probie> | Look at the style of C used in https://codeberg.org/ngn/k or https://github.com/kevinlawler/kona |
| 08:39:31 | <danse-nr3> | why "whitney" though? Well i'll peek at one of those |
| 08:39:52 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 08:40:09 | <danse-nr3> | oh it's the single-letter, no spaces you were showcasing before |
| 08:40:24 | <danse-nr3> | basically, obfuscation |
| 08:40:35 | <probie> | Named for Arthur Whitney, the creator of K |
| 08:40:40 | <Franciman> | K |
| 08:40:43 | <Franciman> | ops sorry |
| 08:40:45 | <danse-nr3> | oh, interesting |
| 08:40:48 | <danse-nr3> | hey Franciman |
| 08:40:55 | <Franciman> | \o |
| 08:42:57 | <probie> | it's also not obfuscated per se, it's just a style that prioritises fitting as much on the screen at once as possible |
| 08:43:17 | <xerox> | coding with a broken spacebar |
| 08:43:24 | <danse-nr3> | :P |
| 08:43:43 | <danse-nr3> | sounds a bit radical probie |
| 08:55:03 | → | cfricke joins (~cfricke@user/cfricke) |
| 08:55:44 | × | Patternm1ster quits (~georg@vmi1645272.contaboserver.net) (Quit: leaving) |
| 08:58:28 | → | JuanDaugherty joins (~juan@user/JuanDaugherty) |
| 08:59:08 | × | CiaoSen quits (~Jura@2a05:5800:22f:a900:e6b9:7aff:fe80:3d03) (Ping timeout: 245 seconds) |
| 08:59:47 | → | Patternmaster joins (~georg@user/Patternmaster) |
| 09:02:41 | → | ubert joins (~Thunderbi@2001:871:263:7b9b:9162:639d:781d:48b5) |
| 09:03:55 | <haskellbridge> | <sm> probie: like it! You can see some of this in the haskell tiny games jam too |
| 09:04:24 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 09:09:07 | → | gmg joins (~user@user/gehmehgeh) |
| 09:09:36 | <danse-nr3> | might be of user for demoscene? I think they only care about size of compiled there though |
| 09:09:40 | <danse-nr3> | *of use |
| 09:11:59 | × | xff0x quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 252 seconds) |
| 09:12:12 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 09:14:03 | × | JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
| 09:14:33 | → | falafel joins (~falafel@2a0c:5a87:3104:4c01::bfe0) |
| 09:15:15 | × | tzh quits (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz) |
| 09:41:38 | → | dans48005 joins (~danse-nr3@user/danse-nr3) |
| 09:43:47 | × | danse-nr3 quits (~danse-nr3@user/danse-nr3) (Ping timeout: 255 seconds) |
| 09:45:40 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 09:50:51 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 260 seconds) |
| 09:51:33 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 10:08:25 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 265 seconds) |
| 10:15:28 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 10:17:43 | × | falafel quits (~falafel@2a0c:5a87:3104:4c01::bfe0) (Ping timeout: 244 seconds) |
| 10:21:06 | → | xff0x joins (~xff0x@2405:6580:b080:900:465e:7eef:8460:d9d2) |
| 10:24:45 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 276 seconds) |
| 10:39:00 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.2.2) |
| 10:39:30 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 10:46:21 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 10:47:04 | → | gmg joins (~user@user/gehmehgeh) |
| 10:50:33 | → | Digitteknohippie joins (~user@user/digit) |
| 10:51:09 | × | Digit quits (~user@user/digit) (Ping timeout: 260 seconds) |
| 11:11:49 | × | remedan quits (~remedan@ip-62-245-108-153.bb.vodafone.cz) (Ping timeout: 248 seconds) |
| 11:14:35 | → | ZharMeny joins (~user@user/ZharMeny) |
| 11:18:53 | × | hayk quits (~hayk@37.252.90.243) (Quit: hayk) |
| 11:21:16 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 260 seconds) |
| 11:22:05 | → | JuanDaugherty joins (~juan@user/JuanDaugherty) |
| 11:27:22 | × | dans48005 quits (~danse-nr3@user/danse-nr3) (Quit: meal) |
| 11:31:16 | → | CiaoSen joins (~Jura@2a05:5800:22f:a900:e6b9:7aff:fe80:3d03) |
| 11:34:37 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 11:34:53 | × | TMA quits (tma@twin.jikos.cz) (Remote host closed the connection) |
| 11:37:09 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 11:37:25 | → | TMA joins (tma@twin.jikos.cz) |
| 11:41:41 | × | TMA quits (tma@twin.jikos.cz) (Ping timeout: 248 seconds) |
| 11:48:09 | → | stiell_ joins (~stiell@gateway/tor-sasl/stiell) |
| 11:51:30 | → | TMA joins (tma@twin.jikos.cz) |
| 11:51:36 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 260 seconds) |
| 12:03:12 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 12:06:07 | → | danse-nr3 joins (~danse-nr3@user/danse-nr3) |
| 12:11:01 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 248 seconds) |
| 12:27:50 | × | JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
| 12:47:14 | → | Miroboru joins (~myrvoll@178-164-114.82.3p.ntebredband.no) |
| 12:51:37 | × | ddellacosta quits (~ddellacos@ool-44c73d29.dyn.optonline.net) (Ping timeout: 252 seconds) |
| 12:54:49 | × | rosco quits (~rosco@175.136.158.234) (Quit: Lost terminal) |
| 13:03:15 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
| 13:05:05 | × | picnoir quits (~picnoir@about/aquilenet/vodoo/NinjaTrappeur) (Quit: WeeChat 4.3.5) |
| 13:06:51 | → | picnoir joins (~picnoir@about/aquilenet/vodoo/NinjaTrappeur) |
| 13:12:48 | → | rosco joins (~rosco@175.136.158.234) |
| 13:22:11 | → | ddellacosta joins (~ddellacos@ool-44c73d29.dyn.optonline.net) |
| 13:24:11 | → | hayk joins (~hayk@37.252.90.243) |
| 13:24:33 | × | ZharMeny quits (~user@user/ZharMeny) (Ping timeout: 252 seconds) |
| 13:33:26 | → | acidjnk_new3 joins (~acidjnk@p200300d6e72cfb069cd6142dbab03153.dip0.t-ipconnect.de) |
| 13:33:54 | × | acidjnk_new quits (~acidjnk@p200300d6e72cfb06d8fe89eabbea3551.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 13:34:15 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 13:35:40 | × | YoungFrog quits (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) (Quit: ZNC 1.7.x-git-3-96481995 - https://znc.in) |
| 13:41:52 | → | dans39187 joins (~danse-nr3@user/danse-nr3) |
| 13:42:11 | → | alexherbo2 joins (~alexherbo@2a02-8440-3314-ca9a-0563-f5c7-288c-8691.rev.sfr.net) |
| 13:44:05 | × | danse-nr3 quits (~danse-nr3@user/danse-nr3) (Ping timeout: 255 seconds) |
| 13:44:11 | × | slac21088 quits (~slack1256@2803:c600:5111:8029:469f:21dd:e308:1389) (Remote host closed the connection) |
| 13:44:48 | → | slack1256 joins (~slack1256@179.60.70.224) |
| 13:54:00 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Read error: Connection reset by peer) |
| 13:57:32 | → | YoungFrog joins (~youngfrog@2a02:a03f:c9db:fc00:b4ad:7d6f:2694:3c32) |
| 14:01:01 | zero | is now known as zzz |
| 14:11:02 | × | dans39187 quits (~danse-nr3@user/danse-nr3) (Remote host closed the connection) |
| 14:11:17 | → | danse-nr3 joins (~danse-nr3@user/danse-nr3) |
| 14:14:26 | × | ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection) |
| 14:14:42 | × | slack1256 quits (~slack1256@179.60.70.224) (Read error: Connection reset by peer) |
| 14:15:01 | → | ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se) |
| 14:15:13 | → | slack1256 joins (~slack1256@2803:c600:5111:8029:44f4:5d68:3d8e:eb90) |
| 14:16:19 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 252 seconds) |
| 14:19:50 | → | ZharMeny joins (~user@user/ZharMeny) |
| 14:20:50 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 14:23:41 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 14:28:37 | × | cfricke quits (~cfricke@user/cfricke) (Ping timeout: 248 seconds) |
| 14:38:08 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 14:38:26 | <danse-nr3> | Cannot use record selector ‘constructor’ as a function due to escaped type variables |
| 14:38:41 | <danse-nr3> | first existential clumsy steps |
| 14:39:49 | × | CiaoSen quits (~Jura@2a05:5800:22f:a900:e6b9:7aff:fe80:3d03) (Ping timeout: 248 seconds) |
| 14:39:52 | <EvanR> | it used to say "my brain just exploded" |
| 14:40:14 | <EvanR> | I'm not sure which message is better |
| 14:40:51 | <danse-nr3> | my brain is still dumbly staring at that |
| 14:41:09 | <danse-nr3> | it will probably explode after any understanding |
| 14:41:17 | <danse-nr3> | *possibly |
| 14:42:08 | <EvanR> | the record contains something of some type but you don't know which |
| 14:42:36 | <EvanR> | the type system can't tell if you know what you're doing |
| 14:44:29 | <Leary> | danse-nr3: Haskell existentials have some limitations. When in doubt, use case-of. |
| 14:44:58 | <danse-nr3> | cheers! |
| 14:56:20 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 14:56:41 | → | cfricke joins (~cfricke@user/cfricke) |
| 14:57:04 | <Leary> | (we only have the /forall/ quantifier, no /exists/, so we can only deal with existentials in ways that can be typed with foralls. `MkEx :: forall a. a -> Ex` and `withEx :: forall a r. Ex -> (a -> r) -> r` are fine, but `unEx :: exists a. Ex -> a` isn't supported) |
| 15:00:50 | danse-nr3 | crosses her fingers for /exists/ to eventually exist |
| 15:01:33 | Digitteknohippie | is now known as Digit |
| 15:03:38 | → | remedan joins (~remedan@ip-62-245-108-153.bb.vodafone.cz) |
| 15:04:42 | <Leary> | Err, `withEx :: forall r. Ex -> (forall a. a -> r) -> r`* |
| 15:07:14 | × | ubert quits (~Thunderbi@2001:871:263:7b9b:9162:639d:781d:48b5) (Ping timeout: 272 seconds) |
| 15:13:02 | → | JuanDaugherty joins (~juan@user/JuanDaugherty) |
| 15:17:42 | → | ft joins (~ft@p4fc2aa15.dip0.t-ipconnect.de) |
| 15:25:20 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 15:33:15 | → | tzh joins (~tzh@c-76-115-131-146.hsd1.or.comcast.net) |
| 15:35:27 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 15:38:27 | <EvanR> | poor man's module system |
| 15:38:54 | <dminuoso> | I wonder, is there a deeper reason for exists not existing? |
| 15:39:36 | <dminuoso> | I guess it would require some kind of modification of the Gen rule in Damas Milner? |
| 15:42:30 | <c_wraith> | I think the biggest reason is that it's really unclear what useful thing it would add. |
| 15:43:13 | <EvanR> | what does it add while costing a new keyword |
| 15:43:49 | <danse-nr3> | maybe i am biased by use in math that makes it seem important |
| 15:44:43 | <dminuoso> | EvanR: I think the keyword is the smallest problem. Happy has full monad support, so at best we could demote it to a type-level keyword `exists`. |
| 15:45:09 | <EvanR> | the use in math is terrible. The banach-tarski paradox has a mapping That Exists (tm) |
| 15:45:32 | <EvanR> | that merely exists, in the language of HoTT |
| 15:45:43 | <c_wraith> | Like, most of the cases where I use existentials are packing together related values. I can already do that with the way GHC supports the universal/existential duality |
| 15:46:13 | <c_wraith> | I don't even see how it'd be less code with an exists keyword |
| 15:46:41 | <EvanR> | my brain just operations on foralls sorry, to paraphrase OOP fans |
| 15:46:44 | <EvanR> | operates |
| 15:47:08 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 272 seconds) |
| 15:48:40 | <c_wraith> | I suppose in theory an exists keyword would allow me to replace the custom data type with an existentially-quantified tuple, but custom types for custom purposes is a good habit anyway |
| 15:49:32 | <dminuoso> | Also there is a bunch of places where an explicit `exists` would seem like a better distinction than moving `forall` one place to the lext |
| 15:49:45 | <dminuoso> | e.g. existential quantification in data types. |
| 15:50:04 | <EvanR> | the syntax for existential quantification in data types doesn't kind of make no sense |
| 15:50:25 | EvanR | breaks the not gate on all their messages |
| 15:50:33 | <dminuoso> | I mean next you know, writing `data X Int forall x. = X ...` carries some meaning too, just to save ourselves some other keyword. |
| 15:50:39 | <c_wraith> | I only ever use existential quantification in data types with GADT syntax. It makes a lot more sense there. |
| 15:50:59 | <dminuoso> | Oh yeah, GADTSyntax is definitely the way it should have been from the beginning. |
| 15:51:21 | <EvanR> | +1 |
| 15:52:03 | <int-e> | let's have an existential crisis for all (scnr) |
| 15:54:51 | → | waleee joins (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
| 15:58:03 | → | yaroot_ joins (~yaroot@2400:4052:ac0:d901:1cf4:2aff:fe51:c04c) |
| 15:58:37 | → | skyesoss joins (~Thunderbi@128.135.204.35) |
| 15:59:00 | → | Ram-Z_ joins (~Ram-Z@li1814-254.members.linode.com) |
| 15:59:12 | → | xnbya2 joins (~xnbya@2a01:4f8:c17:cbdd::1) |
| 16:00:06 | × | rvalue quits (~rvalue@user/rvalue) (Ping timeout: 252 seconds) |
| 16:00:06 | → | rvalue- joins (~rvalue@user/rvalue) |
| 16:00:47 | × | yaroot quits (~yaroot@2400:4052:ac0:d901:1cf4:2aff:fe51:c04c) (Ping timeout: 246 seconds) |
| 16:00:47 | × | xnbya quits (~xnbya@2a01:4f8:c17:cbdd::1) (Quit: No Ping reply in 180 seconds.) |
| 16:00:48 | × | jocke-l quits (jocke-l@a.x0.is) (Ping timeout: 246 seconds) |
| 16:00:48 | yaroot_ | is now known as yaroot |
| 16:00:48 | × | Ram-Z quits (Ram-Z@2a01:7e01::f03c:91ff:fe57:d2df) (Ping timeout: 246 seconds) |
| 16:02:05 | <haskellbridge> | <Bowuigi> Technically you can solve the unex problem by adopting the dependent exists |
| 16:03:22 | <haskellbridge> | <Bowuigi> So "unEx :: forall t. Ex t -> t" is the same as sigma's "snd" |
| 16:04:18 | rvalue- | is now known as rvalue |
| 16:04:42 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 276 seconds) |
| 16:04:53 | <haskellbridge> | <Bowuigi> Sigma's "fst"* |
| 16:05:08 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 16:06:05 | × | ephilalethes quits (~noumenon@113.51-175-156.customer.lyse.net) (Read error: Connection reset by peer) |
| 16:06:16 | <EvanR> | I think this issue is you have something like Sigma t (something involving t), and the problematic operation is snd |
| 16:07:32 | → | noumenon joins (~noumenon@113.51-175-156.customer.lyse.net) |
| 16:08:02 | × | kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Remote host closed the connection) |
| 16:12:59 | <haskellbridge> | <Bowuigi> Yeah plugging that modified version of Ex into mkEx leaves us with at Identity (or a weird GADT that has at least Identity capabilities, idk) |
| 16:13:46 | → | jocke-l joins (jocke-l@a.x0.is) |
| 16:17:50 | × | danse-nr3 quits (~danse-nr3@user/danse-nr3) (Quit: going for a walk) |
| 16:21:06 | ← | L29Ah parts (~L29Ah@wikipedia/L29Ah) () |
| 16:21:13 | <dolio> | Σ isn't exists, though, really. |
| 16:21:39 | → | ubert joins (~Thunderbi@2001:871:263:7b9b:33b7:13f4:a3fd:d5f4) |
| 16:24:35 | × | alexherbo2 quits (~alexherbo@2a02-8440-3314-ca9a-0563-f5c7-288c-8691.rev.sfr.net) (Remote host closed the connection) |
| 16:25:53 | × | ubert quits (~Thunderbi@2001:871:263:7b9b:33b7:13f4:a3fd:d5f4) (Ping timeout: 248 seconds) |
| 16:29:30 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 260 seconds) |
| 16:36:57 | × | rosco quits (~rosco@175.136.158.234) (Quit: Lost terminal) |
| 16:41:10 | × | waleee quits (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 252 seconds) |
| 16:44:34 | → | danse-nr3 joins (~danse-nr3@user/danse-nr3) |
| 16:51:56 | → | ubert joins (~Thunderbi@2001:871:263:7b9b:6d29:aa3c:7687:9089) |
| 16:54:07 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 16:54:23 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 16:56:00 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 16:56:01 | <danse-nr3> | :/ can't use forall because i need a constraint |
| 16:56:19 | <danse-nr3> | (in a `data`) |
| 16:56:31 | <EvanR> | GADT it is |
| 16:56:48 | <danse-nr3> | huh i'll look that up, cheers |
| 16:56:48 | × | ubert quits (~Thunderbi@2001:871:263:7b9b:6d29:aa3c:7687:9089) (Ping timeout: 272 seconds) |
| 16:57:57 | <EvanR> | https://wiki.haskell.org/Data_declaration_with_constraint |
| 16:58:45 | <danse-nr3> | cheers, i was on https://wiki.haskell.org/GADTs_for_dummies :P |
| 17:02:51 | → | econo_ joins (uid147250@id-147250.tinside.irccloud.com) |
| 17:03:32 | → | hseg joins (~gesh@46.120.21.97) |
| 17:04:03 | <hseg> | Hi. Is there any way to (using stack) decouple building tests from running them? |
| 17:04:41 | <hseg> | (the packaging system I'm targetting likes to have these phases be separate) |
| 17:05:49 | <hseg> | ... actually, rereading docs that may be inaccurate |
| 17:06:04 | <danse-nr3> | stack test --no-run-tests |
| 17:06:23 | <hseg> | sure, but then a subsequent stack test will try rebuilding the tests |
| 17:06:45 | <danse-nr3> | hmm it should not i think |
| 17:07:20 | <danse-nr3> | oh i see what you mean |
| 17:07:21 | <hseg> | (what lead me down this rabbithole is that stack build; stack test seemed to recompile the whole project twice (for different profiles?) whereas stack build --test --no-run-tests; stack test at least gave the impression of rebuilding the tests) |
| 17:07:42 | <danse-nr3> | huh ... |
| 17:07:44 | → | ubert joins (~Thunderbi@2001:871:263:7b9b:ad71:28a9:46a4:a88e) |
| 17:07:54 | <danse-nr3> | mine is stack test --no-run-tests |
| 17:08:09 | <hseg> | yeah, because stack aliases test = build --test |
| 17:08:14 | <danse-nr3> | oh yeah but i guess that's the same as stack build --... |
| 17:08:16 | <danse-nr3> | exactly |
| 17:09:08 | <danse-nr3> | well works for me, one builds the other runs, although i have stack building unexpectedly at time... not sure whether my lack of understanding or any error in stack |
| 17:09:17 | <danse-nr3> | *at times |
| 17:10:01 | × | ubert quits (~Thunderbi@2001:871:263:7b9b:ad71:28a9:46a4:a88e) (Remote host closed the connection) |
| 17:10:05 | <hseg> | yeah. reading the stack docs, it seems like its sacrificing correctness over convenience here. understandable, but annoying in this niche circumstance |
| 17:10:20 | → | ubert joins (~Thunderbi@2001:871:263:7b9b:f884:5c80:acff:c71d) |
| 17:10:31 | <danse-nr3> | "here" where? |
| 17:10:51 | <hseg> | with the aliasing |
| 17:10:53 | <danse-nr3> | no i wasn't referring to anything documented |
| 17:11:25 | <danse-nr3> | don't see how correctness is sacrificed by the aliasing either |
| 17:11:42 | <hseg> | having packaged some python stuff as well, it surprises me stack build / stack test is not analogous to python -m build / python -m pytest |
| 17:12:04 | <danse-nr3> | but anyways, --no-run-tests just builds, without it runs. Erratic behaviour may happen |
| 17:12:04 | <hseg> | (then again, what's correct in my eyes might not be correct in others' eyes |
| 17:12:21 | <hseg> | and vice versa) |
| 17:13:38 | <hseg> | right -- main source of unpredictability here would be if between the --no-run-tests and the actual stack test the state changes enough to get stack to recompile the test suite |
| 17:14:13 | <hseg> | also, just found https://discourse.haskell.org/t/recompilation-issue-with-stack-test/10120 |
| 17:14:36 | <hseg> | which gives the stack side of things some more legitimacy here |
| 17:14:49 | <danse-nr3> | well if in between the source changes, than it should predictably rebuild |
| 17:15:08 | <danse-nr3> | is this the right way to use generic types with forall? https://paste.tomsmeding.com/dTgtBQbk |
| 17:15:49 | <danse-nr3> | syntax error |
| 17:16:16 | <hseg> | You probably want to write ... where Summand (forall ...) |
| 17:16:51 | → | g00gler joins (uid125351@id-125351.uxbridge.irccloud.com) |
| 17:17:55 | <Leary> | danse-nr3: You're mixing up the old existential syntax and the GADT syntax that subsumes it. Either `data Summand f = forall ...` or `data Summand f where { Summand :: forall ... }`. |
| 17:18:28 | <danse-nr3> | huh fancy |
| 17:18:39 | <danse-nr3> | well in the fist i can't add a constraint |
| 17:18:54 | <danse-nr3> | while in the second ... hmm i'll try |
| 17:19:36 | <danse-nr3> | looks really wrong... compiling... |
| 17:19:45 | <danse-nr3> | nah |
| 17:19:54 | <danse-nr3> | i probably got you wrong |
| 17:20:17 | <danse-nr3> | this was my interpretation https://paste.tomsmeding.com/EoXyYjxh |
| 17:20:58 | <Leary> | % data Ex c = forall a. c a => MkEx a |
| 17:20:58 | <yahb2> | <no output> |
| 17:21:10 | <danse-nr3> | wait i also had to move the forall |
| 17:21:24 | <Leary> | % data Ex2 c where MkEx2 :: forall a. c a => Ex2 c |
| 17:21:24 | <yahb2> | <interactive>:81:37: error: Not in scope: type variable ‘c’ ; ; <interactive>:81:48: error: Not in scope: type variable ‘c’ |
| 17:21:42 | <Leary> | % data Ex2 c where MkEx2 :: forall c a. c a => Ex2 c |
| 17:21:42 | <yahb2> | <interactive>:83:18: error: ; • Could not deduce (c a0) ; from the context: c a ; bound by the type of the constructor ‘MkEx2’: ; forall {k1} (c :: k1 -> Constr... |
| 17:22:16 | <Leary> | % data Ex2 c where MkEx2 :: forall c a. c a => a -> Ex2 c |
| 17:22:16 | <yahb2> | <no output> |
| 17:22:26 | <Leary> | Got blind. |
| 17:22:37 | <danse-nr3> | well it's late |
| 17:22:47 | <danse-nr3> | but ... no constraint in there? |
| 17:23:06 | <Leary> | There is? `c a` in both cases. |
| 17:23:12 | <danse-nr3> | oh |
| 17:23:29 | <danse-nr3> | isn't that a parameter? |
| 17:24:17 | <danse-nr3> | maybe generic data type semantics that i haven't understood yet |
| 17:24:49 | <Leary> | % :k Ex2 |
| 17:24:49 | <yahb2> | Ex2 :: (* -> Constraint) -> * |
| 17:25:42 | <haskellbridge> | <sm> @hseg: interesting discussion still ongoing on this old issue.. it's pretty annoying alright |
| 17:26:08 | <danse-nr3> | thanks but i give up. I'll just expose the type and add the constraint in callers |
| 17:28:04 | <danse-nr3> | huh nope i can't ^^; |
| 17:28:15 | <hseg> | sm: yeah, the motivating case brought up in the discourse (where the test profile differs from the production profile) does not sound like good testing practice |
| 17:28:19 | <danse-nr3> | well i'll bump my head on this, thanks anyway |
| 17:28:31 | <hseg> | though tbf, it does seem to be a common issue |
| 17:30:17 | × | ubert quits (~Thunderbi@2001:871:263:7b9b:f884:5c80:acff:c71d) (Ping timeout: 252 seconds) |
| 17:31:39 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 4.2.2) |
| 17:38:48 | <danse-nr3> | upon reanalising and adding a type annotation, problem fixed. Had wrongly interpreted an error |
| 17:39:17 | <danse-nr3> | (no need to add constraints) |
| 17:41:21 | × | danse-nr3 quits (~danse-nr3@user/danse-nr3) (Read error: Connection reset by peer) |
| 17:42:14 | → | danse-nr3 joins (~danse-nr3@user/danse-nr3) |
| 17:42:50 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 17:44:15 | → | waleee joins (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
| 17:45:32 | <haskellbridge> | <sm> hseg: very. I'm going to stare at my cabal (yaml) files again |
| 17:46:52 | <monochrom> | hegs: Car manufacturers and graphics cards device driver writers beg to differ. >:) |
| 17:47:15 | → | oneeyedalien joins (~oneeyedal@user/oneeyedalien) |
| 17:47:41 | <monochrom> | Remember that scandal when some car engines had a test mode for passing emission tests and a real mode for daily driving? |
| 17:48:39 | <monochrom> | Remember that other scandal when graphics cards device drivers also had a test mode for passing Microsoft should-not-crash tests and a real mode for daily usage? |
| 17:55:35 | <danse-nr3> | huh i lost how that relates :P |
| 17:55:39 | <danse-nr3> | *missed |
| 17:56:21 | <monochrom> | Having a test profile that differs from the production profile. |
| 17:56:28 | <danse-nr3> | oh right |
| 17:56:41 | <monochrom> | In the case of the scandals, maliciously intentionally differ. |
| 17:57:09 | × | JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
| 17:57:24 | <monochrom> | Sad to say that "this is what real engineers do". I lost my faith in humanity. |
| 17:58:10 | <danse-nr3> | weeell... i wouldn't generalise |
| 17:58:34 | × | oneeyedalien quits (~oneeyedal@user/oneeyedalien) (Ping timeout: 260 seconds) |
| 18:01:02 | <dolio> | Graphcis card drivers seem like 90% hacks. |
| 18:01:27 | <dolio> | Like, every application is broken, and the driver contains all the workarounds. |
| 18:02:37 | <dolio> | At least, that's the sort of thing I've heard. |
| 18:02:49 | <danse-nr3> | i didn't follow the graphic cards one but the WV scandal was quite an international blow. That shows such behaviour is not acceptable |
| 18:03:50 | × | hc quits (~hc@2407:d200:d002:43:229:85:195:3) (Quit: leaving) |
| 18:04:14 | → | hc joins (~hc@mail.hce.li) |
| 18:04:18 | <dolio> | So, like, renaming an executable can cause problems, because the driver is checking for the executable name to implement application-specific, incorrect behavior that the application expects. :þ |
| 18:04:56 | <danse-nr3> | huh you mean ... the driver patches the app? |
| 18:04:58 | <dolio> | Or replacing broken shaders or whatever. |
| 18:05:36 | <dolio> | Effectively. That's what I've heard is the general state of graphics drivers (on Windows, at least). |
| 18:06:57 | <danse-nr3> | sounds like a crazy amount of fragile work considering apps are not open-source |
| 18:11:02 | <dolio> | Someone less 'altruistically,' I think the GPU manufacturer will sometimes help write non-conforming code that their driver successfully works around (but not their competitor's). |
| 18:13:26 | <danse-nr3> | oh that sounds more realistic |
| 18:15:30 | × | machinedgod quits (~machinedg@d50-99-47-73.abhsia.telus.net) (Ping timeout: 252 seconds) |
| 18:17:05 | → | oneeyedalien joins (~oneeyedal@user/oneeyedalien) |
| 18:20:30 | <EvanR> | thisExecutablesName :: String |
| 18:20:56 | <EvanR> | a very useful global |
| 18:21:53 | <meejah> | dolio: yes, GPU drivers are _mostly_ such workaround code, from my understand (experience is now dated, but I doubt that practice changed) |
| 18:28:33 | × | Ellenor quits (~Ellenor@invictus.wa.us.umbrellix.net) (Ping timeout: 244 seconds) |
| 18:30:31 | × | sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937) |
| 18:30:35 | × | chiselfuse quits (~chiselfus@user/chiselfuse) (Remote host closed the connection) |
| 18:31:37 | → | chiselfuse joins (~chiselfus@user/chiselfuse) |
| 18:33:16 | <danse-nr3> | all my afternoon's sweat resulted in ... huh ... 29 lines of code, but i'm really happy about them -_-; |
| 18:34:44 | <EvanR> | that's amazing |
| 18:35:03 | <EvanR> | maybe tomorrow you can get it down to 20 or 15 |
| 18:35:08 | <meejah> | that's like 300 lines in a less-concise language, right? ;) |
| 18:36:05 | → | thailigur joins (~thailigur@172.86.68.44) |
| 18:37:47 | <danse-nr3> | dunno, comparing makes little sense to me. I don't even aim for having less lines, it just happens. But i look at them and they are great. Years in, haskell keeps surprising me |
| 18:42:41 | × | slack1256 quits (~slack1256@2803:c600:5111:8029:44f4:5d68:3d8e:eb90) (Remote host closed the connection) |
| 18:44:14 | × | thailigur quits (~thailigur@172.86.68.44) (Remote host closed the connection) |
| 18:50:27 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 276 seconds) |
| 18:51:59 | → | CiaoSen joins (~Jura@2a05:5800:22f:a900:e6b9:7aff:fe80:3d03) |
| 18:52:42 | × | danse-nr3 quits (~danse-nr3@user/danse-nr3) (Quit: good night) |
| 19:02:41 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 19:07:32 | → | Tuplanolla joins (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) |
| 19:15:59 | × | Inst quits (~Inst@user/Inst) (Remote host closed the connection) |
| 19:16:18 | → | Inst joins (~Inst@user/Inst) |
| 19:19:57 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 19:27:44 | → | igorra joins (~igorra@185.211.158.66) |
| 19:28:46 | × | igorra quits (~igorra@185.211.158.66) (Client Quit) |
| 19:33:27 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 19:34:35 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 252 seconds) |
| 19:53:11 | → | kupi joins (uid212005@id-212005.hampstead.irccloud.com) |
| 19:54:17 | → | JuanDaugherty joins (~juan@user/JuanDaugherty) |
| 20:03:56 | × | hseg quits (~gesh@46.120.21.97) (Ping timeout: 252 seconds) |
| 20:08:46 | → | machinedgod joins (~machinedg@d50-99-47-73.abhsia.telus.net) |
| 20:11:04 | × | oneeyedalien quits (~oneeyedal@user/oneeyedalien) (Quit: Leaving) |
| 20:12:08 | → | Sgeo_ joins (~Sgeo@user/sgeo) |
| 20:12:17 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 20:14:21 | × | euphores quits (~SASL_euph@user/euphores) (Quit: Leaving.) |
| 20:16:25 | → | halloy5409 joins (~halloy540@147.235.212.157) |
| 20:16:43 | <halloy5409> | > sum [1,2,3] |
| 20:16:45 | <lambdabot> | 6 |
| 20:17:47 | → | target_i joins (~target_i@user/target-i/x-6023099) |
| 20:20:24 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 20:21:46 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 20:21:55 | → | euphores joins (~SASL_euph@user/euphores) |
| 20:25:41 | × | JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
| 20:26:37 | <halloy5409> | i want to try to implement `choices` function which give me back all the lists it can retrieve from a given list, so for example if i type: choices [1,2], i'll get back [[], [1], [2], [1,2], [2,1]]. i don't have a clue on how to implement it, and i need advice of how to get started. maybe i need to implement a helper function(s) that solve more simple problem and use it inside the `choices` function. if so, what a simple function should i implement |
| 20:27:56 | <ncf> | > subsequences [1,2] >>= permutations |
| 20:27:58 | <lambdabot> | [[],[1],[2],[1,2],[2,1]] |
| 20:28:58 | <sprout> | > subsequences [1,2] |
| 20:29:00 | <lambdabot> | [[],[1],[2],[1,2]] |
| 20:29:43 | <halloy5409> | i dont want the solution. i want to write it my self without using those build in functions. |
| 20:30:12 | <mauke> | @src subsequences |
| 20:30:12 | <lambdabot> | Source not found. Do you think like you type? |
| 20:30:28 | <mauke> | > filterM (return [True,False]) [1,2] |
| 20:30:30 | <lambdabot> | [[1,2],[1],[2],[]] |
| 20:30:42 | <halloy5409> | o rmaybe can you guide me on how to think about it? |
| 20:30:47 | <halloy5409> | *or maybe |
| 20:32:54 | → | L29Ah joins (~L29Ah@wikipedia/L29Ah) |
| 20:33:03 | <sprout> | you need a recurrence relation |
| 20:33:25 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 248 seconds) |
| 20:39:16 | <halloy5409> | @type >>= |
| 20:39:17 | <lambdabot> | error: parse error on input ‘>>=’ |
| 20:39:26 | <halloy5409> | @type (>>=) |
| 20:39:27 | <lambdabot> | Monad m => m a -> (a -> m b) -> m b |
| 20:39:47 | <halloy5409> | sprout: thanks |
| 20:42:35 | <mauke> | > concatMap permutations (subsequences [1,2]) |
| 20:42:36 | <lambdabot> | [[],[1],[2],[1,2],[2,1]] |
| 20:42:46 | → | zetef joins (~quassel@2a02:2f00:5202:1200:3fa2:e908:b522:fa2f) |
| 20:42:48 | × | Square quits (~Square@user/square) (Ping timeout: 252 seconds) |
| 20:42:49 | × | zetef quits (~quassel@2a02:2f00:5202:1200:3fa2:e908:b522:fa2f) (Client Quit) |
| 20:42:55 | <mauke> | :t concatMap |
| 20:42:56 | <lambdabot> | Foldable t => (a -> [b]) -> t a -> [b] |
| 20:43:17 | <mauke> | :t (>>=) `asTypeOf` concatMap |
| 20:43:19 | <lambdabot> | error: |
| 20:43:19 | <lambdabot> | • Couldn't match type ‘[b] -> [b]’ with ‘[a]’ |
| 20:43:19 | <lambdabot> | Expected type: [a] -> (a -> [b]) -> [b] |
| 20:43:31 | <ncf> | > subsequences [1,1] >>= permutations |
| 20:43:32 | <lambdabot> | [[],[1],[1],[1,1],[1,1]] |
| 20:43:33 | <mauke> | right |
| 20:43:39 | <mauke> | :t flip (>>=) `asTypeOf` concatMap |
| 20:43:40 | <lambdabot> | (a -> [b]) -> [a] -> [b] |
| 20:43:57 | <ncf> | the first step is to specify what you want mathematically: should the above be [[],[1],[1,1]]? |
| 20:47:52 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Read error: Connection reset by peer) |
| 20:54:10 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 248 seconds) |
| 20:57:21 | <zzz> | halloy5409: this is not the function you want, but it's one that returns the subsets of a list. i think it can serve as inspiration: https://gist.githubusercontent.com/jrvieira/2820b46856ba1ec89453946557b0f427/raw/a1f2a794459a564f521913a73fb7cda2f46ad5cc/subsets.hs |
| 20:58:10 | <zzz> | here you get multiple implementations, at different levels of abstraction |
| 20:59:06 | <zzz> | bonus: you can see from the comments which run more time-efficiently |
| 21:01:33 | × | michalz quits (~michalz@185.246.207.217) (Remote host closed the connection) |
| 21:08:28 | <zzz> | here's one more: https://paste.jrvieira.com/1723151276523 |
| 21:11:09 | <zzz> | fun exercise |
| 21:11:48 | → | ksqsf joins (~user@2a02:2454:8758:c800:85c3:bb5a:c725:a7e6) |
| 21:15:14 | <zzz> | why is fold implemented in terms of foldMap? |
| 21:15:54 | <zzz> | seems odd to me |
| 21:16:54 | <zzz> | why not `fold = foldr mappend mempty` instead of `fold = foldMap id` ? |
| 21:18:00 | × | machinedgod quits (~machinedg@d50-99-47-73.abhsia.telus.net) (Ping timeout: 276 seconds) |
| 21:20:12 | × | skyesoss quits (~Thunderbi@128.135.204.35) (Ping timeout: 252 seconds) |
| 21:20:19 | <halloy5409> | zzz: thanks |
| 21:21:14 | <zzz> | halloy5409: yw |
| 21:21:41 | <halloy5409> | ncf: i realy dont know. this exercise is more a lecture of Graham Hutton and he just gave the example i started with. i don't know happens where there is a list with the same number |
| 21:21:56 | <halloy5409> | mor e= from |
| 21:22:04 | <halloy5409> | *more |
| 21:22:21 | <halloy5409> | *what happens |
| 21:26:44 | <monochrom> | zzz: I prefer foldMap id. |
| 21:29:58 | <monochrom> | foldMap and fold commit to no bias. foldr commits to a bias. I consider a more biased thing to be less fundamental. |
| 21:35:09 | <halloy5409> | lambdabot: > sum [1,2,3] |
| 21:35:27 | <mauke> | > 6 |
| 21:35:28 | <lambdabot> | 6 |
| 21:36:13 | <zzz> | monochrom: foldMap uses foldr |
| 21:36:21 | <zzz> | otherwise i would agree with you |
| 21:37:15 | <monochrom> | foldr uses foldMap. |
| 21:37:54 | <zzz> | oh no |
| 21:38:15 | <monochrom> | This is what's wrong with confirmation bias. |
| 21:39:24 | × | terrorjack4 quits (~terrorjac@static.163.82.63.178.clients.your-server.de) (Quit: The Lounge - https://thelounge.chat) |
| 21:40:16 | <zzz> | touche |
| 21:41:28 | → | terrorjack4 joins (~terrorjac@static.163.82.63.178.clients.your-server.de) |
| 21:42:44 | ← | ksqsf parts (~user@2a02:2454:8758:c800:85c3:bb5a:c725:a7e6) (ERC 5.6.0.30.1 (IRC client for GNU Emacs 30.0.60)) |
| 21:49:43 | × | hayk quits (~hayk@37.252.90.243) (Quit: hayk) |
| 21:53:13 | <zzz> | ok so foldMap is more general but it still commits to the "right" bias |
| 21:53:16 | → | raehik joins (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) |
| 21:54:02 | <monochrom> | No, that's not what it means. Have you seen the definition of the Eq class? |
| 21:58:08 | <zzz> | yes. although i'm familiar with the "no /= in Eq" proposal |
| 21:58:20 | <zzz> | but i understand your point |
| 21:59:21 | <zzz> | i'm not familiar with the Endo stuff so i'm reading up on it |
| 21:59:51 | <monochrom> | In an ideal language, foldMap would have like 3 default implementations, one using foldr, one using foldl, one using fold. |
| 22:00:14 | <monochrom> | In Haskell, someone has to choose one of them. |
| 22:00:31 | <zzz> | is the fact that foldr and foldl can be defined in terms of eachother relevant to the argument you're making? |
| 22:01:50 | <EvanR> | can they? |
| 22:02:24 | <EvanR> | (specifically for list) |
| 22:03:56 | <monochrom> | We can assume finite data structures for this context. |
| 22:04:37 | <zzz> | yes, i admit some handwaving |
| 22:04:40 | <monochrom> | Actually, 4 default implementations: foldr, foldl, fold, toList. |
| 22:05:31 | <EvanR> | reducing a tree seems to have many possible strategies not just 4 |
| 22:07:18 | <zzz> | trees are inherently something, right? like lists are inherently right fold by the way the data type is defined |
| 22:07:48 | <EvanR> | you might say a list is a right leaning tree and a snoc list is left leaning |
| 22:07:51 | <zzz> | i may not be expressing myself with the best words |
| 22:07:57 | <monochrom> | trees are inherently trees. |
| 22:08:08 | <sprout> | say it like it is |
| 22:08:47 | <probie> | <unhelpful>`foldl` is just a special case of `foldr` for lists</unhelpful> |
| 22:09:17 | <monochrom> | or you could say "branching left right and centre" if you're still looking for metaphors. |
| 22:10:56 | <zzz> | can an argument be made that foldr should be just called fold? |
| 22:11:20 | <EvanR> | :t fold |
| 22:11:21 | <lambdabot> | (Foldable t, Monoid m) => t m -> m |
| 22:11:37 | <EvanR> | see, that one is interesting because it doesn't matter how you reduce the tree, it comes out the same |
| 22:11:45 | <EvanR> | because monoidness |
| 22:12:20 | <zzz> | i want to understand this better |
| 22:12:21 | <EvanR> | foldl and foldr meanwhile rely on narratives |
| 22:12:40 | <monochrom> | I am not sure what's the use of such an argument, but yes. Because an argument can be made that X sshould be called Y, for all X and Y. |
| 22:13:20 | <monochrom> | OK I know what's the use. Some people enjoy power trips obtained from controlling and/or changing terminology. |
| 22:13:27 | <EvanR> | foldl and foldr appeal you specific reductions in situations where the order might matter |
| 22:13:33 | <EvanR> | appeal to* |
| 22:13:58 | <EvanR> | so some semblance of specificity is tacked onto the name |
| 22:14:07 | <zzz> | agree |
| 22:14:21 | <zzz> | but foldr is the "natural" one, isn't it |
| 22:14:32 | <probie> | `foldr` (on lists, not `Foldable` in general) doesn't rely on a narrative at all, and is _the_ fold for lists. If I was making the standard library (and didn't have a `Foldable` typeclass), I'd have just called it fold |
| 22:14:45 | <zzz> | the more fundamental one, using monochrome's terminology |
| 22:14:49 | <EvanR> | foldl is "natural" for snoc lists? |
| 22:15:16 | <probie> | Sure, but "snoc lists" aren't "lists", you've just moved the conversation from lists back to `Foldable` |
| 22:15:17 | <monochrom> | This is why I don't say "fold" I say "catamorphism". |
| 22:15:26 | <EvanR> | fold = foldr for lists makes sense because performance |
| 22:15:45 | <zzz> | monochrom: catar / catal :p |
| 22:15:52 | <EvanR> | doing it in another order would get the same answer but be silly |
| 22:16:41 | <EvanR> | fold = foldr in general I don't know about that |
| 22:17:05 | <zzz> | EvanR: silly is a strong word |
| 22:17:11 | <EvanR> | yeah catamorphism is something else |
| 22:17:32 | <EvanR> | which is a transformation rather than a reduction |
| 22:17:33 | <probie> | monochrom: if I say {cata,ana,hylo}morphism instead of {∅,un,re}fold, I get in trouble for being elitist |
| 22:17:39 | <EvanR> | but you can implement one with the other |
| 22:19:19 | × | CiaoSen quits (~Jura@2a05:5800:22f:a900:e6b9:7aff:fe80:3d03) (Ping timeout: 264 seconds) |
| 22:19:27 | <zzz> | i think i get it. thanks |
| 22:22:05 | <probie> | EvanR: I don't think you're right about them being different. In "Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire" there's the line "Without special notations pinpointing cata such as (|_|) or foldr" |
| 22:22:38 | <probie> | The people who brought the term "catamorphism" to the "mainstream", think that `foldr` is a catamorphism |
| 22:22:41 | <EvanR> | that doesn't prove I'm not right it proves what people mean by foldr isn't universal |
| 22:23:12 | → | AlexNoo_ joins (~AlexNoo@94.233.240.239) |
| 22:23:32 | <monochrom> | I would simply leave communities that think that "catamorphism" is elitist. |
| 22:24:19 | <monochrom> | And circling back, perhaps they do so for power trips. |
| 22:24:45 | <Rembane> | +1 |
| 22:25:20 | <EvanR> | I never understood elitist-as-derogatory from any perspective |
| 22:25:34 | <monochrom> | Accusing other people of "watering down" is a power trip, but so is accusing other people of "elitist", generally accusing anything at all. |
| 22:26:06 | <monochrom> | Generally accusing other people of "being different from me". |
| 22:26:19 | × | halloy5409 quits (~halloy540@147.235.212.157) (Remote host closed the connection) |
| 22:26:33 | × | AlexNoo quits (~AlexNoo@94.233.241.125) (Ping timeout: 252 seconds) |
| 22:26:46 | × | AlexZenon quits (~alzenon@94.233.241.125) (Ping timeout: 272 seconds) |
| 22:27:42 | <EvanR> | let code do the talking xD |
| 22:27:54 | <EvanR> | WildlyPopularProfitableMMO here we go |
| 22:28:14 | <EvanR> | it will be called Elite: Dangerist |
| 22:30:08 | <Rembane> | I first thought WildlyPopularProfitableMMO was a language extension... took me a while to realize that it's not. |
| 22:30:35 | <zzz> | i wonder if APL-type languages have arguments about which symbol makes more sense for a given function |
| 22:30:51 | <Rembane> | zzz: IIRC they do |
| 22:30:56 | <EvanR> | it's a type synonym for an outlandishly detailed dependent type for elon's AI to solve for |
| 22:31:01 | <Rembane> | zzz: It's a selling point |
| 22:31:19 | <zzz> | i'm not surprised at all :D |
| 22:31:27 | <Rembane> | EvanR: But does it do Blockchain? |
| 22:32:28 | <EvanR> | but is it webscale? but will it blend? |
| 22:32:51 | <Rembane> | And how well does it do microservices? |
| 22:33:05 | <EvanR> | vom |
| 22:33:24 | × | ystael quits (~ystael@user/ystael) (Ping timeout: 276 seconds) |
| 22:33:28 | → | zetef joins (~quassel@2a02:2f00:5202:1200:3fa2:e908:b522:fa2f) |
| 22:33:44 | × | zetef quits (~quassel@2a02:2f00:5202:1200:3fa2:e908:b522:fa2f) (Client Quit) |
| 22:34:04 | <Rembane> | Can almost quit from vom |
| 22:34:04 | → | AlexZenon joins (~alzenon@94.233.240.239) |
| 22:37:33 | × | infinity0 quits (~infinity0@pwned.gg) (Ping timeout: 252 seconds) |
| 22:38:41 | <zzz> | elite and niche are different concepts imo, i'm not sure which one would apply better here |
| 22:39:54 | <EvanR> | elite is effective and useful while niche isn't? xD |
| 22:41:55 | <zzz> | what would be effecrive and useful i suspect is content-addressable code |
| 22:42:08 | <zzz> | like in Unison |
| 22:42:12 | <Rembane> | Elite content-addressable code! |
| 22:42:39 | <EvanR> | Elite: Content-Addressable |
| 22:42:51 | <Rembane> | Good DLC that one |
| 22:45:33 | <zzz> | anyways, thank you for making me understand Foldable better |
| 22:50:12 | <raehik> | I have a `Text -> m ByteString` parser where I know the maximum length the result can be from the length of the Text. I could use the `createUpToN` bytestring primitives to only allocate once. however, one could write "malicious" inputs that have a long max length, but a short parsed length |
| 22:51:04 | <raehik> | is this sort of thing still a good idea? I'm never quite sure. I can always do a regular growing buffer which is likely hardly worse performance |
| 22:52:03 | × | ddellacosta quits (~ddellacos@ool-44c73d29.dyn.optonline.net) (Ping timeout: 245 seconds) |
| 22:56:21 | <raehik> | (also, what's the word compsci ppl use for "malicious" there, worst-case inputs? begins with P I swear) |
| 22:56:35 | <c_wraith> | pathological |
| 22:56:42 | <raehik> | c_wraith: ahhhh yes thanks :) |
| 22:56:47 | <raehik> | knew it was medical |
| 22:58:07 | <EvanR> | is the final ByteString built up from chunks? produce a list of chunks then join it all |
| 22:58:25 | <EvanR> | or better yet, produce a lazy bytestring from it |
| 22:58:34 | → | infinity0 joins (~infinity0@pwned.gg) |
| 22:59:33 | <raehik> | ah I tend to only think in terms of strict bytestrings |
| 23:00:27 | <EvanR> | or just work with the list of smaller strict ByteStrings which is effectively the same thing |
| 23:01:07 | <EvanR> | depends what you will do with it |
| 23:01:08 | <raehik> | how would I chunk in this situation? or are you suggesting not to do the `createUpToN` idea |
| 23:01:31 | <raehik> | the output will be written directly to memory or disk somewhere |
| 23:01:43 | <raehik> | (if used) |
| 23:01:48 | <EvanR> | are you proposing to allocate N then mutate the bytes later? |
| 23:01:54 | <EvanR> | I'd avoid that |
| 23:01:59 | <raehik> | https://hackage.haskell.org/package/bytestring-0.12.1.0/docs/Data-ByteString-Internal.html#v:createUptoN |
| 23:02:14 | <EvanR> | IO :( |
| 23:02:32 | <raehik> | not sure what's wrong with that |
| 23:02:45 | <EvanR> | well then your parser needs IO |
| 23:03:02 | <raehik> | I have a library that hides all this haha https://hackage.haskell.org/package/bytezap |
| 23:03:10 | <EvanR> | you kind of can't hide IO |
| 23:03:33 | <EvanR> | ok, unsafePerformIO ... which is getting fishy fast |
| 23:04:36 | <raehik> | bytestring provides unsafeCreateUptoN as well which handles the IO unwrapping for us |
| 23:04:43 | × | target_i quits (~target_i@user/target-i/x-6023099) (Quit: leaving) |
| 23:04:58 | <raehik> | this is how most low-level bytestring manipulation is performed |
| 23:06:11 | <EvanR> | ok but why do you want to do it xD |
| 23:06:41 | <EvanR> | don't you like your programs to not segfault |
| 23:07:09 | <EvanR> | with zero explanation of when or why |
| 23:07:21 | <raehik> | my original point was that `createUptoN` lets me do a single allocation for all inputs without having to grow a buffer or do other stuff, which is fast |
| 23:07:43 | <EvanR> | my suggestion didn't involve an IO based growing buffer or mutators |
| 23:07:44 | <raehik> | but you can pass pathological inputs which could waste lots of memory |
| 23:08:07 | <raehik> | oh sorry I don't think I understood properly then |
| 23:08:30 | <EvanR> | a follow up was if your output is based on many small bytestring chunks logically glued together |
| 23:08:45 | <EvanR> | or more complicated than that |
| 23:09:17 | <raehik> | no the output is used as-is, not plugged together to more bytestrings |
| 23:09:50 | <EvanR> | no... |
| 23:12:05 | <raehik> | do you mean can the output be chunked conveniently during parsing? It can with a bit of bookkeeping |
| 23:12:49 | <raehik> | but the single ByteString output isn't manipulated afterwards |
| 23:12:54 | <EvanR> | I was wondering if you generate the output as simple chunks one after the other, not if you will later concat the output onto something else |
| 23:13:07 | × | brettgilio quits (~brettgili@154.3.237.18) (Quit: The Lounge - https://thelounge.chat) |
| 23:13:10 | <EvanR> | generate vs consume |
| 23:13:36 | <raehik> | ah no assume it's not being used in a chunking context |
| 23:13:49 | <EvanR> | that... is not what |
| 23:14:10 | <EvanR> | not asking about how you consume it |
| 23:14:45 | <raehik> | I assumed you asked if the parsing is called sequentially on a large input, chunking as required |
| 23:14:59 | → | rvalue- joins (~rvalue@user/rvalue) |
| 23:15:05 | <raehik> | it isn't. was that not what you were asking |
| 23:15:19 | <raehik> | (sry for the misunderstandings) |
| 23:15:20 | × | rvalue quits (~rvalue@user/rvalue) (Ping timeout: 252 seconds) |
| 23:16:52 | <EvanR> | nope not talking about consume input either |
| 23:17:05 | <EvanR> | or consuming anything at all, oh well! |
| 23:19:00 | rvalue- | is now known as rvalue |
| 23:19:00 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 23:19:27 | <probie> | zzz: I've not seen many arguments in the APL community around the choice of symbols. The only one that comes to mind is that from time to time, people suggest replacing `/` for either reduce or replicate |
| 23:19:29 | <raehik> | I'm sorry I haven't understood your questions properly. I'd like to think it's the text medium's fault rather than either of ours |
| 23:24:13 | → | pavonia joins (~user@user/siracusa) |
| 23:32:51 | × | Tuplanolla quits (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
| 23:51:04 | × | acidjnk_new3 quits (~acidjnk@p200300d6e72cfb069cd6142dbab03153.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 23:53:11 | <zzz> | probie: oh no |
| 23:53:27 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 23:54:44 | zzz | is now known as zero |
| 23:58:43 | × | waleee quits (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 245 seconds) |
All times are in UTC on 2024-08-08.