Logs on 2022-06-27 (liberachat/#haskell)
| 00:01:31 | <EvanR> | o/ |
| 00:02:13 | <hololeap> | o\ |
| 00:02:29 | × | shiraeeshi quits (~shiraeesh@109.166.58.140) (Ping timeout: 255 seconds) |
| 00:02:33 | <hololeap> | dammit |
| 00:03:23 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 00:05:44 | <EvanR> | you just confounded the nazis congrats |
| 00:05:46 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b))) |
| 00:05:46 | → | allbery_b joins (~geekosaur@xmonad/geekosaur) |
| 00:05:49 | allbery_b | is now known as geekosaur |
| 00:08:11 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds) |
| 00:16:53 | <Axman6> | \/o\ |
| 00:17:24 | <Axman6> | damn, meant to be /o\ but forgot about /msg |
| 00:22:11 | × | sudden quits (~cat@user/sudden) (Ping timeout: 246 seconds) |
| 00:23:03 | → | sudden joins (~cat@user/sudden) |
| 00:23:18 | <Axman6> | \o/ |
| 00:24:59 | × | Guest|92 quits (~Guest|92@35.24.208.138) (Ping timeout: 255 seconds) |
| 00:33:12 | → | benin01 joins (~benin@2401:4900:2324:7abf:724c:ce62:d5cf:9ec8) |
| 00:35:36 | × | benin0 quits (~benin@183.82.24.201) (Ping timeout: 268 seconds) |
| 00:35:36 | benin01 | is now known as benin0 |
| 00:39:29 | → | benin03 joins (~benin@183.82.179.110) |
| 00:41:29 | × | benin0 quits (~benin@2401:4900:2324:7abf:724c:ce62:d5cf:9ec8) (Ping timeout: 248 seconds) |
| 00:41:29 | benin03 | is now known as benin0 |
| 00:44:06 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 00:45:45 | → | Guest|92 joins (~Guest|92@35.24.208.138) |
| 00:46:35 | × | alp quits (~alp@user/alp) (Ping timeout: 255 seconds) |
| 00:49:31 | × | lainon quits (~lainon@c-68-46-201-40.hsd1.al.comcast.net) (Quit: Textual IRC Client: www.textualapp.com) |
| 00:49:53 | → | lainon joins (~lainon@2601:7c0:c500:4d20:2ca2:483a:8f15:302d) |
| 00:51:03 | × | lainon quits (~lainon@2601:7c0:c500:4d20:2ca2:483a:8f15:302d) (Client Quit) |
| 00:57:11 | × | machinedgod quits (~machinedg@66.244.246.252) (Ping timeout: 246 seconds) |
| 00:57:42 | → | cyanide3dinner joins (~cyanide4d@106.201.249.151) |
| 01:01:10 | × | glguy quits (x@libera/staff/glguy) (Ping timeout: 600 seconds) |
| 01:02:32 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 01:09:13 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 248 seconds) |
| 01:09:20 | → | ezzieyguywuf joins (~Unknown@user/ezzieyguywuf) |
| 01:10:06 | × | Guest|92 quits (~Guest|92@35.24.208.138) (Ping timeout: 272 seconds) |
| 01:10:45 | × | xff0x quits (~xff0x@2405:6580:b080:900:a1f7:c498:d5bb:4b94) (Ping timeout: 268 seconds) |
| 01:11:05 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 01:13:32 | → | nate4 joins (~nate@98.45.169.16) |
| 01:17:12 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 01:22:44 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 246 seconds) |
| 01:29:15 | → | jmcarthur joins (~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) |
| 01:32:03 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 01:33:33 | × | cyanide3dinner quits (~cyanide4d@106.201.249.151) (Remote host closed the connection) |
| 01:33:51 | <maralorn> | Soo, what’s exactly the reason that there is no FromJSON instance for bytestring? |
| 01:34:04 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 01:34:14 | × | jmcarthur quits (~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
| 01:34:47 | <Axman6> | which one should it be? |
| 01:34:56 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 01:35:34 | <Axman6> | encodeUtf8 <$> fromJSON t? fromBase64 =<< fromJSON t? |
| 01:36:30 | <Axman6> | what's the canonical way to store arbitrary bytes in JSON? |
| 01:43:23 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Quit: WeeChat 3.5) |
| 01:44:24 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 01:45:30 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 01:47:02 | <monochrom> | I have the same thought but apparently a lot of people eagerly desire a pass-through bytestring instance for FromJSON and ToJSON. |
| 01:47:46 | <monochrom> | It seems that the lessons of SQL injection didn't stick. |
| 01:50:11 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 01:54:40 | → | xff0x joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) |
| 01:58:29 | → | gurkenglas joins (~gurkengla@dslb-002-203-144-112.002.203.pools.vodafone-ip.de) |
| 02:00:46 | <maralorn> | k, makes sense. |
| 02:02:01 | <maralorn> | desire is a bit strong. What I have is a monomorphic parser which takes ByteStrings and sadly I need to apply that parser to a string in the JSON. |
| 02:02:33 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 02:02:38 | <maralorn> | Was wondering if I can save myself one copy, but apparently I can‘t. |
| 02:03:01 | <jackdk> | maralorn: more detail about this "monomorphic parser"? |
| 02:03:50 | <maralorn> | jackdk: I have an attoparsec parser which takes ByteString. I could rewrite it to use Text, but I need it mostly for ByteString and sometimes for Text. |
| 02:04:00 | × | lemonsnicks quits (~lemonsnic@cpc159519-perr18-2-0-cust114.19-1.cable.virginm.net) (Quit: ZNC 1.8.2 - https://znc.in) |
| 02:04:12 | <maralorn> | Is there a Trick to write an attoparsec Parser polymorphic? |
| 02:04:43 | <jackdk> | I don't know attoparsec well enough to say, and I haven't seen any banner ads to that effect |
| 02:04:47 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 02:07:10 | <Axman6> | https://hackage.haskell.org/package/attoparsec-0.14.4/docs/Data-Attoparsec-Internal-Types.html#t:Parser is polymorphic ove the underlying type, and Data.Attoparsec and Data.Attoparsec.Text both use the same definition |
| 02:07:32 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 246 seconds) |
| 02:07:44 | × | gurkenglas quits (~gurkengla@dslb-002-203-144-112.002.203.pools.vodafone-ip.de) (Ping timeout: 272 seconds) |
| 02:09:24 | <Axman6> | whether that means you can actually write a generic parser I'm not sure, you probably can't |
| 02:24:03 | → | gurkenglas joins (~gurkengla@dslb-002-203-144-112.002.203.pools.vodafone-ip.de) |
| 02:24:26 | → | lemonsnicks joins (~lemonsnic@cpc159519-perr18-2-0-cust114.19-1.cable.virginm.net) |
| 02:26:29 | <EvanR> | it's funny I guess json is intended to be transferred as unicode text and not bytes |
| 02:26:39 | <EvanR> | enjoy |
| 02:27:57 | <EvanR> | when will the matrix future happen and the native channel is just unicode text |
| 02:29:41 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 02:30:12 | → | pseigo joins (~pseigo@node-1w7jr9ye7hx4fkp40wi692pl2.ipv6.telus.net) |
| 02:30:17 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 248 seconds) |
| 02:31:09 | → | nate4 joins (~nate@98.45.169.16) |
| 02:34:20 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 02:36:35 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 02:36:37 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 02:38:55 | × | funsafe quits (~funsafe@76.105.238.154) (Quit: funsafe) |
| 02:42:17 | × | terrorjack quits (~terrorjac@2a01:4f8:1c1e:509a::1) (Quit: The Lounge - https://thelounge.chat) |
| 02:42:36 | → | yax__ joins (~yax__@user/yax/x-9576643) |
| 02:42:57 | <yax__> | hihi what exactly does fix do? |
| 02:43:32 | <ski> | it fixes your program |
| 02:43:32 | → | terrorjack joins (~terrorjac@2a01:4f8:1c1e:509a::1) |
| 02:43:38 | <ski> | > fix error |
| 02:43:40 | <lambdabot> | "*Exception: *Exception: *Exception: *Exception: *Exception: *Exception: *Ex... |
| 02:43:46 | <ski> | > fix show |
| 02:43:47 | <lambdabot> | "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\... |
| 02:43:59 | <yax__> | fix (\rec n -> if n <= 1 then 1 else n * rec (n-1)) 5 |
| 02:44:07 | <yax__> | this is the hackage example |
| 02:44:21 | <yax__> | > fix (\rec n -> if n <= 1 then 1 else n * rec (n-1)) 5 |
| 02:44:22 | <lambdabot> | 120 |
| 02:44:25 | <yax__> | huh |
| 02:44:28 | <yax__> | works |
| 02:45:06 | × | td_ quits (~td@94.134.91.9) (Ping timeout: 268 seconds) |
| 02:45:06 | → | frost joins (~frost@user/frost) |
| 02:45:12 | → | jmdaemon joins (~jmdaemon@user/jmdaemon) |
| 02:45:15 | <ski> | > fix (\fibs -> 0 : 1 : [m + n | m <- fibs | n <- tail fibs]) |
| 02:45:17 | <lambdabot> | [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,... |
| 02:45:46 | <yax__> | the implementation is rather confusing too |
| 02:45:47 | <yax__> | fix f = let x = f x in x |
| 02:45:49 | <ski> | `fix f' applies `f' to the result of that application, and gives you nack the result |
| 02:45:52 | <ski> | fix f = x |
| 02:45:54 | <ski> | where |
| 02:45:56 | <ski> | x = f x |
| 02:46:00 | <ski> | is how i'd write it |
| 02:46:21 | <ski> | the result of calling `f', namely `x', is passed as input to that call to `f' |
| 02:46:34 | → | td_ joins (~td@muedsl-82-207-238-059.citykom.de) |
| 02:46:41 | <yax__> | yeah i mean i get that it gives you the value where f x == x |
| 02:46:46 | <ski> | so, `fix (1 :)' becomes `let x = 1 : x in x' |
| 02:47:13 | <yax__> | whaa |
| 02:47:21 | <yax__> | > fix (1 :) |
| 02:47:23 | <lambdabot> | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1... |
| 02:47:26 | <ski> | and `fix (\rec n -> ..rec..n..)' becomes `let x = \n -> ..x..n.. in x' |
| 02:47:39 | <yax__> | i see |
| 02:48:16 | <yax__> | i like how the most mundane of functions have the most profound implications |
| 02:48:31 | <ski> | `fix' encapsulates (general) recursion |
| 02:48:37 | <ski> | @type fix |
| 02:48:39 | <lambdabot> | (a -> a) -> a |
| 02:49:19 | <ski> | logically speaking, its type expresses a paradox, "circular reasoning". assuming that from `a' follows `a', you can conclude that `a' is the cqase |
| 02:49:51 | <ski> | (practically, this manifests as `fix' can introduce non-termination. e.g. `fix id') |
| 02:50:32 | <yax__> | isn't (a -> a) -> a always true? |
| 02:50:57 | <ski> | anyway .. practical use of `fix' is mostly as a shorthand for tying cycles, when you'd prefer to avoid doing an explicit recursive binding |
| 02:51:37 | <ski> | nope. take `a' to be `False'. then `False -> False' is `True', so `(False -> False) -> False' is `True -> False', which is `False' |
| 02:51:46 | <ski> | @djinn (a -> a) -> a |
| 02:51:46 | <lambdabot> | -- f cannot be realized. |
| 02:52:45 | <ski> | @let ant --> succ = not ant || succ |
| 02:52:47 | <lambdabot> | Defined. |
| 02:52:50 | <yax__> | ski: hm makes sense |
| 02:52:55 | <ski> | > (False --> False) --> False |
| 02:52:57 | <lambdabot> | False |
| 02:53:46 | <ski> | @djinn (Either a b -> c) -> (a -> c,b -> c) |
| 02:53:46 | <lambdabot> | f a = (\ b -> a (Left b), \ c -> a (Right c)) |
| 02:54:13 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 02:54:36 | × | zmt00 quits (~zmt00@user/zmt00) (Quit: Leaving) |
| 02:54:48 | <ski> | (that's a proof that `((a || b) --> c) --> ((a --> c) && (b --> c)' is a tautology) |
| 02:56:15 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 02:56:24 | <yax__> | yeah im familiar with curry howard correspondence |
| 02:56:37 | <ski> | @help djinn |
| 02:56:37 | <lambdabot> | djinn <type>. |
| 02:56:37 | <lambdabot> | Generates Haskell code from a type. |
| 02:56:37 | <lambdabot> | https://github.com/augustss/djinn |
| 02:57:07 | → | zmt00 joins (~zmt00@user/zmt00) |
| 02:57:32 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 255 seconds) |
| 02:58:15 | <justsomeguy> | What's a straight-forward definition of scanr for lists, using primitive recursion? |
| 02:58:22 | <ski> | .. occasonally, you want to instrument a recursion in some way. one way to do that is to reexpress it using `fix', and then replace `fix' with an instrumented version |
| 02:58:47 | <yax__> | whats wrong with just normal recursion |
| 02:59:01 | <ski> | @src scanr |
| 02:59:01 | <lambdabot> | scanr _ q0 [] = [q0] |
| 02:59:01 | <lambdabot> | scanr f q0 (x:xs) = f x q : qs |
| 02:59:01 | <lambdabot> | where qs@(q:_) = scanr f q0 xs |
| 02:59:22 | <ski> | justsomeguy : ^ seems to fit the bill, no ? |
| 03:00:59 | <ski> | (primitive recursion allows you do pattern-match one constructor deep at each step, and to refer both to the parts individually (including the recursive "children"), as well as to the recursive call(s) applied to the recursive part(s) |
| 03:01:18 | <ski> | .. but not to any other kind of recursive call) |
| 03:01:26 | <yax__> | i see |
| 03:02:01 | <justsomeguy> | Yes. I'm going to try and rewrite it without the as-pattern, though. |
| 03:02:24 | <ski> | try returning a pair, and use `fst' |
| 03:03:20 | <ski> | (and then wrap the whole thing so that the final pair is turned into a cons) |
| 03:03:57 | <yax__> | is haskell2020 still a thing or no? |
| 03:06:52 | ← | yax__ parts (~yax__@user/yax/x-9576643) () |
| 03:07:30 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 03:10:12 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 03:11:48 | <ski> | "Haskell2020 Is Dead, but All Hope Is Not Lost" by isovector in 2019-11-01 at <https://reasonablypolymorphic.com/blog/haskell202x/> might be relevant |
| 03:18:41 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 255 seconds) |
| 03:20:51 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds) |
| 03:23:18 | × | Unicorn_Princess quits (~Unicorn_P@93-103-228-248.dynamic.t-2.net) (Remote host closed the connection) |
| 03:25:00 | × | pseigo quits (~pseigo@node-1w7jr9ye7hx4fkp40wi692pl2.ipv6.telus.net) (Ping timeout: 272 seconds) |
| 03:25:51 | → | Lumia joins (~Lumia@c-73-219-104-153.hsd1.ma.comcast.net) |
| 03:27:20 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds) |
| 03:47:37 | → | bilegeek joins (~bilegeek@2600:1008:b026:2e89:6877:94a7:35f5:1308) |
| 03:47:38 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 246 seconds) |
| 03:55:24 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 272 seconds) |
| 03:56:35 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 03:56:35 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 03:56:35 | → | wroathe joins (~wroathe@user/wroathe) |
| 03:58:57 | → | glguy joins (x@libera/staff/glguy) |
| 03:58:57 | × | glguy quits (x@libera/staff/glguy) (Excess Flood) |
| 04:01:16 | → | glguy joins (x@libera/staff/glguy) |
| 04:01:16 | × | glguy quits (x@libera/staff/glguy) (Excess Flood) |
| 04:03:30 | → | glguy joins (x@libera/staff/glguy) |
| 04:05:32 | → | pseigo joins (~pseigo@d108-173-20-33.abhsia.telus.net) |
| 04:13:53 | × | Lumia quits (~Lumia@c-73-219-104-153.hsd1.ma.comcast.net) (Quit: ,-) |
| 04:16:29 | → | daylily joins (~Thunderbi@180.108.98.221) |
| 04:17:08 | ← | daylily parts (~Thunderbi@180.108.98.221) () |
| 04:18:12 | × | rekahsoft quits (~rekahsoft@bras-base-wdston4533w-grc-02-142-113-160-8.dsl.bell.ca) (Ping timeout: 272 seconds) |
| 04:19:10 | <albet70> | there will be another compiler? |
| 04:19:18 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 04:32:56 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 255 seconds) |
| 04:34:22 | → | catern joins (~sbaugh@2604:2000:8fc0:b:a9c7:866a:bf36:3407) |
| 04:45:05 | → | arjun joins (~arjun@user/arjun) |
| 04:45:42 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
| 04:45:45 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 04:53:48 | → | iteratee joins (~kyle@162.218.222.107) |
| 04:59:57 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 05:00:13 | → | img joins (~img@user/img) |
| 05:02:50 | × | phma quits (~phma@2001:5b0:210d:23f8:ec0e:65c8:65bb:d30) (Read error: Connection reset by peer) |
| 05:03:34 | → | phma joins (~phma@host-67-44-208-140.hnremote.net) |
| 05:09:17 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 05:11:59 | → | leib joins (~leib@2405:201:900a:f088:20:d9ad:dec:577d) |
| 05:13:26 | → | califax joins (~califax@user/califx) |
| 05:14:20 | → | titibandit joins (~thibaut@xdsl-78-34-167-250.nc.de) |
| 05:16:28 | → | dcoutts_ joins (~duncan@host86-150-18-54.range86-150.btcentralplus.com) |
| 05:18:20 | → | kimjetwav joins (~user@2607:fea8:2340:da00:2c1:c09d:7773:d7fc) |
| 05:18:59 | × | dcoutts quits (~duncan@host86-150-18-54.range86-150.btcentralplus.com) (Ping timeout: 246 seconds) |
| 05:19:41 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds) |
| 05:22:37 | → | shiraeeshi joins (~shiraeesh@46.34.207.224) |
| 05:30:02 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 05:31:21 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 05:43:08 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 246 seconds) |
| 05:43:19 | → | Guest25 joins (~Guest25@158.181.17.231) |
| 05:45:09 | × | Guest25 quits (~Guest25@158.181.17.231) (Client Quit) |
| 05:46:03 | × | liz_ quits (~liz@host86-159-158-175.range86-159.btcentralplus.com) (Quit: Lost terminal) |
| 05:46:47 | → | caef^ joins (~caef@50.237.44.186) |
| 05:47:39 | → | vysn joins (~vysn@user/vysn) |
| 05:48:23 | × | toluene quits (~toluene@user/toulene) (Ping timeout: 246 seconds) |
| 05:49:31 | → | coot joins (~coot@213.134.190.95) |
| 05:50:19 | × | coot quits (~coot@213.134.190.95) (Client Quit) |
| 05:50:43 | → | coot joins (~coot@213.134.190.95) |
| 05:50:55 | → | toluene joins (~toluene@user/toulene) |
| 05:51:16 | × | wroathe quits (~wroathe@user/wroathe) (Remote host closed the connection) |
| 05:51:23 | × | coot quits (~coot@213.134.190.95) (Read error: Connection reset by peer) |
| 05:51:29 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 05:51:29 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 05:51:29 | → | wroathe joins (~wroathe@user/wroathe) |
| 05:51:32 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 05:53:19 | × | shiraeeshi quits (~shiraeesh@46.34.207.224) (Read error: Connection reset by peer) |
| 05:54:57 | × | foul_owl quits (~kerry@23.82.194.107) (Ping timeout: 244 seconds) |
| 06:01:51 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 06:05:48 | × | vysn quits (~vysn@user/vysn) (Quit: WeeChat 3.5) |
| 06:06:09 | → | vysn joins (~vysn@user/vysn) |
| 06:06:09 | → | shiraeeshi[m] joins (~shiraeesh@2001:470:69fc:105::1:77) |
| 06:09:11 | → | _ht joins (~quassel@231-169-21-31.ftth.glasoperator.nl) |
| 06:10:17 | → | foul_owl joins (~kerry@23.82.194.108) |
| 06:14:10 | → | michalz joins (~michalz@185.246.204.101) |
| 06:18:50 | <tdammers> | albet70: no, that's not what that says. more like, there *should* be another compiler. |
| 06:19:10 | <tdammers> | I mean, there are other Haskell compilers, they're just nowhere near "industry strength" |
| 06:21:37 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 06:27:03 | → | marinelli[m] joins (~marinelli@2001:470:69fc:105::2d8) |
| 06:27:08 | → | bitdex_ joins (~bitdex@gateway/tor-sasl/bitdex) |
| 06:27:56 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 06:30:39 | → | mbuf joins (~Shakthi@223.178.68.221) |
| 06:33:49 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 06:33:50 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 06:33:50 | → | wroathe joins (~wroathe@user/wroathe) |
| 06:35:11 | <albet70> | that would be great |
| 06:36:04 | <energizer> | what is good about another compiler? |
| 06:38:12 | <albet70> | get rid of the old history stuff and make something new? |
| 06:38:43 | <albet70> | I suggest replace :: to : |
| 06:39:08 | × | titibandit quits (~thibaut@xdsl-78-34-167-250.nc.de) (Remote host closed the connection) |
| 06:39:29 | <energizer> | you're talking about a new language, not a new compiler |
| 06:40:33 | <albet70> | racket, guile and chez are scheme? |
| 06:40:44 | <Axman6> | Daml makes many of those syntactic changes to Haskell |
| 06:41:00 | <Axman6> | the "with syntax" for records as quite nice too |
| 06:42:21 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 06:45:45 | × | bilegeek quits (~bilegeek@2600:1008:b026:2e89:6877:94a7:35f5:1308) (Quit: Leaving) |
| 06:45:57 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 06:46:49 | <tdammers> | the article itself says that the benefit of having another industry-strength Haskell compiler would be that it would spark "friendly competition", just like clang vs. gcc did |
| 06:47:39 | <tdammers> | but it's been almost 3 years since Sandy wrote that, and there's still no trace of a competing compiler in sight, so my humble guess is that nobody out there considers it important enough to put their money where their mouth is and make a competing compiler |
| 06:48:18 | <tdammers> | we're kind of stuck in a local optimum - GHC isn't awkward enough to make people go "enough is enough" and make their own compiler with blackjack and hookers |
| 06:48:39 | <tdammers> | so instead everyone hacks away at gradual improvement of the status quo |
| 06:48:41 | × | vysn quits (~vysn@user/vysn) (Ping timeout: 268 seconds) |
| 06:52:55 | → | acidjnk joins (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) |
| 06:54:14 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 255 seconds) |
| 06:59:41 | → | mmhat joins (~mmh@p200300f1c7385dd6ee086bfffe095315.dip0.t-ipconnect.de) |
| 07:00:19 | → | Haskelytic joins (~Haskelyti@118.179.211.17) |
| 07:00:19 | → | acidjnk_new3 joins (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) |
| 07:02:47 | × | acidjnk quits (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) (Ping timeout: 255 seconds) |
| 07:07:12 | → | zeenk joins (~zeenk@2a02:2f04:a301:3d00:39df:1c4b:8a55:48d3) |
| 07:10:56 | → | gmg joins (~user@user/gehmehgeh) |
| 07:12:08 | × | shriekingnoise quits (~shrieking@201.212.175.181) (Quit: Quit) |
| 07:12:45 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:a397:2c8:2227:ff66) |
| 07:15:06 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 07:17:19 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 07:18:56 | <tomsmeding> | monochrom: ah sorry, yeah yahb2 got netsplit and apparently my systemd unit didn't register it for auto-restart |
| 07:19:10 | <tomsmeding> | also maybe I should make the yahb2 code itself more robust... nah |
| 07:20:39 | <davean> | tomsmeding: Hahaha, did clang vs. gcc spark competition? It just seemed GCC got shot like the old lame compiler it was. |
| 07:20:45 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 268 seconds) |
| 07:21:04 | <tomsmeding> | davean: hm? I'm missing some context? |
| 07:21:16 | <davean> | er, sorry, I mixed you up with tdammers |
| 07:21:22 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c51d:2109:9c76:c05f) (Remote host closed the connection) |
| 07:21:25 | <tomsmeding> | ah :) |
| 07:21:54 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 07:22:40 | <tdammers> | davean: that's another way of putting it. but it's not like gcc was useless trash at that point - it had just accumulated a lot of historical cruft, and there was little incentive for anyone to deal with it |
| 07:22:58 | <davean> | tdammers: I remember before GCC 3 was out - it was bad then |
| 07:23:04 | <davean> | It was just the option one reasonably had |
| 07:23:13 | → | yahb2 joins (~yahb2@2a01:4f8:c0c:5c7b::2) |
| 07:23:17 | <davean> | (And man, it was nice to secretly have icc) |
| 07:23:40 | <tomsmeding> | % fix error |
| 07:23:40 | <yahb2> | <interactive>:4:1: error: Variable not in scope: fix :: ([Char] -> a0) -> t |
| 07:23:47 | → | dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net) |
| 07:23:58 | → | cfricke joins (~cfricke@user/cfricke) |
| 07:24:25 | <tomsmeding> | % import Data.Function |
| 07:24:25 | <yahb2> | <no output> |
| 07:24:27 | <tomsmeding> | % fix error |
| 07:24:27 | <yahb2> | *** Exception: *** Exception: *** Exception: *** Exception: *** Exception: *** Exception: *** Exception: *** Exception: *** Exception: *** Exception: *** Exception: *** Exception: *** Exception: **... |
| 07:25:32 | <davean> | tdammers: I guess my point is it wasn't historical cruft that made GCC bad - it was bad when it was fairly young. |
| 07:26:06 | <davean> | Not mentioning that DISASTEROUS not quite 3 release RH did ... |
| 07:27:24 | → | alp joins (~alp@user/alp) |
| 07:28:53 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 07:30:02 | <Axman6> | yahb2! |
| 07:30:39 | <Axman6> | merijn: I saw you mention in another channel that AWS's docs are terrible - I always just resorted to using Amazonka's haddocks because they were far easier to follow |
| 07:31:37 | <Axman6> | jackdk: Just looked at your Amazonka PR - +805,925 −806,562 is hilarious XD |
| 07:32:10 | <jackdk> | Axman6: the power of code generation. I added some sorting so hopefully future gens have lower churn |
| 07:32:20 | <Axman6> | noice |
| 07:33:02 | <tomsmeding> | Axman6: https://git.tomsmeding.com/yahb2 |
| 07:33:20 | <Axman6> | you know it's a good day when you get to delete a comment starting with "NOTE: The implementations in this file are ugly" |
| 07:33:47 | <jackdk> | Also, while we're talking about that: I intend to merge the current regeneration of everything some time this week. There are some changes to amazonka-sts and amazonka-sso which _should_ be safe (and look good in my test deployments, so far), but it would be good to have additional eyes if you're using sts:AssumeRole, sts:AssumeRoleWithWebIdentity, or SSO to get your AWS credentials. |
| 07:33:59 | <Axman6> | Thank you for your service tomsmeding |
| 07:34:12 | <jackdk> | (the next step after that is to bump amazonka's botocore pin and see if we can generate current services against latest bindings) |
| 07:34:22 | <jackdk> | s/bindings/definitions/ |
| 07:34:24 | <Axman6> | Exciting :o |
| 07:34:48 | <jackdk> | And then at some point maybe start going after new services for which we do not yet have bindings at all |
| 07:35:05 | <Axman6> | Heh, github really failing with that PR: "The diff you're trying to view is too large. We only load the first 3000 changed files." and then it shows me three files before a "Something went wrong" message |
| 07:38:11 | <jackdk> | So yeah, if any of yooz are doing AWS stuff, particularly around auth, I'd love to get your input |
| 07:40:02 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 246 seconds) |
| 07:40:17 | <Axman6> | Sadly I am not |
| 07:41:13 | × | dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Ping timeout: 248 seconds) |
| 07:41:15 | → | mixfix41 joins (~sdenynine@user/mixfix41) |
| 07:41:42 | <merijn> | Axman6: I don't think "reimplemented this existing python code base for AWS in Haskell" is gonna be appreciated, not be a time safe :p |
| 07:42:02 | → | pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) |
| 07:42:12 | <merijn> | s/not/nor |
| 07:42:17 | <Axman6> | nah, it's just better docs in general, you don't need to care that it's haskell |
| 07:43:35 | → | coot joins (~coot@213.134.190.95) |
| 07:48:10 | → | MajorBiscuit joins (~MajorBisc@wlan-145-94-167-213.wlan.tudelft.nl) |
| 07:48:51 | × | leib quits (~leib@2405:201:900a:f088:20:d9ad:dec:577d) (Read error: Connection reset by peer) |
| 07:49:01 | → | acidjnk_new joins (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) |
| 07:49:12 | → | leib joins (~leib@2405:201:900a:f088:20:d9ad:dec:577d) |
| 07:50:58 | → | machinedgod joins (~machinedg@66.244.246.252) |
| 07:52:17 | × | acidjnk_new3 quits (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) (Ping timeout: 255 seconds) |
| 07:56:19 | <Axman6> | Huh, these "types" seem like they might be useful for writing maintainable programs, who knew! https://roman.pt/posts/dont-let-dicts-spoil-your-code/ |
| 07:59:09 | × | eod|fserucas_ quits (~eod|fseru@1.64.114.89.rev.vodafone.pt) (Quit: Leaving) |
| 07:59:09 | × | eod|fserucas quits (~eod|fseru@1.64.114.89.rev.vodafone.pt) (Quit: Leaving) |
| 07:59:25 | → | eod|fserucas joins (~eod|fseru@1.64.114.89.rev.vodafone.pt) |
| 07:59:26 | × | eod|fserucas quits (~eod|fseru@1.64.114.89.rev.vodafone.pt) (Client Quit) |
| 07:59:36 | <jackdk> | Also this "mutability" thing seems to cause a lot of grief... what if we didn't do that? |
| 07:59:44 | → | eod|fserucas joins (~eod|fseru@1.64.114.89.rev.vodafone.pt) |
| 07:59:50 | × | eod|fserucas quits (~eod|fseru@1.64.114.89.rev.vodafone.pt) (Client Quit) |
| 08:00:04 | → | fserucas joins (~fserucas@1.64.114.89.rev.vodafone.pt) |
| 08:00:56 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 08:01:17 | <merijn> | @quote cjs explain |
| 08:01:18 | <lambdabot> | cjs says: I have to explain this shit to people. I mean, I start out right, "Hey, you know how you always have these bugs because what you thought was in the variable is not there?" And I get all of |
| 08:01:18 | <lambdabot> | these nods of agreement. "Well, I've found a new language that solves that problem." Audience: "Ooooh! How?" Me: "There's no variables!" And then they all start moving away from me slowly.... |
| 08:02:41 | × | gurkenglas quits (~gurkengla@dslb-002-203-144-112.002.203.pools.vodafone-ip.de) (Ping timeout: 268 seconds) |
| 08:04:23 | <Axman6> | :If only they knew... |
| 08:10:08 | → | mikoto-chan joins (~mikoto-ch@esm-84-240-99-143.netplaza.fi) |
| 08:10:10 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz) |
| 08:10:18 | → | PiDelport joins (uid25146@id-25146.lymington.irccloud.com) |
| 08:13:14 | → | daylily joins (~Thunderbi@180.108.98.221) |
| 08:13:52 | × | caef^ quits (~caef@50.237.44.186) (Remote host closed the connection) |
| 08:17:22 | × | cosimone quits (~user@93-44-186-171.ip98.fastwebnet.it) (Remote host closed the connection) |
| 08:19:56 | → | benin08 joins (~benin@183.82.26.15) |
| 08:20:32 | → | cosimone joins (~user@2001:b07:ae5:db26:57c7:21a5:6e1c:6b81) |
| 08:20:37 | × | benin0 quits (~benin@183.82.179.110) (Ping timeout: 256 seconds) |
| 08:20:37 | benin08 | is now known as benin0 |
| 08:22:25 | × | pseigo quits (~pseigo@d108-173-20-33.abhsia.telus.net) (Ping timeout: 268 seconds) |
| 08:22:31 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) |
| 08:26:07 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 08:27:01 | × | mc47 quits (~mc47@xmonad/TheMC47) (Read error: Connection reset by peer) |
| 08:27:21 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) (Ping timeout: 268 seconds) |
| 08:28:26 | × | frost quits (~frost@user/frost) (Quit: Client closed) |
| 08:31:31 | → | frost joins (~frost@user/frost) |
| 08:31:40 | × | foul_owl quits (~kerry@23.82.194.108) (Ping timeout: 268 seconds) |
| 08:36:21 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 08:37:50 | → | ubert joins (~Thunderbi@p200300ecdf0da505f930c23effc470f7.dip0.t-ipconnect.de) |
| 08:39:41 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 08:41:30 | → | dschrempf joins (~dominik@17-12-190.cgnat.fonira.net) |
| 08:44:55 | → | Tuplanolla joins (~Tuplanoll@91-159-69-97.elisa-laajakaista.fi) |
| 08:47:26 | × | cosimone quits (~user@2001:b07:ae5:db26:57c7:21a5:6e1c:6b81) (Remote host closed the connection) |
| 08:47:34 | → | foul_owl joins (~kerry@23.82.194.108) |
| 08:48:17 | → | cosimone joins (~user@2001:b07:ae5:db26:57c7:21a5:6e1c:6b81) |
| 08:49:14 | → | sympt9 joins (~sympt@user/sympt) |
| 08:50:12 | × | Haskelytic quits (~Haskelyti@118.179.211.17) (Ping timeout: 252 seconds) |
| 08:50:39 | × | sympt quits (~sympt@user/sympt) (Ping timeout: 256 seconds) |
| 08:50:40 | sympt9 | is now known as sympt |
| 08:54:30 | × | noteness quits (~noteness@user/noteness) (Ping timeout: 268 seconds) |
| 08:56:59 | → | leeb joins (~leeb@KD106154142041.au-net.ne.jp) |
| 08:57:03 | → | acidjnk_new3 joins (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) |
| 08:57:27 | → | noteness joins (~noteness@user/noteness) |
| 09:00:06 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 09:00:39 | × | acidjnk_new quits (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) (Ping timeout: 268 seconds) |
| 09:03:50 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 240 seconds) |
| 09:06:12 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 09:13:58 | × | inversed quits (~inversed@97e3d74e.skybroadband.com) (Ping timeout: 240 seconds) |
| 09:22:37 | × | arjun quits (~arjun@user/arjun) (Remote host closed the connection) |
| 09:24:42 | × | ubert quits (~Thunderbi@p200300ecdf0da505f930c23effc470f7.dip0.t-ipconnect.de) (Ping timeout: 268 seconds) |
| 09:27:53 | × | daylily quits (~Thunderbi@180.108.98.221) (Ping timeout: 248 seconds) |
| 09:28:36 | × | mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
| 09:30:09 | → | inversed joins (~inversed@05412f44.skybroadband.com) |
| 09:33:21 | × | noteness quits (~noteness@user/noteness) (Ping timeout: 268 seconds) |
| 09:33:23 | → | kenaryn joins (~aurele@89-88-44-27.abo.bbox.fr) |
| 09:35:16 | <kenaryn> | Hello functional people. I have an existential question: please what purpose does `instance Ord Bool` serve? i.e. why would I want to test if True is greater than False? |
| 09:35:49 | → | noteness joins (~noteness@user/noteness) |
| 09:41:34 | <[Leary]> | kenaryn: You generally wouldn't. However, Ord has broad usage in e.g. efficient container types, and crucially: instances are compositional. |
| 09:42:45 | <[Leary]> | To put something in a Set or make it the key to a Map, it needs Ord, and it's simple to derive Ord when all the components (some of which may be Bool) have Ord. |
| 09:44:02 | <[exa]> | kenaryn: similarly you might notice that there's `instance Ord ()` |
| 09:44:32 | <[exa]> | it just removes a heap of various corner&special cases from the code that needs orderings |
| 09:47:32 | × | mikoto-chan quits (~mikoto-ch@esm-84-240-99-143.netplaza.fi) (Ping timeout: 272 seconds) |
| 09:49:13 | <PiDelport> | Ordering by Bool is also directly useful; for example, sorting a list by one or more Boolean properties. |
| 09:49:23 | × | noteness quits (~noteness@user/noteness) (Ping timeout: 268 seconds) |
| 09:51:46 | → | noteness joins (~noteness@user/noteness) |
| 09:52:05 | → | vysn joins (~vysn@user/vysn) |
| 09:52:57 | → | vglfr joins (~vglfr@coupling.penchant.volia.net) |
| 09:54:55 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 268 seconds) |
| 09:56:23 | × | ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Ping timeout: 256 seconds) |
| 09:56:43 | → | dyeplexer joins (~dyeplexer@user/dyeplexer) |
| 09:58:07 | × | kmein quits (~weechat@user/kmein) (Quit: ciao kakao) |
| 09:59:10 | → | cyanide3dinner joins (~cyanide4d@106.201.249.151) |
| 10:00:08 | → | kmein joins (~weechat@user/kmein) |
| 10:00:37 | × | vysn quits (~vysn@user/vysn) (Quit: WeeChat 3.5) |
| 10:01:09 | → | vysn joins (~vysn@user/vysn) |
| 10:01:31 | × | vysn quits (~vysn@user/vysn) (Client Quit) |
| 10:03:26 | <merijn> | kenaryn: You can also reverse the question: If an unambigous, lawful, correct instance exists, why would you not implement it? |
| 10:03:38 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 10:03:43 | <merijn> | If you never need it, no harm done. But who knows when it turns out to be useful at some point |
| 10:04:10 | <merijn> | And indeed, Ord is also used for things like sorting |
| 10:06:47 | → | vysn joins (~vysn@user/vysn) |
| 10:13:30 | × | acidjnk_new3 quits (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) (Ping timeout: 272 seconds) |
| 10:13:35 | × | leib quits (~leib@2405:201:900a:f088:20:d9ad:dec:577d) (Read error: Connection reset by peer) |
| 10:14:13 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 10:15:15 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 10:15:56 | → | sayola joins (~vekto@dslb-088-078-152-210.088.078.pools.vodafone-ip.de) |
| 10:16:25 | → | califax joins (~califax@user/califx) |
| 10:17:35 | → | kuribas joins (~user@ptr-17d51epftauu6rr1j35.18120a2.ip6.access.telenet.be) |
| 10:18:56 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 246 seconds) |
| 10:20:29 | jinsun | is now known as Guest2055 |
| 10:20:30 | → | jinsun__ joins (~jinsun@user/jinsun) |
| 10:20:30 | × | Guest2055 quits (~jinsun@user/jinsun) (Killed (strontium.libera.chat (Nickname regained by services))) |
| 10:20:30 | jinsun__ | is now known as jinsun |
| 10:23:42 | × | dcoutts_ quits (~duncan@host86-150-18-54.range86-150.btcentralplus.com) (Quit: Leaving) |
| 10:24:00 | → | dcoutts joins (~duncan@host86-150-18-54.range86-150.btcentralplus.com) |
| 10:24:47 | × | vysn quits (~vysn@user/vysn) (Quit: WeeChat 3.5) |
| 10:29:27 | × | xff0x quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 268 seconds) |
| 10:31:54 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 10:39:02 | → | acidjnk joins (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) |
| 10:45:10 | × | acidjnk quits (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) (Read error: Connection reset by peer) |
| 10:49:02 | → | mastarija joins (~mastarija@2a05:4f46:e02:8c00:8170:a7cd:202a:e54a) |
| 10:50:01 | <mastarija> | Can't recall if aeson has a utility function where it tries to cast Value of type String into one of more specific types like Bool, Null, or Number |
| 10:54:21 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 10:54:26 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 10:56:50 | × | vglfr quits (~vglfr@coupling.penchant.volia.net) (Ping timeout: 240 seconds) |
| 10:57:47 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 10:59:05 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 248 seconds) |
| 11:01:11 | → | gurkenglas joins (~gurkengla@dslb-002-203-144-112.002.203.pools.vodafone-ip.de) |
| 11:04:14 | <tdammers> | why would it ever do that? |
| 11:05:40 | → | acidjnk joins (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) |
| 11:07:37 | → | yax__ joins (~yax__@user/yax/x-9576643) |
| 11:09:51 | <kuribas> | that's called parsing? |
| 11:10:09 | × | mastarija quits (~mastarija@2a05:4f46:e02:8c00:8170:a7cd:202a:e54a) (Ping timeout: 268 seconds) |
| 11:10:14 | <kuribas> | and I disagree that Bool, Null or Number is more specific. |
| 11:10:46 | × | cosimone quits (~user@2001:b07:ae5:db26:57c7:21a5:6e1c:6b81) (Ping timeout: 268 seconds) |
| 11:11:34 | <jackdk> | @tell mastarjia `withText`, `withArray`, `withObject` etc. are what you're looking for |
| 11:11:34 | <lambdabot> | Consider it noted. |
| 11:13:29 | <kuribas> | those don't cast a String. |
| 11:14:06 | <kuribas> | they parse a Aeson.Value. |
| 11:16:41 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 246 seconds) |
| 11:17:54 | ← | yax__ parts (~yax__@user/yax/x-9576643) () |
| 11:19:03 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 11:22:37 | → | vysn joins (~vysn@user/vysn) |
| 11:23:37 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 248 seconds) |
| 11:24:02 | → | xff0x joins (~xff0x@2405:6580:b080:900:1209:1cd2:2f7d:b06b) |
| 11:24:34 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) |
| 11:25:15 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 11:28:57 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) (Ping timeout: 248 seconds) |
| 11:39:09 | → | Surobaki joins (~surobaki@137.44.222.80) |
| 11:42:36 | → | vglfr joins (~vglfr@46.96.142.249) |
| 11:47:51 | × | noteness quits (~noteness@user/noteness) (Remote host closed the connection) |
| 11:48:37 | → | noteness joins (~noteness@user/noteness) |
| 11:51:28 | × | acidjnk quits (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) (Ping timeout: 268 seconds) |
| 11:51:55 | → | chomwitt joins (~chomwitt@2a02:587:dc1c:800:5b3a:daea:252e:ac17) |
| 11:55:10 | → | daylily joins (~Thunderbi@180.108.98.221) |
| 11:56:31 | → | fweht joins (uid404746@id-404746.lymington.irccloud.com) |
| 11:56:31 | × | daylily quits (~Thunderbi@180.108.98.221) (Read error: Connection reset by peer) |
| 12:00:40 | → | acidjnk joins (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) |
| 12:02:39 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 12:03:13 | → | unit73e joins (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) |
| 12:03:35 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 12:03:52 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5) |
| 12:08:57 | × | vysn quits (~vysn@user/vysn) (Quit: WeeChat 3.5) |
| 12:09:15 | → | vysn joins (~vysn@user/vysn) |
| 12:14:50 | × | vglfr quits (~vglfr@46.96.142.249) (Ping timeout: 240 seconds) |
| 12:15:22 | × | frost quits (~frost@user/frost) (Quit: Client closed) |
| 12:20:48 | <kenaryn> | Allright, thank you [Leary] [exa] merijn |
| 12:21:21 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 12:23:31 | × | mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
| 12:25:23 | × | unit73e quits (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Ping timeout: 268 seconds) |
| 12:27:10 | → | CiaoSen joins (~Jura@p549cb4d1.dip0.t-ipconnect.de) |
| 12:28:36 | o | is now known as niko |
| 12:33:36 | → | frost joins (~frost@user/frost) |
| 12:35:21 | → | bitmapper joins (uid464869@id-464869.lymington.irccloud.com) |
| 12:37:27 | × | cyanide3dinner quits (~cyanide4d@106.201.249.151) (Remote host closed the connection) |
| 12:39:24 | × | kenaryn quits (~aurele@89-88-44-27.abo.bbox.fr) (Quit: leaving) |
| 12:40:34 | → | ubert joins (~Thunderbi@p200300ecdf0da505658f203d39a613fe.dip0.t-ipconnect.de) |
| 12:40:42 | × | zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection) |
| 12:44:30 | × | CiaoSen quits (~Jura@p549cb4d1.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 12:46:30 | → | pleo joins (~pleo@user/pleo) |
| 12:51:12 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 12:51:12 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 12:51:12 | × | bitdex_ quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 12:52:12 | × | zeenk quits (~zeenk@2a02:2f04:a301:3d00:39df:1c4b:8a55:48d3) (Quit: Konversation terminated!) |
| 12:52:16 | → | zaquest joins (~notzaques@5.130.79.72) |
| 12:52:16 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 12:52:28 | → | gmg joins (~user@user/gehmehgeh) |
| 12:52:49 | → | bitdex_ joins (~bitdex@gateway/tor-sasl/bitdex) |
| 12:53:15 | → | vglfr joins (~vglfr@46.96.142.249) |
| 12:53:27 | × | ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
| 12:57:50 | × | vglfr quits (~vglfr@46.96.142.249) (Ping timeout: 255 seconds) |
| 13:00:42 | × | Surobaki quits (~surobaki@137.44.222.80) (Remote host closed the connection) |
| 13:00:56 | → | Surobaki joins (~surobaki@137.44.222.80) |
| 13:02:30 | × | Katarushisu quits (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) (Quit: The Lounge - https://thelounge.chat) |
| 13:03:01 | → | Katarushisu joins (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) |
| 13:04:00 | → | z0k joins (~z0k@206.84.143.59) |
| 13:04:48 | × | Katarushisu quits (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) (Client Quit) |
| 13:05:22 | → | Katarushisu joins (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) |
| 13:07:15 | × | Katarushisu quits (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) (Client Quit) |
| 13:08:28 | → | Katarushisu joins (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) |
| 13:08:50 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds) |
| 13:10:41 | → | szkl joins (uid110435@id-110435.uxbridge.irccloud.com) |
| 13:11:15 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 13:11:39 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds) |
| 13:14:20 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 13:16:31 | → | acidjnk_new joins (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) |
| 13:19:49 | × | acidjnk quits (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) (Ping timeout: 256 seconds) |
| 13:20:58 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 13:25:41 | → | vglfr joins (~vglfr@46.96.142.249) |
| 13:25:49 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 268 seconds) |
| 13:26:18 | × | frost quits (~frost@user/frost) (Ping timeout: 252 seconds) |
| 13:32:41 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 13:38:46 | → | zer0bitz joins (~zer0bitz@2001:2003:f748:2000:f847:6b9c:c1af:408a) |
| 13:40:26 | → | [_] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 13:41:39 | → | cosimone joins (~user@93-44-186-171.ip98.fastwebnet.it) |
| 13:42:49 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 248 seconds) |
| 13:44:33 | → | acidjnk_new3 joins (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) |
| 13:44:39 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 13:46:21 | [_] | is now known as [itchyjunk] |
| 13:47:30 | × | acidjnk_new quits (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) (Ping timeout: 240 seconds) |
| 13:48:00 | → | zer0bitz_ joins (~zer0bitz@2001:2003:f748:2000:79ea:c89f:ccc9:65e) |
| 13:48:32 | → | kenaryn joins (~aurele@89-88-44-27.abo.bbox.fr) |
| 13:48:32 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 13:49:56 | <kenaryn> | Can someone give an example of `showList` usage? The compiler always returns a 'No instance for (Show ShowS) arising from a use of 'print' error. |
| 13:50:06 | × | zer0bitz quits (~zer0bitz@2001:2003:f748:2000:f847:6b9c:c1af:408a) (Ping timeout: 272 seconds) |
| 13:50:16 | <merijn> | :t showList |
| 13:50:18 | <lambdabot> | Show a => [a] -> ShowS |
| 13:50:38 | <merijn> | kenaryn: Note that the return value of ShowList is ShowS, aka "String -> String" |
| 13:50:47 | <merijn> | :t showList [1,2,3] |
| 13:50:47 | <geekosaur> | a ShowS is String -> String and just does concatenation. look up difference lists |
| 13:50:48 | <lambdabot> | ShowS |
| 13:50:50 | <kenaryn> | I tried numerous arguments of list type but to no avail. |
| 13:50:54 | <merijn> | > showList [1,2,3] "" |
| 13:50:56 | <lambdabot> | "[1,2,3]" |
| 13:51:01 | <merijn> | > showList [1,2,3] "foo" |
| 13:51:03 | <lambdabot> | "[1,2,3]foo" |
| 13:51:26 | <kenaryn> | That's a list of list, it is NOT in the type signature! :/ |
| 13:51:38 | <kenaryn> | How should have I known... |
| 13:51:38 | <geekosaur> | you don't normally use showList directly; it's used by default when Show-ing lists, and things are set up so that the Show instance for Char uses a different thing for showList instead |
| 13:51:39 | <merijn> | kenaryn: The type signature is ShowS |
| 13:51:48 | <geekosaur> | so strings display as strings instead of as lists of Char |
| 13:51:49 | <merijn> | "type ShowS = String -> String" |
| 13:57:14 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 255 seconds) |
| 13:57:49 | <kenaryn> | how can I See the type signature of ShowS? |
| 13:57:54 | <shapr> | :t ShowS |
| 13:57:55 | <lambdabot> | error: Data constructor not in scope: ShowS |
| 13:57:57 | <shapr> | aw |
| 13:58:01 | <shapr> | @hoogle ShowS |
| 13:58:02 | <lambdabot> | Prelude type ShowS = String -> String |
| 13:58:02 | <lambdabot> | Text.Show type ShowS = String -> String |
| 13:58:02 | <lambdabot> | GHC.Show type ShowS = String -> String |
| 13:58:10 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 14:00:09 | <[Leary]> | % () :: ShowS |
| 14:00:10 | <yahb2> | <interactive>:12:1: error: • Couldn't match type ‘()’ with ‘String -> String’ Expected type: ShowS Actual type: () • In the expression: () :: ShowS In an equation for ‘i... |
| 14:00:29 | <[Leary]> | tbh, without actual docs, that might be the best way. |
| 14:01:00 | → | acidjnk_new joins (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) |
| 14:02:24 | <[Leary]> | % :i ShowS |
| 14:02:25 | <yahb2> | type ShowS :: * type ShowS = String -> String -- Defined in ‘GHC.Show’ |
| 14:02:32 | <[Leary]> | Knew I was forgetting something... |
| 14:03:41 | → | Unicorn_Princess joins (~Unicorn_P@93-103-228-248.dynamic.t-2.net) |
| 14:04:00 | × | acidjnk_new3 quits (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) (Ping timeout: 246 seconds) |
| 14:07:34 | → | arjun joins (~arjun@user/arjun) |
| 14:09:29 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 14:10:16 | → | lyle joins (~lyle@104.246.145.85) |
| 14:10:59 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 246 seconds) |
| 14:11:04 | → | acidjnk_new3 joins (~acidjnk@dynamic-046-114-169-223.46.114.pool.telefonica.de) |
| 14:14:48 | × | acidjnk_new quits (~acidjnk@dynamic-046-114-170-212.46.114.pool.telefonica.de) (Ping timeout: 272 seconds) |
| 14:21:20 | × | bitdex_ quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 268 seconds) |
| 14:23:38 | → | bitdex_ joins (~bitdex@gateway/tor-sasl/bitdex) |
| 14:29:38 | × | alp quits (~alp@user/alp) (Ping timeout: 255 seconds) |
| 14:30:15 | → | shriekingnoise joins (~shrieking@201.212.175.181) |
| 14:30:30 | × | pleo quits (~pleo@user/pleo) (Ping timeout: 240 seconds) |
| 14:30:54 | × | alexhandy quits (~trace@user/trace) (Read error: Connection reset by peer) |
| 14:31:07 | → | alexhandy joins (~trace@user/trace) |
| 14:31:57 | <kenaryn> | Does indexmain@main mean something or are they typographic errors in Allen Chris' book? |
| 14:33:23 | <merijn> | kenaryn: @ in a pattern is an alias |
| 14:33:32 | <merijn> | kenaryn: Although that specific one seems useless |
| 14:33:43 | <geekosaur> | can you show a little more context? |
| 14:33:58 | <merijn> | > case [1,2,3] of xs@(_:_:y:_) -> (y, xs) |
| 14:34:00 | <lambdabot> | (3,[1,2,3]) |
| 14:35:14 | → | alp joins (~alp@user/alp) |
| 14:37:57 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 246 seconds) |
| 14:38:39 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 14:39:13 | × | bitdex_ quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 268 seconds) |
| 14:40:07 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 14:41:26 | → | bitdex_ joins (~bitdex@gateway/tor-sasl/bitdex) |
| 14:48:57 | × | Vajb quits (~Vajb@85-76-45-197-nat.elisa-mobile.fi) (Read error: Connection reset by peer) |
| 14:49:10 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds) |
| 14:49:14 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
| 14:50:28 | → | pleo joins (~pleo@user/pleo) |
| 14:50:44 | <Surobaki> | Hi, I´m trying to do some pattern matching to transform an AST and I think that I´m not doing it the Haskell way. My code is here, it´s basically a simple substitution engine currently but it doesn´t compile due to errors on lines 51-53 (same errors in principle). This is because my imperative mind is trying to type cast what are two ´identical´ things (an instance of some term vs a restricted term). Could I ask for some help with figuring |
| 14:50:44 | <Surobaki> | out a way so I maintain ¨castability¨ while converting a ¨free¨ AST without restrictions into a restricted one? https://paste.tomsmeding.com/d61R24ip |
| 14:51:28 | <merijn> | Surobaki: The error would help ;) |
| 14:51:30 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 14:51:45 | <Surobaki> | Sorry! Let me re-pastebin it with an error |
| 14:52:30 | <merijn> | Surobaki: Actually, looking at it, you seem to be missing a "Term -> RTerm" function, you can't really do that automatically |
| 14:53:03 | <merijn> | You'd just have to write an explicit conversion function for that |
| 14:53:26 | <Surobaki> | That´s sort of the problem. I´m not sure how to tell Haskell that the two types of Term and RTerm *can* be equal and freely castable |
| 14:53:42 | <merijn> | Surobaki: Which actually catches an error case too, because how would you convert VarY to an RTerm? |
| 14:53:45 | <merijn> | Surobaki: You don't |
| 14:53:46 | <dminuoso> | What does "freely castable" mean to you? |
| 14:53:50 | <merijn> | Surobaki: And they aren't |
| 14:54:47 | <merijn> | Surobaki: If they were actually directly convertible you could use generics to create the conversion (but that seems more work than hand writing it) |
| 14:54:53 | <Surobaki> | I´ve repasted it with the error: https://paste.tomsmeding.com/7q97TChj |
| 14:55:03 | <merijn> | But that's ignoring the fact that RTerm is missing a case that Term has (i.e. VarY) |
| 14:55:12 | <merijn> | So you actually can't convert between them freely |
| 14:55:38 | <Surobaki> | Yes, my ¨substitute¨ function is there to remove instances of VarY for the purpose of safely converting to an RTerm |
| 14:56:03 | <Surobaki> | ¨Freely castable¨ here means GHC won´t shout at me when I try to do a conversion like you can see on ln 51-53 |
| 14:56:15 | <merijn> | Surobaki: Then you need to recursively call substitute on 'x' |
| 14:56:30 | <merijn> | Surobaki: How do you expect GHC to " |
| 14:56:42 | <merijn> | "magically" convert a Term into an RTerm? It can't |
| 14:57:07 | <merijn> | The most sensible thing you *probably* want is to recursively invoke substitute on 'x' |
| 14:57:10 | <dminuoso> | Surobaki: To you `Sum :: Term -> Term -> Term` and `RSum :: RTerm -> RTerm -> RTerm` look similar, but they are completely different from GHCs perspective |
| 14:58:07 | <Surobaki> | merijn: Thank you, I think that´s the answer I was looking for (?) I think I´m just being a little silly and forgetting to program the logic of how to convert between Term and RTerm. |
| 14:58:18 | × | dschrempf quits (~dominik@17-12-190.cgnat.fonira.net) (Quit: WeeChat 3.5) |
| 14:58:30 | × | arjun quits (~arjun@user/arjun) (Ping timeout: 272 seconds) |
| 14:58:31 | → | ARJ0019 joins (~arj0019@162.218.254.7) |
| 14:58:40 | <Surobaki> | Thank you all, this is what I needed |
| 15:01:15 | <ARJ0019> | Does anyone know of an established method for multivariate regression analysis in Haskell |
| 15:04:41 | <ARJ0019> | it looks like `Statistics.Regresion' will operate on an arbitrary amount of dimensions with the `ols' function |
| 15:11:46 | <Surobaki> | Is there a nice name for 0-ary parameter type constructors when creating your own datatypes? |
| 15:12:12 | <ARJ0019> | what do you mean by 0-ary |
| 15:12:30 | <[exa]> | Surobaki: usually constants |
| 15:12:32 | <Surobaki> | Ones that have zero parameters, i.e. data Foo = Bar |
| 15:12:45 | <[exa]> | Foo there is a "type constant" |
| 15:12:46 | <Surobaki> | Instead of data Foo = Bar Int Int Int |
| 15:12:51 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) |
| 15:13:19 | <Surobaki> | I see, great |
| 15:13:20 | <Surobaki> | Thanks! |
| 15:13:23 | <[exa]> | ah you mean the "Bar" I guess? (that's a data constructor) |
| 15:13:26 | <k``> | Surobaki: Do you mean a 0-ary constructor for a data type, like `Nothing` ? Ideally you'd name that its meaning. |
| 15:13:31 | <[exa]> | but I'd say it makes a constant too |
| 15:13:36 | <ARJ0019> | Sounds like type synonym would work for you as well |
| 15:13:52 | <Surobaki> | Yes, I mean the ¨Bar¨ |
| 15:14:06 | <Surobaki> | Specifically when ¨Bar¨ has nothing coming after it |
| 15:14:08 | <[exa]> | Surobaki: that's like True or False then. I think these are good constants. |
| 15:14:09 | × | benin0 quits (~benin@183.82.26.15) (Quit: The Lounge - https://thelounge.chat) |
| 15:15:29 | <Surobaki> | Awesome, and I assume type constants don´t have any sort of values, right? As in, they´re totally abstract and can´t have a concrete representation since they´re not programmed to be constructed from something else |
| 15:15:41 | <[exa]> | ARJ0019: re the linear models, how much machinery you need there? Not sure if there's something for e.g. generalized linear models, but reimplementing it from the available linear algebra should be pretty straightforward, as in ~10 lines of code |
| 15:16:28 | <[Leary]> | Surobaki: Re your paste, you might want to try unifying the ASTs with `data Term x = Var x | Sum (Term x) (Term x) | ...` etc, then you'd have `substitute :: Term x -> (x -> Term y) -> Term y` ... oh my, oh my, what a familiar and loveable type signature! |
| 15:16:46 | <k``> | Surobaki: So you're talking about empty types like Data.Void's `Void`? `data Void` or `newtype Void = Void Void` ? |
| 15:17:03 | <k``> | Where the only inhabitants are bottoms? |
| 15:17:07 | <[exa]> | Surobaki: well. depends on how subtle view of the whole situation you want to use. But in the simple reasonable view of haskell, the type constants and variables belong into a completely different language that never materializes into the real world, except as dictionary functions for typeclasses |
| 15:17:25 | <ARJ0019> | exa : I am trying to avoid a linear model. It is not really applicable for my goals. I know the data will be non-linear. |
| 15:17:47 | <Surobaki> | Leary: that´s definitely something I´m trying to accomplish but first I´d like to get a more naive and simple understanding of the interactions between type constants |
| 15:18:29 | <[exa]> | ARJ0019: ok well, honestly, not sure if something will be available right away. |
| 15:18:32 | × | acidjnk_new3 quits (~acidjnk@dynamic-046-114-169-223.46.114.pool.telefonica.de) (Ping timeout: 246 seconds) |
| 15:18:44 | <[exa]> | ARJ0019: but hey, there are cool neurotic network libraries :] |
| 15:19:19 | <Surobaki> | k``: I´ve never used Data.Void unfortunately but maybe? I think the simplest example I can give is literally writing data Foo = Bar, I´m talking about instances where Foo has only been created by an empty constructor of Bar (if that is possible?) |
| 15:19:28 | <ARJ0019> | exa: yea, I just figured I would ask. i'll have to find a method that I can implement. |
| 15:19:43 | <geekosaur> | it's entirely possible, just not very useful except as a tag |
| 15:19:53 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Ping timeout: 248 seconds) |
| 15:20:03 | <geekosaur> | which gets us into type level programming |
| 15:20:43 | <[exa]> | ARJ0019: well tbh, if you don't know the method, you might want to ask R people, haskellers do not generally intersect with stats folks |
| 15:20:59 | <[exa]> | ARJ0019: what's the data? (just curious) |
| 15:21:14 | <Surobaki> | exa: The reason I´m asking this question comes back to my substitution function. My idea is that RVarX and VarX is equivalent and because they´re so abstract (both are type constant constructors), so writing a pattern sub :: Term -> RTerm could freely convert VarX to RVarX because (in my mind) they´re basically the same |
| 15:22:10 | <ARJ0019> | exa: heat exchanger performance characteristics |
| 15:22:28 | <[exa]> | Surobaki: the fact that objects lack representation doesn't allow you to circumvent the equality rules :] |
| 15:22:54 | <[exa]> | ARJ0019: oh my. A GLM with exponentials might be handy though. |
| 15:23:01 | <geekosaur> | I think we'd say they're concrete, not abstract, and that's why you can't simply map one directly to the other. (there is a way to do it, but it's `unsafeCoerce`) |
| 15:23:32 | <[exa]> | ARJ0019: honestly, try to throw R glm() to the problem and see what one works best, then finetune in haskell |
| 15:23:34 | <Surobaki> | I see, thanks a lot. I don´t want to deal with unsafe stuff so I´m mainly looking at understanding the basic underpinnings of Haskell´s type system |
| 15:23:36 | × | vglfr quits (~vglfr@46.96.142.249) (Ping timeout: 268 seconds) |
| 15:23:54 | <geekosaur> | they're concrete because there's nothing to tweak that could turn one into the other |
| 15:24:11 | <[exa]> | ARJ0019: don't get me wrong, not trying to tell you not to use haskell, but R will get you through tons of troubles in 5 minutes :D |
| 15:24:42 | <geekosaur> | the fact that they look similar doesn't mean anything; the whole point of types is to keep you from shooting yourself in the foot by using something that looks similar but isn't |
| 15:24:52 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) (Remote host closed the connection) |
| 15:24:52 | <Surobaki> | I´ll go with what Leary said in that case and unify my restricted and free term types into one |
| 15:24:55 | → | Vajb joins (~Vajb@2001:999:40:4c50:1b24:879c:6df3:1d06) |
| 15:25:06 | <Surobaki> | geekosaur: That´s a nice way of putting it |
| 15:25:06 | × | Vajb quits (~Vajb@2001:999:40:4c50:1b24:879c:6df3:1d06) (Read error: Connection reset by peer) |
| 15:25:19 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
| 15:27:36 | <geekosaur> | this might in fact be a good place to use a tag: data Restricted = RVar; data Open = OVar; data VarX r = VarX ... — and r there is either RVar or OVar to indicate if it's restricted or not. this is type level tagging |
| 15:28:27 | <Surobaki> | Very interesting, I´ve never heard about tags so I will go and do some reading |
| 15:28:57 | <geekosaur> | they're also called phantom types |
| 15:29:27 | <geekosaur> | since they aren't used in the value, only at type level |
| 15:30:03 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:a397:2c8:2227:ff66) (Quit: WeeChat 2.8) |
| 15:31:10 | <geekosaur> | someone mentioned data Tagged earlier, that's the same thing |
| 15:31:20 | <ski> | Surobaki : yes, i'd second [Leary]'s suggestion |
| 15:32:33 | <ski> | Surobaki : "I assume type constants don´t have any sort of values" -- i think here you actually meant what we call "(nullary) data constructors", not "type constants". and they do have values (namely themselves). but still, you could say "they´re totally abstract and can´t have a concrete representation since they´re not programmed to be constructed from something else" is basically right |
| 15:33:01 | → | BusConscious joins (~martin@ip5f5bdf0d.dynamic.kabel-deutschland.de) |
| 15:33:36 | <ARJ0019> | exa: yea, I could get this done quickly in python. The idea is that I want to learn more haskell so that I can use it more often. I have been fighting OOP in my projects. |
| 15:33:52 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 15:34:00 | <Surobaki> | I see, thanks! |
| 15:34:19 | <ski> | Surobaki : basically, we'd call `Term',`RTerm' "(data) types" (or "type constants", perhaps sometimes); while we'd call `VarX',`VarY' "(nullary) (data) constructors" (or "constant constructors") |
| 15:34:42 | <ski> | (am i correct in that you had the terminology here confused ?) |
| 15:35:55 | <Surobaki> | Nullary constructors, got it. Yeah I mixed it up, what is the value of a data type that has been constructed with a nullary data constructor? |
| 15:36:32 | × | coot quits (~coot@213.134.190.95) (Quit: coot) |
| 15:36:40 | <BusConscious> | say I have two monads m1 and m2 of types m a and m b respectively and a function f :: a -> b -> m c |
| 15:37:17 | <BusConscious> | Now I want to do something like do{ val1 <- m1; val2 <- m2; f val1 val2;} but in applicative syntax |
| 15:37:33 | → | coot joins (~coot@213.134.190.95) |
| 15:38:40 | <k``> | `liftA2` ? `f <$> m1 <*> m2` ? |
| 15:39:18 | <BusConscious> | you are not sure or why the question? |
| 15:39:38 | <k``> | Not sure what you mean by "applicative syntax". |
| 15:40:36 | <k``> | Your result is going to be an m (m c); otherwise you have to use Monad syntax. |
| 15:40:47 | <ski> | Surobaki : consider `data Bool = False | True'. the value of `True' is `True', itself |
| 15:40:51 | <k``> | That's what it means for it to be a Monad. |
| 15:41:01 | <ski> | Surobaki : it's not further reducible |
| 15:41:18 | <Surobaki> | ski: I see, so it´s just the name of the nullary data constructor |
| 15:41:22 | <BusConscious> | k``: yeah that's precisely what I don't want :D |
| 15:41:22 | <k``> | Maybe you want `join $ f <$> m1 <*> m2`? |
| 15:41:29 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 268 seconds) |
| 15:41:38 | <BusConscious> | I want it to be of type of type m c |
| 15:41:45 | <ski> | BusConscious : `m1' and `m2' are not monads, they're monadic actions. `m' (in the types `m a',`m b',`a -> b -> m c') is (presumably) the monad |
| 15:41:58 | <BusConscious> | as in do{ val1 <- m1; val2 <- m2; f val1 val2;} |
| 15:42:01 | <Surobaki> | ski: Or well, to be more specific it´s a representation of the nullary data constructor since the concept of ¨name¨ there might be accidental technical usage |
| 15:42:07 | <ski> | monads are type-level things. you don't pass around monads at run-time |
| 15:42:21 | <geekosaur> | :t ?fn <$> ?m1 <*> ?m2 |
| 15:42:23 | <lambdabot> | (Applicative f, ?fn::a1 -> a2 -> b, ?m1::f a1, ?m2::f a2) => f b |
| 15:42:36 | <k``> | Yeah, if you want to write it in an Applicative style, `join $ f <$> m1 <*> m2` or `join $ liftA2 f m1 m2`. |
| 15:42:43 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 268 seconds) |
| 15:43:35 | <ski> | @let infixl 4 <*>>; (<*>>) :: Monad m => m (a -> m b) -> (m a -> m b); mamb <*>> ma = join (mamb <*> ma) |
| 15:43:37 | <lambdabot> | Defined. |
| 15:44:21 | <ski> | BusConscious : i'd write your expression as `f <$> m1 <*>> m2'. in general `f <$> m1 <*> m2 <*> ... <*>> mn', with `<*>>' on the last one |
| 15:44:28 | × | causal quits (~user@50.35.83.177) (Quit: WeeChat 3.5) |
| 15:44:52 | <ski> | (Surobaki : "0-ary" is also fine, of course) |
| 15:45:09 | <k``> | Too bad that =<< has the wrong fixity. |
| 15:46:11 | <ski> | Surobaki : to continue on the line that [exa] and k`` began (although i think they misinterpreted your "type constants" as now referring to the "type level" (after the correction that you meant `Bar' rather than `Foo' in `data Foo = Bar', when you said "0-ary parameter type constructors"), rather than the "value level") .. |
| 15:46:19 | <BusConscious> | ski: Where does <*>> live? I cant fnd it in hoogle |
| 15:46:22 | → | misterfish joins (~misterfis@ip214-130-173-82.adsl2.static.versatel.nl) |
| 15:46:34 | <k``> | ski literally just made it up. |
| 15:46:38 | <BusConscious> | live in "what module is it defined in" |
| 15:46:40 | <ski> | BusConscious : nowhere (afaik). it's just something i've come up with here on IRC, many years ago |
| 15:46:46 | × | coot quits (~coot@213.134.190.95) (Quit: coot) |
| 15:47:05 | <ski> | k`` : yea, but i didn't make it up now. this thing has come up again and again, over the years ;) |
| 15:47:06 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 15:47:39 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 15:47:47 | <ski> | (i probably first made it up, because i wanted it myself) |
| 15:47:48 | → | Haskelytic joins (~Haskelyti@118.179.211.17) |
| 15:48:06 | × | jinsun quits (~jinsun@user/jinsun) (Read error: Connection reset by peer) |
| 15:48:11 | → | jinsun__ joins (~jinsun@user/jinsun) |
| 15:48:11 | jinsun__ | is now known as jinsun |
| 15:49:30 | <k``> | It's a neat trick for isolating a monadic action in an applicative chain. |
| 15:49:54 | <ski> | Surobaki : .. there is a "value level", where values like `1',`"abc"',`False' lives, but also (value) expressions like `1 + 2',`3 <= x && x <= 9', including functions like `not',`digitToInt',.. -- this "value level" is where computations happen, at run-time |
| 15:51:01 | <Surobaki> | ski: That´s good to know! Hopefully that´ll help with demystifying it |
| 15:51:40 | × | vysn quits (~vysn@user/vysn) (Read error: Connection reset by peer) |
| 15:51:57 | × | jinsun quits (~jinsun@user/jinsun) (Read error: Connection reset by peer) |
| 15:52:12 | → | jinsun joins (~jinsun@user/jinsun) |
| 15:52:12 | <k``> | > 0.0/0 > 0/0 |
| 15:52:14 | <lambdabot> | False |
| 15:52:30 | <k``> | compare (0.0/0) (0/0) |
| 15:52:49 | <ski> | Surobaki : then there's a "type level". each value (and value expression) is "classified" by a type. imaginatively, you could picture the types as "living" on a level (of their own), "above" the values. so here we have things like `Bool',`Int', but also type expressions like `Maybe Int',`ReadS Bool' (which is a type synonym for `String -> [(Bool,String)]', iow "evaluates" to the latter) |
| 15:53:02 | <k``> | > compare (0.0/0) (0/0) |
| 15:53:04 | <lambdabot> | GT |
| 15:53:13 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 15:53:19 | → | abiss27 joins (~abiss27@user/abiss) |
| 15:55:07 | <ski> | Surobaki : now `Maybe' itself (and `ReadS') is a type function. given a type, it forms another type. in the case of `Maybe', it "doesn't do anything" (except express a more complicated type). but in case of `ReadS', it does compute/simplify. in any case, if `F' is a type function, then you can't say `x :: F', for `x' being a value or (value) expression. `F' is "incomplete". you can only ascribe "complete", |
| 15:55:13 | <ski> | or "concrete" types to value (and value expressions). e.g. you can't say `xs :: []' (`[]' being the "list of" type constructor). you must say *what* it's a list *of* |
| 15:56:06 | <Surobaki> | I´ve reworked it slightly, here it is https://paste.tomsmeding.com/IUyGWEAO . Because I seem to have extracted `i` from my `Term` that got constructed like `ConstInt i` I have stuck myself into a position where I´m trying to do `Mul Term Int`. Is there any way to pattern match only for a `Term` that was constructed with `ConstInt` while evading the error? |
| 15:56:07 | → | vysn joins (~vysn@user/vysn) |
| 15:57:29 | <ski> | Surobaki : to distinguish which types (which type expressions) can be placed to the right of a type signature `::', we make another "sort level" above types, called "kinds". just as we can write `False :: Bool', we now write `Bool :: *', which we can read "`Bool' is a concrete type". but also `Maybe :: * -> *' (`Maybe' is a type function from concrete types to concrete types). (`*' is also spelled `Type') |
| 15:57:41 | <ski> | @kind Either |
| 15:57:42 | <lambdabot> | * -> * -> * |
| 15:57:44 | <ski> | @kind Either Int |
| 15:57:46 | <lambdabot> | * -> * |
| 15:57:46 | <ski> | @kind Either Int String |
| 15:57:48 | <lambdabot> | * |
| 15:58:16 | <ski> | (in the interactor, it's `:kind' or `:k', similarly to how you use `:type' or `:t' to ask for the type) |
| 15:58:36 | <ski> | k`` : NaNs cause problems, yes |
| 16:00:12 | <BusConscious> | 19:46 < BusConscious> ski: Where does <*>> live? I cant fnd it in hoogle |
| 16:00:16 | <BusConscious> | oops |
| 16:00:17 | <ski> | Surobaki : `x' and `y' in your defining question for `substitute' are not the same as `VarX',`VarY' |
| 16:00:25 | <BusConscious> | infixl 4 <*>>; fm <*>> b = b >>= (\b -> fm >>= (\f2 -> f2 b) ) |
| 16:00:44 | <ski> | yes, that also works |
| 16:00:47 | <BusConscious> | I just derived <*>> myself, but without join just do get a feeling for the types |
| 16:01:05 | <BusConscious> | the brute force way |
| 16:01:15 | <k``> | ski: I assume the `compare` definition is so that `sort` always putsNaNs at the end of the list. Still seems very unfortunate. |
| 16:01:30 | <ski> | (btw, the brackets there are redundant. you can just say `b >>= \b -> fm >>= \f2 -> f2 b') |
| 16:02:07 | <Surobaki> | ski: Not sure if my understanding is correct here but is ¨kinds¨ related to the restrictions of type classes like Num, Ord, Eq? |
| 16:02:15 | <ski> | k`` : it would possibly be nice if one could get the system to use signalling NaNs |
| 16:02:25 | <ski> | Surobaki : .. not quite |
| 16:02:28 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 272 seconds) |
| 16:02:35 | <ski> | @kind Num |
| 16:02:37 | <lambdabot> | * -> Constraint |
| 16:02:37 | <BusConscious> | ski: yes and you told me that 2 days ago. my brain is a mesh |
| 16:02:39 | <BusConscious> | :D |
| 16:03:44 | <ski> | `Num' (and type classes in general) also live on the type level, and also have kinds (just like other types do). the difference is that their "result" is not a concrete type (of kind `*'), but is a (class) constraint (of kind `Constraint') |
| 16:04:20 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 16:04:38 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 16:05:15 | <ski> | Surobaki : anyway, if you don't want to, you probably don't need to concern yourself much with kinds, yet. my main point was to try to set some terminology straight, and to give you somewhat of an impression that there's another "level" here to learn |
| 16:05:35 | <ski> | BusConscious : hm, i guess i did. i forgot |
| 16:05:41 | <Surobaki> | ski: One more try at understanding it. Type functions interact with the type level and their parameter requirements can be indicated by `kinds´? |
| 16:05:57 | <ski> | yes |
| 16:06:05 | <Surobaki> | ski: I do want to, I really appreciate it and I want to get good at Haskell and functional programming in general. |
| 16:06:30 | <ski> | types are used to classify values. e.g. for passing the correct number of parameter to a function, and even for passing parameters of the correct type |
| 16:07:11 | <Surobaki> | ski: Thank you, I think I´m starting to get it in that case. |
| 16:07:51 | <ski> | kinds are used to classify types. e.g. for passing the correct number of type parameters to a type function (like `Maybe',`Either',`ReadS'), and even for passing type parameters of the correct kind (although you'll run into problems with this to a lesser degree, since non-concrete type parameters aren't as common, although still important when you get to them) |
| 16:08:35 | <ski> | simplified view : kinds are for making sure you're not using an "incomplete type" when you should have a "complete type" (and vice versa) |
| 16:09:00 | <Surobaki> | ski: On the note of the AST substitution program I´m working on. I understand that `x´ and `y´ are not the same as the type constructors VarX and VarY, but I´m just not fully sure how could I manipulate the two instances of Term that I put in as parameters so I can merge them. |
| 16:09:02 | <ski> | e.g. `x :: Maybe' makes no sense, and neither does `y :: Either Int Maybe' |
| 16:09:46 | <[Leary]> | Surobaki: The first argument is what you want to replace VarY with, right? Seems like you don't actually have any reason to examine it. |
| 16:11:01 | <ski> | Surobaki : your specific type error in your last paste was because `i' in `Mul x i' is not of type `Term', but rather of type `Int'. presumably you intended to use `ConstInt i' in place of `i' there ? |
| 16:11:02 | <Surobaki> | [Leary]: You are correct that I don´t need to examine it, however, my specific condition for pattern matching is that I only want the parameter to be accepted by the function if it´s a Term constructed from `ConstInt Int` |
| 16:11:33 | <ski> | Surobaki : but as i said, i already suspect you confused `x' and `y' with `VarX' and `VarY' |
| 16:12:21 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 16:12:55 | <Surobaki> | ski: Maybe I´m not sure where the confusion is then. When I write the parameter as (Mul x y) I assume `x´ and `y´ are the two individual `Term´s that constitute my `Mul´-constructed `Term.´ |
| 16:13:11 | <ski> | yes |
| 16:13:39 | <ski> | but you stated earlier that you want to substitute terms for "Y variables", which presumably means `VarY' |
| 16:13:58 | <ski> | and your `substitute' does nothing towards that, so far |
| 16:14:08 | <ski> | (specifically, it goes against that) |
| 16:14:43 | <ski> | if you correct the defining equation you had (in order to make it type-check) into |
| 16:14:54 | <ski> | substitute (ConstInt i) (Mul x y) = Mul x (ConstInt i) |
| 16:15:03 | <Surobaki> | I´m not sure if this will confirm or deny my thinking but maybe it will clear my intentions up: I want to transform `Mul VarX VarY´ into `Mul VarX ConstInt Int´ |
| 16:15:43 | <ski> | then, if you evaluate `substitute (ConstInt 3 (Mul VarX VarX))', you'll get back `Mul VarX (ConstInt 3)' .. but presumably you wanted `Mul VarX VarX', in this case |
| 16:15:47 | <Surobaki> | Ohh I can re-type it with (ConstInt i) again, thank you! I will try that. |
| 16:16:21 | <ski> | er, `substitute (ConstInt 3) (Mul VarX VarX)', sorry |
| 16:16:57 | <Surobaki> | I ended up with `substitute (ConstInt i) (Mul x y) = Mul x (ConstInt i)´ which *seems* to be in line with what I want to do and the compiler is not whining |
| 16:17:18 | <ski> | Surobaki> substitute (ConstInt 3) (Mul VarX VarX) |
| 16:17:25 | <ski> | try that evaluation ^ |
| 16:18:01 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 248 seconds) |
| 16:18:06 | <maerwald> | how do you name a function that encodes String to Y, while including Y in the name? 'encodeY' seems wrong. 'encodeToY'? |
| 16:18:25 | <ski> | "Into" ? |
| 16:18:50 | <ski> | (i guess it may depend on what sort of thing "Y" is meant to be) |
| 16:20:09 | <maerwald> | 'encodedY'? |
| 16:20:32 | <k``> | `toY`? |
| 16:20:39 | <ski> | what is "Y" ? |
| 16:21:36 | <k``> | `toUtf16` seems more clar than `encodeUtf16` and less noisy than `oncodeToUtf16`. |
| 16:21:36 | × | ARJ0019 quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 16:21:38 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 16:22:27 | <ski> | Surobaki : btw, you should probably also fix your comments to say `VarX' and `VarY' instead of `X' and `Y' (at least when you're intending to write down actual Haskell expressions, rather than an informal (or other kind of formal) expression of what you want to express) |
| 16:22:43 | <maerwald> | k``: Y denotes the type, not the encoding |
| 16:23:01 | <ski> | (that's why i asked about what sort of thing "Y" was) |
| 16:23:08 | <maerwald> | bytes |
| 16:23:10 | <Surobaki> | ski: Got you, thanks. Writing a quick Show instancing so I actually evaluate what you sent |
| 16:23:21 | × | alp quits (~alp@user/alp) (Ping timeout: 248 seconds) |
| 16:23:25 | × | cfricke quits (~cfricke@user/cfricke) (Ping timeout: 256 seconds) |
| 16:23:35 | <ski> | Surobaki : add `deriving Show' to the end of the `data Term = ...' declaration |
| 16:23:36 | <k``> | `serialize` |
| 16:24:09 | <ski> | (Surobaki : also, note that defining `show' (rather than `showsPrec') in a `Show' instance is, usually, incorrect) |
| 16:24:13 | <Surobaki> | ski: Will Haskell be able to derive Show for nullary constructed `Term´s? |
| 16:24:17 | <ski> | sure |
| 16:25:01 | <k``> | :i Void |
| 16:25:05 | <ski> | @let data Term = VarX | VarY | Sum Term Term | Mul Term Term | Sub Term Term | ConstInt Int deriving Show |
| 16:25:06 | <lambdabot> | Defined. |
| 16:25:12 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 16:25:16 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) |
| 16:25:24 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 16:25:26 | <ski> | > show (Mul VarX VarX) |
| 16:25:27 | <lambdabot> | "Mul VarX VarX" |
| 16:25:41 | <ski> | @hoogle Void |
| 16:25:42 | <lambdabot> | module Data.Void |
| 16:25:42 | <lambdabot> | Data.Void data Void |
| 16:25:42 | <lambdabot> | System.Directory.Internal.Prelude data Void |
| 16:26:18 | <k``> | Just wondering whether Void has a Show instance. It does: |
| 16:26:22 | <k``> | > :i Void |
| 16:26:24 | <lambdabot> | <hint>:1:1: error: parse error on input ‘:’ |
| 16:26:31 | <ski> | % :i Void |
| 16:26:31 | <yahb2> | <interactive>:1:1: error: Not in scope: ‘Void’ |
| 16:26:37 | <k``> | But I can't remember how to use GHCi here. |
| 16:26:40 | <ski> | % :m + Data.Void |
| 16:26:40 | <yahb2> | <no output> |
| 16:26:42 | <ski> | % :i Void |
| 16:26:42 | <yahb2> | type Void :: * data Void -- Defined in ‘Data.Void’ instance [safe] Eq Void -- Defined in ‘Data.Void’ instance [safe] Ord Void -- Defined in ‘Data.Void’ instance [safe] Semigroup Void -- Defined ... |
| 16:27:05 | <kenaryn> | Is yahb2 a second bot? |
| 16:27:19 | <ski> | % :t show (undefined :: Void) |
| 16:27:19 | <yahb2> | show (undefined :: Void) :: String |
| 16:27:24 | <ski> | % :t show (undefined :: IO ()) |
| 16:27:24 | <yahb2> | <interactive>:1:1: error: • No instance for (Show (IO ())) arising from a use of ‘show’ • In the expression: show (undefined :: IO ()) |
| 16:27:56 | <ski> | yes. yahb2 (formerly yahb) is the interactor (GHCi). lambdabot is not |
| 16:28:24 | <[Leary]> | yahb = yet another haskell bot |
| 16:28:33 | <ski> | (not sure if it's meant to be renamed back to `yahb', or if this is a more permanent change) |
| 16:29:05 | <kenaryn> | Lol funny acronym. Henceforth, lambdabot emulates compilation time if I understand correctly. |
| 16:29:21 | <ski> | lambdabot has various different plugins (like an association database). yahb2 is just the plain interactor, afaik |
| 16:29:31 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 16:29:41 | <kenaryn> | Allright. |
| 16:29:44 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 16:29:47 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) (Ping timeout: 255 seconds) |
| 16:30:14 | <geekosaur> | still waiting to see if mniip will show up again, I think |
| 16:30:19 | <ski> | @where PIH |
| 16:30:19 | <lambdabot> | "Programming in Haskell" by Graham Hutton in 2007-01-15,2016-09-01 at <http://www.cs.nott.ac.uk/~pszgmh/pih.html> |
| 16:31:04 | <geekosaur> | @tell tomsmeding while I'm thinking about it, yahb used to insert semicolons for newlines, while yahb2 doesn't and the output is occasionally confusing |
| 16:31:04 | <lambdabot> | Consider it noted. |
| 16:32:15 | <ski> | k`` : anyway, it makes sense for `Void' to have a `Show' instance, so i guess that's why it's there |
| 16:32:58 | <k``> | ski: Agree. Same for its `Read`, `Show`, `Eq`, &c. |
| 16:33:21 | <Surobaki> | ski: I see, I finally got that expression to run. I see that it replaces the right side of the `Mul´ constructor, which is good. Is there any way to enforce replacement only of `Term´s that are generated by the `VarY´ nullary constructor? |
| 16:33:26 | <ski> | ("makes sense" (a) in the sense that it can be defined in an appropriate/correct way; and (b) that it's actually helpful for stuff like `Either Void T' or `Tree T Void', `Expr Void') |
| 16:34:16 | <ski> | Surobaki : yes : use `VarY' in the pattern, instead of `y' |
| 16:34:18 | → | unit73e joins (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) |
| 16:34:35 | <ski> | substitute (ConstInt i) (Mul x VarY) = Mul x (ConstInt i) |
| 16:36:22 | <ski> | Surobaki : you can "nest" patterns. a pattern doesn't have to consist of a data constructor (like `Mul',`ConstInt',`VarY'), followed by the appropriate number of variables (like `x',`y';`i';). the "subpatterns" after the dataconstructor doesn't have to be variables ! `Mul (Add t VarX) (Mul VarY u)' is a perfectly fine pattern, e.g. |
| 16:36:22 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 16:36:23 | <Surobaki> | ski: Great! Thank you! |
| 16:36:25 | → | johnsoar joins (~arj0019@162.218.254.7) |
| 16:36:59 | <ski> | Surobaki : now, make sure that `substitute (ConstInt 3) VarY' produces a useful result .. |
| 16:37:44 | <Surobaki> | ski: That´s really cool about the subpattern flexibility. |
| 16:37:56 | <Surobaki> | Making it produce useful things is the easiest part |
| 16:38:58 | <ski> | often, when doing a structural recursion, you only want to "go one data constructor deep (at a time)" (no need to needlessly complicate the definition, repeating yourself (duplicate code/functionality), by going deeper) .. but sometimes you do, and then it's very handy to be able to |
| 16:39:27 | × | unit73e quits (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Ping timeout: 268 seconds) |
| 16:39:40 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) |
| 16:40:10 | <ski> | one simple example of when you want to go deeper : checking whether a list is sorted (you need to compare adjacent elements, which requires you to go deeper than one element at a time) |
| 16:40:20 | <Surobaki> | One more quick question, is there a ¨neat¨ way to generalise argument positionality? That is, my current substitution function´s pattern takes `Mul x VarY´, so it requires `VarY´ on the right side. Do I need to write out a version that repeats it but for a `VarY´ on the left side or is there a Haskell trick to this? |
| 16:40:49 | <ski> | another example is tree restructurings (rotations and the like), when doing balanced trees (red-black trees, AVL trees, ..) |
| 16:41:45 | <Cale> | Surobaki: I'd just use a lambda probably? |
| 16:41:55 | <ski> | Surobaki : the "trick" (not really) is to go back to basics : instead of considering `Mul x y' for different shapes of `x' and `y' (where one or more might be, or contain, `VarY'), go back to just considering `VarY' |
| 16:42:00 | <Cale> | Surobaki: Or define the function to take a record |
| 16:42:04 | <ski> | iow, define : |
| 16:42:15 | <ski> | substitute (ConstInt i) VarY = ... |
| 16:42:18 | <ski> | (fill in the "..." part) |
| 16:42:25 | <Cale> | Oh, perhaps I misunderstood that type |
| 16:42:30 | <Cale> | yeah |
| 16:43:17 | <Surobaki> | ski: I feel a little stupid for not seeing that, seems obvious now. Thank you! |
| 16:43:52 | <ski> | Surobaki : if you do this, and then, when you handle the `Mul t u' case, you look for `VarY's everywhere inside `t' and `u', you'll handle all cases (obviously you also need cases for `Sum',`Sub' for completeness. also, what should happen to `VarX's ?) |
| 16:44:29 | <ski> | (also, you really should be able to substitute not only constants (`ConstInt i') for `VarY') |
| 16:44:42 | × | johnsoar quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 16:44:51 | → | johnsoar joins (~arj0019@162.218.254.7) |
| 16:45:02 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 16:46:23 | <ski> | (Surobaki : i'd suggest you not use the variable names `x' and `y' in `Mul x y', since it's easy to confuse those with `VarX' and `VarY' (as you've already done, above, i think). `t' and `u' would be appropriate (and conventional) since "t" is the first letter in "term") |
| 16:46:35 | × | johnsoar quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 16:46:46 | → | johnsoar joins (~arj0019@162.218.254.7) |
| 16:47:20 | × | leeb quits (~leeb@KD106154142041.au-net.ne.jp) (Ping timeout: 255 seconds) |
| 16:47:24 | <BusConscious> | when I do pattern matching in a function definition like runWhileLoop (WhileLoop cond body) = .. , is there a way to refer to the whole argument without having to type (WhileLoop cond body) again? |
| 16:47:31 | <Surobaki> | ski: The `X´ parts are unchanged, the thing I´m trying to accomplissh is skolemization. I´m swapping out every instance of a variable that´s considered an ¨output¨ by my logic (here I´ve explicitly said that I´ll have one output, that is `Y´) into a term that is free of outputs and only calculates things based on the inputs. This is getting more into first order logic so I´m not sure how simple / complicated my explanation is. |
| 16:47:50 | <geekosaur> | runWhileLoop loop@(WhileLoop cond body) = ... |
| 16:47:54 | <ski> | runWhileLoop command@(WhileLoop cond body) = ..command..cond..body.. -- BusConscious |
| 16:48:15 | → | cyanide3dinner joins (~cyanide4d@106.201.249.151) |
| 16:48:18 | <BusConscious> | ah thanks guys |
| 16:48:18 | <Surobaki> | ski: I´ll take that suggestion, thank you |
| 16:49:04 | <ski> | Surobaki : "The `X´ parts are unchanged" -- you have not showed code (for `substitute') which effects this |
| 16:49:58 | <Surobaki> | ski: Ahah yes it´s because I have not written it, I was struggling with the concepts of implementation for my tiny example of one pattern match for substitution. |
| 16:50:00 | <ski> | Surobaki : so far, i've only seen you talk about substitution, not skolemization per se. but sure, the former is a step on the way to the latter |
| 16:50:43 | <ski> | Surobaki : yes, you're making progress. one step at a time |
| 16:51:51 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 16:51:51 | × | johnsoar quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 16:52:54 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 16:53:02 | <ski> | BusConscious : btw, i'd probably pass `cond' and `body' as separate arguments to `runWhileLoop' (unless you really intend for `runWhileLoop' to handle all cases of a command, not just `WhileLoop' .. which sounds implausible, given your naming) |
| 16:53:25 | <ski> | iow, instead of |
| 16:53:32 | → | ARJ0019 joins (~arj0019@162.218.254.7) |
| 16:53:42 | <ski> | runWhileLoop command@(WhileLoop cond body) = ..cond..body..(runWhileLoop command).. |
| 16:53:45 | <ski> | i'd go for |
| 16:54:02 | <ski> | runWhileLoop cond body = ..cond..body..(runWhileLoop cond body).. |
| 16:54:17 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 16:56:03 | <ski> | (the gain is you avoid having a partial `runWhileLoop' (or else having some weird, probably useless, catch-all case or something) .. and, i guess, the code is slightly shorter) |
| 16:57:17 | × | carbolymer quits (~carbolyme@dropacid.net) (Remote host closed the connection) |
| 16:58:27 | × | ARJ0019 quits (~arj0019@162.218.254.7) (Ping timeout: 276 seconds) |
| 17:05:09 | → | unit73e joins (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) |
| 17:05:16 | → | coot joins (~coot@213.134.190.95) |
| 17:05:39 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 17:07:34 | → | mastarija joins (~mastarija@2a05:4f46:e02:8c00:18c1:ccb:3a22:c211) |
| 17:08:20 | → | econo joins (uid147250@user/econo) |
| 17:10:19 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 17:10:45 | × | kimjetwav quits (~user@2607:fea8:2340:da00:2c1:c09d:7773:d7fc) (Remote host closed the connection) |
| 17:10:53 | × | ec quits (~ec@gateway/tor-sasl/ec) (Quit: ec) |
| 17:13:01 | × | mbuf quits (~Shakthi@223.178.68.221) (Quit: Leaving) |
| 17:14:13 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 17:16:06 | <Surobaki> | ski: I´m gonna head off from work, thank you for all the help today. It´s immensely useful |
| 17:16:07 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 17:16:19 | × | Surobaki quits (~surobaki@137.44.222.80) (Read error: Connection reset by peer) |
| 17:16:34 | × | notzmv quits (~zmv@user/notzmv) (Ping timeout: 272 seconds) |
| 17:16:58 | → | Midjak joins (~Midjak@82.66.147.146) |
| 17:19:09 | → | acidjnk joins (~acidjnk@dynamic-046-114-169-223.46.114.pool.telefonica.de) |
| 17:19:18 | × | kuribas quits (~user@ptr-17d51epftauu6rr1j35.18120a2.ip6.access.telenet.be) (Remote host closed the connection) |
| 17:20:51 | × | coot quits (~coot@213.134.190.95) (Quit: coot) |
| 17:22:03 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 17:22:14 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 17:24:12 | → | jgeerds joins (~jgeerds@55d45f48.access.ecotel.net) |
| 17:24:13 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 17:25:53 | → | arjun joins (~arjun@user/arjun) |
| 17:26:17 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 248 seconds) |
| 17:28:38 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 240 seconds) |
| 17:33:45 | × | acidjnk quits (~acidjnk@dynamic-046-114-169-223.46.114.pool.telefonica.de) (Ping timeout: 248 seconds) |
| 17:38:52 | <kenaryn> | I tried to follow the Chris book but I stomp upon an `not visible method in class` error. Please what can I do about it to circumvent it? Here is the snippet: https://0x0.st/oStv.png |
| 17:40:18 | <geekosaur> | lines 4 and 5 aren't indented, so they're outside the where clause |
| 17:41:55 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 17:42:06 | <geekosaur> | that's also why youget the "lacks an accompanying binding" in the other pane |
| 17:42:33 | <kenaryn> | Lol how did you know. |
| 17:42:39 | <kenaryn> | You're good, thank you. |
| 17:42:44 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 17:42:47 | <geekosaur> | because I know how layout (indentation) works |
| 17:43:10 | × | mmhat quits (~mmh@p200300f1c7385dd6ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
| 17:43:57 | <kenaryn> | I admit I knew not there was indentation for types in a class because that's the first time I define one. |
| 17:45:51 | <geekosaur> | you'll want to learn more about layout. basically, any time you have a "where" you want to indent the stuff that goes inside it (exception: module headers also have a "where" but indentation there is just annoying and not needed) |
| 17:46:21 | <geekosaur> | same for "let", "case", "do" which also use layout |
| 17:46:40 | <geekosaur> | you can also use braces instead of layout but this isn't idiomatic |
| 17:46:46 | → | coot joins (~coot@213.134.190.95) |
| 17:47:26 | telser_ | is now known as telser |
| 17:48:00 | <geekosaur> | one way to do this is to write it with the braces, and you'll probably indent what's inside of them… that indentation also works without the braces |
| 17:48:33 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 17:49:29 | <kenaryn> | Allright, I'll stick with the idiomatic way :) |
| 17:49:56 | → | sympt5 joins (~sympt@user/sympt) |
| 17:50:17 | → | acidjnk joins (~acidjnk@dynamic-046-114-169-223.46.114.pool.telefonica.de) |
| 17:51:10 | × | sympt quits (~sympt@user/sympt) (Ping timeout: 240 seconds) |
| 17:51:10 | sympt5 | is now known as sympt |
| 17:51:38 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.5) |
| 17:52:54 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 17:54:24 | × | raym quits (~raym@user/raym) (Remote host closed the connection) |
| 17:54:24 | × | pleo quits (~pleo@user/pleo) (Quit: quit) |
| 17:56:34 | → | mmhat joins (~mmh@p200300f1c7385d3bee086bfffe095315.dip0.t-ipconnect.de) |
| 17:56:36 | → | carbolymer joins (~carbolyme@dropacid.net) |
| 17:57:13 | × | AkechiShiro quits (~licht@user/akechishiro) (Ping timeout: 248 seconds) |
| 17:57:26 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) (Remote host closed the connection) |
| 17:58:18 | → | AkechiShiro joins (~licht@user/akechishiro) |
| 17:58:46 | <sm> | maerwald: one vote for OSFilePath :) |
| 18:00:41 | → | k8yun joins (~k8yun@user/k8yun) |
| 18:00:42 | × | Raito_Bezarius quits (~Raito@wireguard/tunneler/raito-bezarius) (Ping timeout: 264 seconds) |
| 18:03:05 | × | mastarija quits (~mastarija@2a05:4f46:e02:8c00:18c1:ccb:3a22:c211) (Quit: Leaving) |
| 18:03:16 | × | arjun quits (~arjun@user/arjun) (Remote host closed the connection) |
| 18:05:12 | × | coot quits (~coot@213.134.190.95) (Quit: coot) |
| 18:05:54 | → | coot joins (~coot@213.134.190.95) |
| 18:06:43 | → | raym joins (~raym@user/raym) |
| 18:11:56 | → | cfricke joins (~cfricke@user/cfricke) |
| 18:12:01 | × | cyanide3dinner quits (~cyanide4d@106.201.249.151) (Remote host closed the connection) |
| 18:12:47 | → | Raito_Bezarius joins (~Raito@wireguard/tunneler/raito-bezarius) |
| 18:13:33 | × | _xor quits (~xor@74.215.182.83) (Quit: bbiab) |
| 18:13:45 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 248 seconds) |
| 18:20:32 | × | jgeerds quits (~jgeerds@55d45f48.access.ecotel.net) (Ping timeout: 272 seconds) |
| 18:21:17 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) |
| 18:22:44 | × | dyeplexer quits (~dyeplexer@user/dyeplexer) (Ping timeout: 255 seconds) |
| 18:23:43 | <BusConscious> | sm: here we go again? |
| 18:24:22 | <BusConscious> | I was wondering if I could use some external library to make handling paths easier, when i get to cd builtins and pattern matching in my shell |
| 18:24:38 | <BusConscious> | https://github.com/commercialhaskell/path is this a good pick? |
| 18:25:19 | → | pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) |
| 18:25:24 | <maerwald[m]> | sm: it's going to be OsPath |
| 18:26:50 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds) |
| 18:27:48 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 18:30:25 | × | coot quits (~coot@213.134.190.95) (Quit: coot) |
| 18:33:25 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 244 seconds) |
| 18:36:42 | → | dyeplexer joins (~dyeplexer@user/dyeplexer) |
| 18:38:43 | → | moet joins (~moet@lib-02-subnet-194.rdns.cenic.net) |
| 18:38:45 | → | alp joins (~alp@user/alp) |
| 18:39:10 | <moet> | If anybody cares, I fixed the issue I was having with hoogle running in a VM last week by passing the option "foldr_xStep :: n:Nat -> Xsized r {n} -> [(OPsized r {n}, PIDsized {n})] -> Xsized r {n} @-} |
| 18:39:14 | <moet> | foldr_xStep :: Int -> Execution r -> [(Op r, PID)] -> Execution r |
| 18:39:17 | <moet> | foldr_xStep n x = foldr (uncurry (xStep n)) x |
| 18:39:51 | <moet> | ... sorry, wrong thing.. by passing the option: "-n --no-security-headers Don't send CSP security headers" |
| 18:40:21 | × | dyeplexer quits (~dyeplexer@user/dyeplexer) (Remote host closed the connection) |
| 18:40:37 | <moet> | okay, bye! |
| 18:40:38 | × | moet quits (~moet@lib-02-subnet-194.rdns.cenic.net) (Client Quit) |
| 18:43:16 | <maerwald> | BusConscious: imo no |
| 18:43:38 | <BusConscious> | maerwald: Yeah it doesn't look too active |
| 18:43:54 | <BusConscious> | So I should go with lower level filepath? |
| 18:44:19 | <maerwald> | I don't know... I didn't mean because it's not active, but because of its design decisions |
| 18:44:32 | <maerwald> | there's also hpath, paths and strong-path |
| 18:45:58 | <BusConscious> | maerwald: What do you take issue with specifically? |
| 18:46:17 | <maerwald> | Path puts information of File vs Dir on type-level, which makes no sense imo, because a path can point to a file in one second and a directory in the next second. The authors objected that it signals "intention", but that's not true either: https://hackage.haskell.org/package/path-io-1.7.0/docs/Path-IO.html#v:listDir |
| 18:47:09 | <maerwald> | so they've successfully conflated "system call thinks this is a directory (some time ago)" with "someone thinks this should be a directory" |
| 18:47:31 | → | cyanide3dinner joins (~cyanide4d@106.201.249.151) |
| 18:47:32 | <maerwald> | it gives you no guarantees whatsoever in the end, except that some functions will prematurely fail |
| 18:48:24 | <monochrom> | In my Unix and C course, I too remind students that the word "file" sometimes includes directories too. |
| 18:48:36 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 18:48:38 | → | pleo joins (~pleo@user/pleo) |
| 18:49:13 | × | _ht quits (~quassel@231-169-21-31.ftth.glasoperator.nl) (Remote host closed the connection) |
| 18:49:17 | <monochrom> | Plus, what of symlinks? Some symlinks link to directories, some not. |
| 18:50:14 | <maerwald> | BusConscious: and there's some unsolved bugs on windows (not sure who to blame there though... prolly windows): https://github.com/commercialhaskell/path/pull/163#issuecomment-786559758 |
| 18:50:56 | × | MajorBiscuit quits (~MajorBisc@wlan-145-94-167-213.wlan.tudelft.nl) (Ping timeout: 272 seconds) |
| 18:51:32 | <BusConscious> | monochrom: I was just about t ask that: If a dir is not just a file in unix |
| 18:51:51 | <BusConscious> | ok you convinced me |
| 18:52:02 | <maerwald> | yeah, on windows you also have junction points |
| 18:52:28 | <monochrom> | It depends on the context. |
| 18:52:37 | <maerwald> | abstracting over windows and unix is insane |
| 18:52:55 | <BusConscious> | but I don't really want to parse filepaths or handle their encoding, despite the fact that I could obviously |
| 18:53:01 | <monochrom> | But a scenerio is the accepted sentence "the file type is directory". |
| 18:53:20 | → | pseigo joins (~pseigo@d108-173-20-33.abhsia.telus.net) |
| 18:53:49 | <BusConscious> | mhm you listed some alternatives, but none are super active |
| 18:54:05 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 18:54:05 | × | Luj quits (~Luj@2a01:e0a:5f9:9681:29a1:f7d3:71e5:d5df) (Quit: Ping timeout (120 seconds)) |
| 18:54:11 | <monochrom> | Unix nomenclature has specifically "regular files" (and "special files", "named pipe", etc.) when you want to emphasize non-directory files. |
| 18:54:22 | → | Luj joins (~Luj@2a01:e0a:5f9:9681:5880:c9ff:fe9f:3dfb) |
| 18:54:33 | <maerwald> | BusConscious: why would they be active? |
| 18:54:48 | <maerwald> | it's just filepaths, not a compiler |
| 18:55:02 | <geekosaur[m]> | Why would they need to be active? It's not like things change regularly |
| 18:55:36 | <maerwald> | BusConscious: I wrote hpath btw. But it doesn't support windows just yet. That will take some more time. |
| 18:56:15 | <BusConscious> | ok I don't care about windows lol it's a unix shell |
| 18:56:28 | <monochrom> | Yeah please make multiple failed attempts at support windows, just so the commit history looks "active". >:) |
| 18:57:02 | <maerwald> | good, then hpath might work better... it's less constrained than path and has a pretty elaborate IO module (because it was written to be used by a filemanager) |
| 18:58:30 | × | Haskelytic quits (~Haskelyti@118.179.211.17) (Ping timeout: 252 seconds) |
| 18:58:52 | <monochrom> | Sometimes I pay attention to "active" too, when I have no other information whatsoever. |
| 18:59:28 | <monochrom> | But if maerwald says "try hpath" then that's better information than "active". |
| 19:00:33 | <BusConscious> | yeah that's a good argument |
| 19:00:47 | → | redmp joins (~redmp@lib-02-subnet-194.rdns.cenic.net) |
| 19:03:06 | <DGMrKong> | Anyone want to roast me on my implementation of average in Haskell: https://paste.tomsmeding.com/QIsHGiG9 ? |
| 19:03:12 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 19:04:22 | <BusConscious> | I just don't want to rely on a package someone wrote years ago and will never look back to, which then inevitably breaks, so I have to pick up the pieces, but if it's someone on here I don't have that concern. |
| 19:07:11 | <maerwald> | BusConscious: and I consider the IO stuff more safe than 'directory' package. With directory I never know if a function follows symbolic links or not, what exceptions it throws, etc. |
| 19:09:23 | <maerwald> | like... for file copying, I really don't want the default to be "resolve symbolic links" |
| 19:09:32 | × | z0k quits (~z0k@206.84.143.59) (Ping timeout: 255 seconds) |
| 19:10:22 | <BusConscious> | DGMrKong: simpleAverage = (/) <$> sum <*> fromIntegral . length |
| 19:10:30 | <BusConscious> | But maybe I'm cutting corners? |
| 19:10:40 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 19:11:06 | <geekosaur> | you're missing a key point |
| 19:11:52 | <zzz> | DGMrKong: (\y acc -> y + acc) is just (+) |
| 19:11:55 | <geekosaur> | your version will work but hold the whole list in memory, which is bad if it's a long list. the fold, if written correctly, will consume items immediatekt |
| 19:12:03 | <geekosaur> | *immediately |
| 19:12:09 | <zzz> | @pl (\y acc -> y + acc) |
| 19:12:09 | <lambdabot> | (+) |
| 19:13:01 | → | fizbin joins (~fizbin@c-76-116-163-70.hsd1.nj.comcast.net) |
| 19:13:18 | <redmp> | https://hackage.haskell.org/package/foldl-1.4.12/doc/Control-Foldl.html `average = (/) <$> L.sum <*> L.genericLength` |
| 19:14:18 | <fizbin> | Is there any formal rule or informal best practice statement that says that empty (from Alternative) should equal mempty when both are defined? If not, does anyone have a good example where they aren't the same? |
| 19:15:38 | <DGMrKong> | geekosaur: are you saying my solution is inefficient, or the one posted by BusConscious? |
| 19:15:54 | <BusConscious> | mine is inefficient |
| 19:16:06 | <BusConscious> | short /= effecient |
| 19:16:08 | <geekosaur> | BusConscious's. yours does a fold, so it can consume each list item as it's received, so the entire list can fuse away |
| 19:16:19 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 19:16:45 | <geekosaur> | the Applicative solution has to hold the whole list in memory for both actions to apply to it, so it's short but wastes memory |
| 19:17:33 | <DGMrKong> | is there a way to keep my solution, but kill off my complex version of `+' |
| 19:17:42 | × | raym quits (~raym@user/raym) (Quit: leaving) |
| 19:17:46 | <BusConscious> | on the other side depending on how the list is internally represented, it could also mean less heap operations |
| 19:18:08 | <geekosaur> | fizbin, Alternative is defined as a monoid on applicative functors, so I would very much expect empty to be a "lifted" mempty |
| 19:18:41 | <monochrom> | geekosaur: Fortunately, the querent has an "n = length xs" so it suffers the same problem :) |
| 19:18:58 | <geekosaur> | that would be why I said "if written correctly" earlier |
| 19:19:07 | <monochrom> | Ah |
| 19:19:20 | <BusConscious> | but I have no idea how haskell internally works or how to anticipate performance of my code |
| 19:19:26 | <geekosaur> | ideally you build the length at the same time as the sum, so you can completely consume list items as you go |
| 19:19:35 | <BusConscious> | I know about lazy evaluation but it makes head hurt |
| 19:19:42 | <geekosaur> | BusConscious, a list is a singly linked list. fast but wasteful |
| 19:19:50 | <geekosaur> | on the other hand it's a loop encoded as data |
| 19:20:06 | <geekosaur> | and when you use it as such it compiles down to very tight, fast code |
| 19:20:13 | <fizbin> | geekosaur: Unfortunately, it's not clear to me what the documentation means when it says "A monoid on applicative functors." in the Alternative definition. |
| 19:20:35 | <geekosaur> | do you know what monoids are? |
| 19:20:51 | <fizbin> | Does it mean "Alternative is an alternate monoid you can implement for your type"? |
| 19:20:53 | <zzz> | semigroups with an identity, right? |
| 19:21:16 | <ski> | fizbin : do you have a case where you'd like them to differ ? |
| 19:21:30 | <ski> | fizbin : no |
| 19:22:06 | <BusConscious> | geekosaur: Ah well if it frees the lists it has to free every single element still, so no less heap operations. if it was more like a ArrayList things could be different. |
| 19:22:23 | <monochrom> | I put "data CA = MkCA Int a --- make this a monoid" on a past exam for this. :) |
| 19:22:25 | → | raym joins (~raym@user/raym) |
| 19:22:34 | <monochrom> | err I guess "data CA a" |
| 19:22:45 | <geekosaur> | BusConscious, if it can completely consume the list item and completely generate the list item then the list may never be on the heap |
| 19:23:07 | <ski> | monochrom : no inhabitants ? |
| 19:23:12 | <monochrom> | Now of course, I didn't teach "MkCA !Int !a", so it suffers just as much space inefficiency as before |
| 19:23:29 | <geekosaur> | this is kinda the ideal of list fusion, making a list fuse away completely |
| 19:23:48 | <geekosaur> | and it produces code that beats C compilers when you can pull it off |
| 19:23:49 | <BusConscious> | so how would you write that fold? and why does "length xs" destroy it? Because it has to be somehow immutable? |
| 19:24:07 | <geekosaur> | `length xs` means xs (the list) has to be kept around |
| 19:24:51 | <geekosaur> | if the fold both increments a counter to compute the length and adds the value for the sum in a single "action", then the list can be consumed instead of kept around |
| 19:24:57 | → | notzmv joins (~zmv@user/notzmv) |
| 19:25:22 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 19:25:46 | <geekosaur> | and in the best case the list doesn't even get created, because its consumption can be fused with its creation to create a tight loop and no visible list |
| 19:25:58 | <geekosaur> | just parameter passing |
| 19:26:52 | <ski> | (element passing, the list being virtual) |
| 19:26:53 | <fizbin> | I guess then that I don't know what it could mean to say "A monoid on applicative functors", because my inclination would be "what? Alternative is completely the wrong kind for that!" It can't be an anything of "applicative functors" in general, since it isn't like <|> takes two type constructors and gives you a new type constructor. |
| 19:27:24 | <BusConscious> | ah makes sense so you fold to a tupel one of which contains the number of elements summed and one of which contains the sum. That makes total sense and is not only more memory efficient, but also just faster |
| 19:27:40 | <geekosaur> | it's lifted. the applicative functor is f, a value within it is f a. mempty would be for a, empty is for f a |
| 19:28:00 | <BusConscious> | and it doesn't need the xs later so it destructs it in the fold |
| 19:28:02 | <ski> | fizbin : at least, it should mean that if `Alternative i', then for any `a', `i a' is a monoid (could be made an instance of `Monoid', perhaps hidden behind a `newtype') |
| 19:28:21 | <geekosaur> | this *could* involve a different monoid than the one chosen for the Monoid instance, but usually isn't |
| 19:28:40 | <geekosaur> | (there are lots of monoids, but we can only "bless" one unless we use a newtype wrapper) |
| 19:29:05 | <k``> | Rather than just a monoid, you should generally make it a left-annihilative monoid. |
| 19:29:18 | <k``> | Sorry, not being clear here. |
| 19:29:22 | <ski> | one monoid would be given by `pure empty' and `liftA2 (<>)' |
| 19:29:56 | <ski> | er, `pure mempty' |
| 19:29:56 | <k``> | empty should be left annihilative, not with <|> but with the Applicative. |
| 19:30:12 | → | yauhsien joins (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) |
| 19:30:14 | × | k8yun quits (~k8yun@user/k8yun) (Quit: Leaving) |
| 19:30:20 | × | kenaryn quits (~aurele@89-88-44-27.abo.bbox.fr) (Quit: leaving) |
| 19:30:25 | <ski> | which would probably be distinct from the `mempty' and `(<|>)' one, in general |
| 19:30:53 | × | pseigo quits (~pseigo@d108-173-20-33.abhsia.telus.net) (Ping timeout: 268 seconds) |
| 19:31:29 | <fizbin> | ski: When you say "for any a", are you restricting yourself to a types that are Monoids? |
| 19:31:40 | <ski> | fizbin : no |
| 19:31:56 | <fizbin> | ski: Because if not, I don't understand "pure mempty" |
| 19:32:16 | <ski> | well, *that* specific case was about when we had `Monoid a', sure |
| 19:32:29 | <ski> | (but `Alternative i' doesn't require that, in general) |
| 19:32:40 | <geekosaur> | keep in mind that the monoid is f a, not a |
| 19:32:41 | → | pseigo joins (~pseigo@node-1w7jr9ye7hx4fkp40wi692pl2.ipv6.telus.net) |
| 19:32:47 | <k``> | So, take the semigroup formed by (*>). You definitely want `empty *> x` to be `empty`. |
| 19:33:03 | <geekosaur> | in particular, if f is Maybe and a is a semigroup, a has no mempty but Maybe a does |
| 19:33:42 | <geekosaur> | (or f can be [] or several other things) |
| 19:34:09 | × | pseigo quits (~pseigo@node-1w7jr9ye7hx4fkp40wi692pl2.ipv6.telus.net) (Client Quit) |
| 19:34:20 | → | pseigo joins (~pseigo@d108-173-20-33.abhsia.telus.net) |
| 19:34:31 | <fizbin> | Right, fine. I still don't see how this is an interpretation of "Alternative is a monoid on applicative functors". |
| 19:34:54 | <geekosaur> | because the monoid is dependent on the applicative functor |
| 19:34:57 | <fizbin> | I can agree that (empty, <|>) form a lowercase-m monoid. |
| 19:34:57 | × | yauhsien quits (~yauhsien@61-231-38-201.dynamic-ip.hinet.net) (Ping timeout: 256 seconds) |
| 19:35:33 | <fizbin> | (over T a, where T has an Alternative implementation and a is any type) |
| 19:35:54 | <k``> | You're saying that the type class constructor `Alternative :: (* -> > *) -> Constraint` isn't a monoid? |
| 19:36:56 | <fizbin> | Yes, though more I'm saying "I don't understand what the first sentence in the documentation for Alternative is saying". |
| 19:37:46 | × | mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
| 19:38:05 | <fizbin> | If it's merely saying that (empty, <|>) form a monoid over T a, then ... okay, though that sentence doesn't really say that. |
| 19:38:56 | <geekosaur> | depends on how you read it, I think. English is a lousy language for discussing mathematical concepts |
| 19:39:14 | × | acidjnk quits (~acidjnk@dynamic-046-114-169-223.46.114.pool.telefonica.de) (Ping timeout: 255 seconds) |
| 19:39:16 | <geekosaur> | (if we're being hinest, it's not so much better for enything else…) |
| 19:39:17 | <k``> | I think you're right that it doesn't say what it means to say. But It's more than just a monoid for `m a` ; it's `forall a. monoid (m a)` . |
| 19:40:49 | <fizbin> | Though back to my original question, there doesn't seem to be any good reason for empty and mempty to be the same if the lowercase-m monoids formed by (empty, <|>) and (mempty, <>) over T a are different monoids. |
| 19:42:32 | <geekosaur> | I said that about 10 minutes ago 🙂 |
| 19:43:25 | <k``> | That's true, but at the same time if there's not enough argument for the Monoid instance to be one thing and not another, perhaps there should not be a Monoid instance. |
| 19:45:15 | <fizbin> | I got to this by seeing people's solutions for a Monoid instance of ZipList a that's apparently discussed in "Haskell Programming from First Principles" chapter 17. |
| 19:45:20 | <geekosaur> | that would be why we have Sum, Product, and Endo, for example |
| 19:45:30 | × | pseigo quits (~pseigo@d108-173-20-33.abhsia.telus.net) (Quit: left) |
| 19:45:33 | → | pseigo_ joins (~pseigo@node-1w7jr9ye7hx4fsjarlsl1lkjw.ipv6.telus.net) |
| 19:45:54 | <fizbin> | The discussion there apparently leads to an instance of Monoid that has mempty /= empty |
| 19:45:56 | <k``> | For example, just about the only Alternative I can define for `Either c` with base is `instance (Monoid c)=> Alternative (Either c) where empty = Left empty ; Left x <|> Left y = Left (x <> y); Right x <|> _ = Right x; _ <|> Right y = Right y` |
| 19:46:59 | <k``> | But should I define the Monoid instance to mimic that? or be liftA2 (<>)? or to use a Monoid instance for each parameter and prefer one? |
| 19:47:14 | <k``> | Better to have no Monoid instance. |
| 19:47:16 | <fizbin> | This (mempty /= empty) struck me as odd and something I'd never seen before, so must be an obvious mistake, right? Only, maybe not. |
| 19:48:01 | <geekosaur> | ZipList violates a number of expectations. it's also one of the few Applicatives that isn't also a Monad |
| 19:48:28 | <geekosaur> | not saying it's related, but it does suggest to me to watch out for other differences |
| 19:48:54 | <fizbin> | Right. It's the canonical example of "multiple reasonable Applicative instances exist, only one of which can also be a Monad" |
| 19:52:33 | <tomsmeding> | <ski> (not sure if it's meant to be renamed back to `yahb', or if this is a more permanent change) |
| 19:52:43 | <tomsmeding> | ski: this is a fresh implementation https://git.tomsmeding.com/yahb2 |
| 19:53:35 | <ski> | ic, ty fyi |
| 19:53:53 | <geekosaur> | oh, so I can pr instead of bugging you? I should do that then 🙂 |
| 19:54:10 | <tomsmeding> | geekosaur: currently implementing, but it seems to have broken magically without me doing anything, debugging now |
| 19:54:21 | <ski> | @where yahb2 |
| 19:54:21 | <lambdabot> | I know nothing about yahb2. |
| 19:54:30 | <ski> | @where+ yahb2 https://git.tomsmeding.com/yahb2 |
| 19:54:30 | <lambdabot> | I will remember. |
| 19:54:36 | → | acidjnk joins (~acidjnk@dynamic-046-114-169-223.46.114.pool.telefonica.de) |
| 19:55:09 | → | Guest27 joins (~Guest27@2601:281:d47f:1590::2df) |
| 19:57:40 | <tomsmeding> | ah PEBCAK |
| 19:58:22 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5) |
| 19:59:15 | <monochrom> | "mempty" was perhaps poorly named. |
| 19:59:51 | <monochrom> | But this is what happens when math nomenclature is rejected and people go for "intuitive" "daily" "explain English" choices such as "Mappable". |
| 20:00:00 | <Guest27> | midentity? |
| 20:00:12 | <[exa]> | emptyoid |
| 20:00:12 | <tomsmeding> | mzero :p |
| 20:00:24 | <ski> | neutral |
| 20:00:31 | <Guest27> | [exa] lol |
| 20:00:34 | <k``> | mzero, mone, munit, midentity can all be misleading depending on context. |
| 20:00:55 | <fizbin> | I know, it's the identity for monoids, so let's call it "mid"... |
| 20:01:10 | <fizbin> | No chance of anyone confusing that, no... |
| 20:01:35 | × | yahb2 quits (~yahb2@2a01:4f8:c0c:5c7b::2) (Remote host closed the connection) |
| 20:01:48 | → | yahb2 joins (~yahb2@2a01:4f8:c0c:5c7b::2) |
| 20:02:20 | <[exa]> | ski: if you name it like that, next year ICFP shall feature a functional pearl with monoids a la alignment chart, with chaotic evil monoids |
| 20:02:50 | × | pleo quits (~pleo@user/pleo) (Ping timeout: 240 seconds) |
| 20:02:54 | × | lyle quits (~lyle@104.246.145.85) (Quit: WeeChat 3.5) |
| 20:03:52 | <k``> | mzero is the perfect name for MonadPlus or Alternative, because it's anihilative for Functor multiplication and identity for addition. |
| 20:04:06 | <[exa]> | or maybe we should have {-# LANGUAGE OverloadedEmpty #-} |
| 20:04:28 | <Guest27> | XD |
| 20:04:52 | × | pseigo_ quits (~pseigo@node-1w7jr9ye7hx4fsjarlsl1lkjw.ipv6.telus.net) (Ping timeout: 244 seconds) |
| 20:05:08 | × | yahb2 quits (~yahb2@2a01:4f8:c0c:5c7b::2) (Remote host closed the connection) |
| 20:05:21 | → | yahb2 joins (~yahb2@2a01:4f8:c0c:5c7b::2) |
| 20:05:39 | → | yax__ joins (~yax__@user/yax/x-9576643) |
| 20:05:58 | × | fserucas quits (~fserucas@1.64.114.89.rev.vodafone.pt) (Quit: Leaving) |
| 20:06:00 | <tomsmeding> | % putStrLn "abc\ndef" -- geekosaur |
| 20:06:00 | <yahb2> | abc ; def |
| 20:06:23 | <tomsmeding> | https://git.tomsmeding.com/yahb2/commit/?id=cdc4a45d21353ebf9306bd8df83ec287ace7c0e4 :) |
| 20:07:30 | <geekosaur[m]> | 👍 |
| 20:08:28 | <monochrom> | % purStrLn "abc ; def" |
| 20:08:28 | <yahb2> | <interactive>:10:1: error: ; • Variable not in scope: purStrLn :: [Char] -> t ; • Perhaps you meant ‘putStrLn’ (imported from Prelude) |
| 20:08:44 | <monochrom> | purr! |
| 20:08:48 | <monochrom> | % putStrLn "abc ; def" |
| 20:08:49 | <yahb2> | abc ; def |
| 20:10:29 | <tomsmeding> | % purStrLn = putStrLn . concatMap (\x -> if x == 't' then "rr" else [x]) |
| 20:10:29 | <yahb2> | <no output> |
| 20:10:53 | → | coot joins (~coot@213.134.190.95) |
| 20:11:20 | <Guest27> | % purStrLn "tttttt" |
| 20:11:21 | <yahb2> | rrrrrrrrrrrr |
| 20:11:49 | <tomsmeding> | % purStrLn "the cat puts the sweets on the table" |
| 20:11:49 | <yahb2> | rrhe carr purrs rrhe sweerrs on rrhe rrable |
| 20:13:06 | <Guest27> | Add some run-length encoding to t = n*'r' and you have a compression scheme for pirate-speak |
| 20:13:39 | → | pseigo_ joins (~pseigo@d108-173-20-33.abhsia.telus.net) |
| 20:14:17 | → | jgeerds joins (~jgeerds@55d45f48.access.ecotel.net) |
| 20:14:27 | × | pseigo_ quits (~pseigo@d108-173-20-33.abhsia.telus.net) (Client Quit) |
| 20:14:40 | → | pseigo_ joins (~pseigo@node-1w7jr9ye7hx4fsjarlsl1lkjw.ipv6.telus.net) |
| 20:15:24 | × | gurkenglas quits (~gurkengla@dslb-002-203-144-112.002.203.pools.vodafone-ip.de) (Ping timeout: 276 seconds) |
| 20:17:49 | × | k`` quits (~user@152.1.137.158) (Remote host closed the connection) |
| 20:18:04 | <fizbin> | % (\y x -> when (y>0) $ putStrLn (x ++ show (y-1) ++ " " ++ show x)) 3 "% (\\y x -> when (y>0) $ putStrLn (x ++ show (y-1) ++ \" \" ++ show x)) " |
| 20:18:04 | <yahb2> | <interactive>:20:10: error: ; Variable not in scope: when :: Bool -> IO () -> t |
| 20:19:00 | <tomsmeding> | % import Control.Monad |
| 20:19:00 | <yahb2> | <no output> |
| 20:19:42 | <fizbin> | % (\y x -> if (y<=0) then pure () else putStrLn (x ++ show (y-1) ++ " " ++ show x)) 5 "% (\\y x -> if (y<=0) then pure () else putStrLn (x ++ show (y-1) ++ \" \" ++ show x)) " |
| 20:19:43 | <yahb2> | % (\y x -> if (y<=0) then pure () else putStrLn (x ++ show (y-1) ++ " " ++ show x)) 4 "% (\\y x -> if (y<=0) then pure () else putStrLn (x ++ show (y-1) ++ \" \" ++ show x)) " |
| 20:20:00 | <fizbin> | Good bot, not listening to yourself. |
| 20:20:52 | <tomsmeding> | heh |
| 20:20:58 | <tomsmeding> | % let s = "putStrLn (\"let s = \" ++ show s ++ \" in \" ++ s)" in putStrLn ("let s = " ++ show s ++ " in " ++ s) |
| 20:20:59 | <yahb2> | let s = "putStrLn (\"let s = \" ++ show s ++ \" in \" ++ s)" in putStrLn ("let s = " ++ show s ++ " in " ++ s) |
| 20:21:01 | <tomsmeding> | shorter quine |
| 20:21:20 | <fizbin> | Not quite - you forgot the initial % |
| 20:21:38 | <tomsmeding> | % let s = "% putStrLn (\"let s = \" ++ show s ++ \" in \" ++ s)" in putStrLn ("let s = " ++ show s ++ " in " ++ s) |
| 20:21:38 | <yahb2> | let s = "% putStrLn (\"let s = \" ++ show s ++ \" in \" ++ s)" in % putStrLn ("let s = " ++ show s ++ " in " ++ s) |
| 20:21:52 | <tomsmeding> | % let s = "putStrLn (\"% let s = \" ++ show s ++ \" in \" ++ s)" in putStrLn ("% let s = " ++ show s ++ " in " ++ s) |
| 20:21:53 | <yahb2> | % let s = "putStrLn (\"% let s = \" ++ show s ++ \" in \" ++ s)" in putStrLn ("% let s = " ++ show s ++ " in " ++ s) |
| 20:21:55 | <tomsmeding> | there we go |
| 20:22:13 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 20:22:26 | <tomsmeding> | almost boring in haskell if you know the pattern :p |
| 20:22:33 | → | kimjetwav joins (~user@2607:fea8:2340:da00:8a74:9ba2:1f9a:771d) |
| 20:22:56 | <fizbin> | % putStrLn $ ap (++) show $ "% putStrLn $ ap (++) show $ " |
| 20:22:56 | <yahb2> | % putStrLn $ ap (++) show $ "% putStrLn $ ap (++) show $ " |
| 20:22:56 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
| 20:24:07 | <fizbin> | It's really "show" that makes quines easy in haskell. |
| 20:24:30 | × | Guest27 quits (~Guest27@2601:281:d47f:1590::2df) (Quit: Client closed) |
| 20:29:13 | × | vysn quits (~vysn@user/vysn) (Ping timeout: 248 seconds) |
| 20:30:37 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 20:30:59 | × | redmp quits (~redmp@lib-02-subnet-194.rdns.cenic.net) (Ping timeout: 255 seconds) |
| 20:32:09 | <mrianbloom> | It's not possible to parameterize a function with a closed type family? so for example the type is something like f :: a -> g a where g is some unknown closed type family with kind * -> * |
| 20:32:23 | <ski> | [exa] : hehe :) |
| 20:33:16 | → | pleo joins (~pleo@user/pleo) |
| 20:33:29 | <ski> | `fix show' generates a quine, right ? |
| 20:34:25 | <mrianbloom> | Seems easy to do it with an open family, but open families don't allow for the in order selection of rules. |
| 20:34:50 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds) |
| 20:35:20 | <ski> | > let quine = fix show in quine == read quine -- you don't say "no" .. |
| 20:35:26 | <lambdabot> | mueval-core: Time limit exceeded |
| 20:35:58 | <fizbin> | I believe "fix show" is an infinite list of backslashes. |
| 20:36:19 | <ski> | > all (== '\\') (fix show) |
| 20:36:21 | <lambdabot> | False |
| 20:36:27 | <fizbin> | Huh. |
| 20:37:01 | <fizbin> | % putStrLn $ take 100 (fix show) |
| 20:37:02 | <yahb2> | <interactive>:34:22: error: ; Variable not in scope: fix :: (a0 -> String) -> [Char] |
| 20:37:09 | <ski> | > fix show |
| 20:37:11 | <lambdabot> | "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\... |
| 20:37:34 | <ski> | so, it begins with a non-backslash |
| 20:37:53 | <ski> | > map (== '\\') (fix show) |
| 20:37:54 | <lambdabot> | [False,True,False,True,True,True,False,True,True,True,True,True,True,True,Fa... |
| 20:37:55 | <fizbin> | Right. |
| 20:39:43 | <ski> | @let infixr 5 /\/; (/\/) :: [a] -> [a] -> [a]; [] /\/ ys = ys; (x:xs) /\/ ys = x : (ys /\/ xs) |
| 20:39:45 | <lambdabot> | Defined. |
| 20:40:01 | ← | abiss27 parts (~abiss27@user/abiss) () |
| 20:40:14 | × | mmhat quits (~mmh@p200300f1c7385d3bee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.5) |
| 20:40:43 | <ski> | > let quine = '\"' : repeat '\\' /\/ quine in quine == fix show |
| 20:40:49 | <lambdabot> | mueval-core: Time limit exceeded |
| 20:41:44 | × | cheater quits (~Username@user/cheater) (Read error: Connection reset by peer) |
| 20:41:49 | <fizbin> | > let quine = '\"' : repeat '\\' /\/ quine in take 1000 quine == take 1000 (fix show) |
| 20:41:51 | <lambdabot> | True |
| 20:41:59 | <fizbin> | > let quine = '\"' : repeat '\\' /\/ quine in take 10000 quine == take 10000 (fix show) |
| 20:42:02 | <lambdabot> | True |
| 20:42:02 | <EvanR> | I got a quine for you: |
| 20:42:09 | <ski> | > let abacaba = repeat 0 /\/ map succ abacaba in abacaba |
| 20:42:11 | <lambdabot> | [0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1... |
| 20:42:11 | <EvanR> | (no program at all outputs no program at all) |
| 20:42:42 | <ski> | (that's the number of `1' bits in the binary representations of `[1 ..]'. aka the number of times they're divisible by `2') |
| 20:42:49 | → | gurkenglas joins (~gurkengla@dslb-002-203-144-112.002.203.pools.vodafone-ip.de) |
| 20:43:58 | <ski> | > let bits = 0 : tail (bits /\/ map succ bits) in bits -- er, rather, this is that number of bits |
| 20:44:00 | <lambdabot> | [0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3... |
| 20:44:08 | <fizbin> | > putStrLn "% putStrLn $ show (5*5)" |
| 20:44:09 | <ski> | (the former was the number of trailing `0's) |
| 20:44:10 | <lambdabot> | <IO ()> |
| 20:44:31 | <ski> | @help run |
| 20:44:32 | <lambdabot> | run <expr>. You have Haskell, 3 seconds and no IO. Go nuts! |
| 20:44:50 | <fizbin> | run putStrLn "% putStrLn $ show (5*5)" |
| 20:45:11 | <geekosaur> | "@run" |
| 20:45:11 | → | cheater joins (~Username@user/cheater) |
| 20:45:15 | <fizbin> | @run putStrLn "% putStrLn $ show (5*5)" |
| 20:45:18 | <lambdabot> | <IO ()> |
| 20:45:29 | <geekosaur> | or "?run" if you're dmwit 🙂 |
| 20:46:11 | <geekosaur> | there's a cheat code but I'm pretty sure it guards against this |
| 20:46:31 | <geekosaur> | > text "% putstrln $ show (5*5)" |
| 20:46:33 | <lambdabot> | % putstrln $ show (5*5) |
| 20:46:41 | <fizbin> | % putStrLn $ "> " ++ show (5*5) |
| 20:46:41 | <yahb2> | > 25 |
| 20:46:43 | <lambdabot> | 25 |
| 20:46:50 | <geekosaur> | and I got case wrong anyway |
| 20:47:01 | <fizbin> | So it goes in one direction, but not the other. |
| 20:47:27 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 20:48:00 | <geekosaur> | lame way exists to block that but I don't think I'm an admin |
| 20:48:21 | <geekosaur> | @ignore + yahb2 |
| 20:48:21 | <lambdabot> | Not enough privileges |
| 20:49:24 | <zzz> | this is the reason Telegram makes bots invisible to eachother |
| 20:54:19 | → | mikoto-chan joins (~mikoto-ch@esm-84-240-99-143.netplaza.fi) |
| 20:56:38 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 255 seconds) |
| 21:04:29 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.5) |
| 21:05:24 | <fizbin> | % (\s -> putStrLn ("> text $ ap (++) show " ++ show s)) "% (\\s -> putStrLn (\"> text $ ap (++) show \" ++ show s)) " |
| 21:05:24 | <yahb2> | > text $ ap (++) show "% (\\s -> putStrLn (\"> text $ ap (++) show \" ++ show s)) " |
| 21:05:27 | <lambdabot> | % (\s -> putStrLn ("> text $ ap (++) show " ++ show s)) "% (\\s -> putStrLn ... |
| 21:06:16 | <fizbin> | Were it not for line length, that would be a double-bot quine. |
| 21:07:07 | → | jmdaemon joins (~jmdaemon@user/jmdaemon) |
| 21:12:33 | × | yax__ quits (~yax__@user/yax/x-9576643) (Quit: leaving) |
| 21:18:16 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 21:20:56 | <ski> | lambdabot also adds an initial space, to avoid that kind of loop |
| 21:21:48 | <ski> | (people used to try to break the bots in this way here, many years ago, when lambdabot was young) |
| 21:22:24 | <fizbin> | I don't see it. Is my IRC client omitting the additional space? |
| 21:22:54 | × | elkcl quits (~elkcl@broadband-37-110-156-162.ip.moscow.rt.ru) (Ping timeout: 246 seconds) |
| 21:23:32 | <geekosaur> | if you're using a proportional font, the space will be very thin |
| 21:25:54 | <fizbin> | Not using a proportional font, but can't see it. |
| 21:26:21 | <fizbin> | Also though, I didn't see the space at the start of that message, so my client must be trimming them. |
| 21:27:18 | × | fizbin quits (~fizbin@c-76-116-163-70.hsd1.nj.comcast.net) () |
| 21:32:20 | → | moonsheep joins (~user@user/moonsheep) |
| 21:32:27 | <moonsheep> | How can I serialize a TypeRep? |
| 21:32:33 | <moonsheep> | Should I just show it? |
| 21:32:41 | <moonsheep> | Or is there some nicer way? |
| 21:33:08 | × | coot quits (~coot@213.134.190.95) (Quit: coot) |
| 21:33:26 | <geekosaur> | show is about as close as you'll get. the internal representation includes a fingerprint which is not stable across compiles, much less compiler versions |
| 21:33:26 | <juri_> | toJson? |
| 21:34:10 | → | acidjnk_new joins (~acidjnk@dynamic-046-114-169-223.46.114.pool.telefonica.de) |
| 21:34:35 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 21:35:03 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 21:35:48 | <moonsheep> | geekosaur: ah, what a pity |
| 21:35:54 | <moonsheep> | Thanks |
| 21:36:24 | <moonsheep> | juri_: TypeRep is not an instance of ToJSON |
| 21:36:30 | × | acidjnk quits (~acidjnk@dynamic-046-114-169-223.46.114.pool.telefonica.de) (Ping timeout: 240 seconds) |
| 21:37:15 | <BusConscious> | Q: can I have exitcode-stdio run a shell script instead of it running a main-is haskell program? |
| 21:40:05 | <BusConscious> | haskel program meaning a haskell source under main-is that is compiled to be the executable whose exit code determines success of the test |
| 21:40:14 | <BusConscious> | to me that's just boilerplate |
| 21:41:04 | × | moonsheep quits (~user@user/moonsheep) (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)) |
| 21:43:05 | <BusConscious> | ah I found something .. or not |
| 21:43:13 | <BusConscious> | https://stackoverflow.com/questions/31213883/how-to-use-cabal-with-bash-tests |
| 21:43:28 | <BusConscious> | not quite what I want but ok |
| 21:43:30 | → | moonsheep joins (~user@user/moonsheep) |
| 21:43:48 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 21:43:49 | <moonsheep> | Actually I have just realized that SomeTypeRep doesn't instance Read, so there's not much use in Showing it. |
| 21:43:52 | <geekosaur> | moonsheep, https://github.com/xmonad/xmonad-contrib/issues/94#issuecomment-490064171 re serializing TypeRep halfway sensibly |
| 21:44:03 | <geekosaur> | ah |
| 21:44:12 | <moonsheep> | Oh thank |
| 21:44:14 | <moonsheep> | s |
| 21:44:25 | <moonsheep> | Does that go both ways? |
| 21:47:47 | × | acidjnk_new quits (~acidjnk@dynamic-046-114-169-223.46.114.pool.telefonica.de) (Ping timeout: 268 seconds) |
| 21:48:58 | <geekosaur> | liskin's PR linked in that issue should go both ways, I think |
| 21:49:29 | <geekosaur> | SomeTypeRep involves an existential iirc so it wouldn't have a Read instance, but TypeRep might |
| 21:51:29 | × | alp quits (~alp@user/alp) (Ping timeout: 268 seconds) |
| 21:52:20 | × | mstksg quits (~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 244 seconds) |
| 21:53:31 | → | quarkyalice joins (~alice@172.77.16.153) |
| 21:53:31 | × | quarkyalice quits (~alice@172.77.16.153) (Changing host) |
| 21:53:31 | → | quarkyalice joins (~alice@user/quarkyalice) |
| 21:54:30 | → | mstksg joins (~jle`@cpe-23-240-75-236.socal.res.rr.com) |
| 21:55:34 | × | gnyeki quits (~gnyeki@user/gnyeki) (Quit: leaving) |
| 21:57:34 | × | zer0bitz_ quits (~zer0bitz@2001:2003:f748:2000:79ea:c89f:ccc9:65e) (Read error: Connection reset by peer) |
| 21:59:51 | × | ubert quits (~Thunderbi@p200300ecdf0da505658f203d39a613fe.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 22:00:34 | → | gnyeki joins (~gnyeki@user/gnyeki) |
| 22:02:47 | × | misterfish quits (~misterfis@ip214-130-173-82.adsl2.static.versatel.nl) (Ping timeout: 246 seconds) |
| 22:03:12 | × | pseigo_ quits (~pseigo@node-1w7jr9ye7hx4fsjarlsl1lkjw.ipv6.telus.net) (Ping timeout: 268 seconds) |
| 22:05:50 | → | johnsoar joins (~arj0019@162.218.254.7) |
| 22:05:50 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 22:08:24 | <moonsheep> | geekosaur: Isn't TypeRep just an alias for SomeTypeRep? |
| 22:09:26 | <geekosaur> | mm, maybe it is these days, I haven't done much with the type-indexed version |
| 22:09:40 | <geekosaur> | (TypeRep is more complex than it used to be) |
| 22:09:52 | × | johnsoar quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 22:10:03 | → | johnsoar joins (~arj0019@162.218.254.7) |
| 22:10:19 | <moonsheep> | Btw, I am trying to do something very similar to ExtensibleState, but in my case I want to make it serializable. |
| 22:10:38 | <moonsheep> | And the only piece left is serializing the TypeRep |
| 22:11:04 | <geekosaur> | ours is serializeable, and in fact that's the point of that ticket I linked |
| 22:11:16 | × | johnsoar quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 22:11:23 | → | johnsoar joins (~arj0019@162.218.254.7) |
| 22:11:23 | <geekosaur> | right now what we serialize isn't quite typesafe because it omits module names |
| 22:11:40 | <moonsheep> | Yeah but it's not unserializable right? |
| 22:11:46 | <moonsheep> | I mean of course I can just use the string representation I guess |
| 22:11:50 | <geekosaur> | so if two modules define the same type name, ghc will internally disambiguate with module names but our serialization won't |
| 22:11:54 | <moonsheep> | I wanted to avoid that but if push comes to shove |
| 22:12:12 | <geekosaur> | because we push ExtensibleState across to another xmonad on mod-q |
| 22:12:23 | <geekosaur> | so there is a deserialization on the other side |
| 22:12:40 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 22:12:58 | <moonsheep> | In this commit? https://github.com/liskin/xmonad/commit/e658e953cb3834befce70ce1ca44f76e4aec9fd7 |
| 22:13:09 | × | michalz quits (~michalz@185.246.204.101) (Remote host closed the connection) |
| 22:13:14 | → | alp joins (~alp@user/alp) |
| 22:13:52 | <geekosaur> | the last hunk, in readStateFile, yes |
| 22:14:52 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 22:15:03 | <geekosaur> | mm, actually I think we may key by the TypeRep as a String so the serialization part isn't a problem for us |
| 22:15:04 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 22:15:20 | × | Flonk quits (~Flonk@134.255.252.174) (Quit: Ping timeout (120 seconds)) |
| 22:15:26 | <moonsheep> | Ah I missed that |
| 22:15:36 | <geekosaur> | if you're trying to reconstruct a type from the TypeRep, you're outside the realm of TypeRep and need to go Data or Generic |
| 22:15:36 | → | Flonk joins (~Flonk@vps-zap441517-1.zap-srv.com) |
| 22:15:37 | <moonsheep> | Yeah it does look like it |
| 22:15:44 | <moonsheep> | Right |
| 22:16:14 | × | fweht quits (uid404746@id-404746.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 22:16:25 | <moonsheep> | Yeah I might just transform everything to strings |
| 22:16:34 | <moonsheep> | In my case collisions aren't super critical |
| 22:16:46 | × | johnsoar quits (~arj0019@162.218.254.7) (Ping timeout: 268 seconds) |
| 22:17:26 | <geekosaur> | a more general version of what we do is available in the dependent-map package |
| 22:17:49 | <geekosaur> | the key specifies the type of the value |
| 22:17:52 | → | redmp joins (~redmp@mobile-166-170-36-30.mycingular.net) |
| 22:18:11 | <moonsheep> | I didn't know of that package |
| 22:18:35 | <moonsheep> | So it's just like using existential types but you don't have to deal with TypeReps directly? |
| 22:21:38 | <moonsheep> | I guess for now I'll just sprinkle some `show`s around |
| 22:22:50 | geekosaur | wonders if QuickLook means some of those functions can go away (the ones that are flipped) |
| 22:23:03 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 22:24:11 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds) |
| 22:24:19 | <geekosaur> | it's based on https://hackage.haskell.org/package/dependent-sum-0.7.1.0/docs/Data-Dependent-Sum.html#t:DSum |
| 22:24:36 | <geekosaur> | so a GADT, or a type-tagged value (Data.Tagged), etc. |
| 22:24:41 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 22:26:04 | × | PiDelport quits (uid25146@id-25146.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 22:26:15 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 22:26:27 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 22:27:20 | → | zeenk joins (~zeenk@2a02:2f04:a301:3d00:39df:1c4b:8a55:48d3) |
| 22:28:09 | → | pwug joins (~pwug@user/pwug) |
| 22:29:49 | × | pwug quits (~pwug@user/pwug) (Client Quit) |
| 22:30:30 | → | liz joins (~liz@host86-159-158-175.range86-159.btcentralplus.com) |
| 22:31:12 | → | merijn joins (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) |
| 22:35:41 | × | merijn quits (~merijn@c-001-001-027.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds) |
| 22:38:17 | → | pseigo_ joins (~pseigo@d108-173-20-33.abhsia.telus.net) |
| 22:40:11 | × | BusConscious quits (~martin@ip5f5bdf0d.dynamic.kabel-deutschland.de) (Remote host closed the connection) |
| 22:41:33 | → | johnsoar joins (~arj0019@162.218.254.7) |
| 22:41:34 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 22:42:21 | × | pseigo_ quits (~pseigo@d108-173-20-33.abhsia.telus.net) (Client Quit) |
| 22:42:41 | → | pseigo_ joins (~pseigo@node-1w7jr9ye7hx4fsjarlsl1lkjw.ipv6.telus.net) |
| 22:44:13 | pseigo_ | is now known as pseigo |
| 22:48:48 | → | Guest15 joins (~Guest15@ip-191-5-86-68.isp.valenet.com.br) |
| 22:49:10 | × | Guest15 quits (~Guest15@ip-191-5-86-68.isp.valenet.com.br) (Client Quit) |
| 22:50:04 | × | jgeerds quits (~jgeerds@55d45f48.access.ecotel.net) (Ping timeout: 268 seconds) |
| 22:51:57 | → | yauhsien joins (~yauhsien@61-231-28-31.dynamic-ip.hinet.net) |
| 22:53:26 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 22:53:27 | × | johnsoar quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 22:55:22 | × | kimjetwav quits (~user@2607:fea8:2340:da00:8a74:9ba2:1f9a:771d) (Remote host closed the connection) |
| 22:56:20 | × | yauhsien quits (~yauhsien@61-231-28-31.dynamic-ip.hinet.net) (Ping timeout: 246 seconds) |
| 22:56:21 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 22:56:29 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 22:59:25 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 22:59:37 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 23:00:28 | × | pseigo quits (~pseigo@node-1w7jr9ye7hx4fsjarlsl1lkjw.ipv6.telus.net) (Ping timeout: 272 seconds) |
| 23:00:45 | <maralorn> | I am currently using the monoid instance of Text a lot in a performance critical component of my program. What is the standard recommendation to speed that up? I would like to use linear-builder but I am neither on text 2.0, yet. |
| 23:02:07 | <maralorn> | It is my understanding that something like `foo <> " " <> bar` creates unnecessary copies. |
| 23:03:25 | <hpc> | use https://hackage.haskell.org/package/text-2.0/docs/Data-Text-Lazy-Builder.html and convert at the end? |
| 23:04:07 | <hpc> | or rather, https://hackage.haskell.org/package/text-1.2.5.0/docs/Data-Text-Lazy-Builder.html |
| 23:04:24 | <maralorn> | hpc: You mean: Convert to strict-Text at the end? |
| 23:04:30 | <hpc> | yeah |
| 23:05:26 | <hpc> | assuming you aren't mixing appending and some kind of big traversals |
| 23:05:37 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 23:05:50 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 23:06:02 | <maralorn> | What do you mean with big traversals? |
| 23:06:36 | <hpc> | lazy text is a linked list of chunks, and you can imagine each chunk is going to be one of your appends |
| 23:07:02 | <hpc> | it's not quite String, but still might be painful for random access in the middle of your algorithm |
| 23:07:46 | <maralorn> | Ah, you mean I shouldn‘t use it when I plan to inspect results in between? |
| 23:08:03 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 23:08:05 | → | johnsoar joins (~arj0019@162.218.254.7) |
| 23:08:07 | → | Topsi joins (~Topsi@ip5f5ae328.dynamic.kabel-deutschland.de) |
| 23:08:46 | <hpc> | yeah |
| 23:08:54 | × | johnsoar quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 23:09:00 | <maralorn> | sensible. |
| 23:09:10 | → | johnsoar joins (~arj0019@162.218.254.7) |
| 23:09:14 | <maralorn> | I will keep that in mind. |
| 23:12:50 | <maralorn> | Huh, I wonder if one could implement one of those nice quasi quoter interpolation packages to target a Text Builder. |
| 23:15:44 | <EvanR> | when I hear, appending a lot of Text so need a builder, I think, man I wonder if the thing that finally uses the big Text could consume it lazily |
| 23:16:59 | × | mikoto-chan quits (~mikoto-ch@esm-84-240-99-143.netplaza.fi) (Ping timeout: 246 seconds) |
| 23:19:32 | <EvanR> | (probably not, for whatever reason xD) |
| 23:19:47 | <maralorn> | EvanR: Complicated. I am printing the output to the terminal at ~10 times per second, to prevent flickering it’s important that the calculation of the output has been finished before clearing the screen. (At least I think that’s important.) That’s why I force the whole output before printing anyways. |
| 23:20:26 | <EvanR> | printing specifically can consume lazily |
| 23:21:37 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) (Remote host closed the connection) |
| 23:21:51 | <maralorn> | EvanR: I know. The problem is that parts of the generation of the output can be computation intensive. And I don‘t want that computation to happen while printing after I have cleared the screen because I fear the user might see the pause. |
| 23:22:12 | <EvanR> | how do you clear the screen before it gets printed |
| 23:23:04 | <maralorn> | https://hackage.haskell.org/package/ansi-terminal-0.11.3/docs/System-Console-ANSI.html#g:6 |
| 23:23:06 | × | moonsheep quits (~user@user/moonsheep) (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)) |
| 23:25:18 | <maralorn> | I had been using clearFromCursorToScreenEnd, but users complained that in some terminals that increases flickering so now I use a loop doing clearLine cursorUp. It’s stupid but apparently fixed the flickering … |
| 23:26:26 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 246 seconds) |
| 23:26:29 | <maralorn> | Anyways terminals are black magic. In the end I have not found a solution to control when exactly a terminal triggers a redraw. I thought I could fix it by setting stdout to BlockBuffering but it still sometimes redraws at will in inoportune moments … |
| 23:26:36 | → | mikoto-chan joins (~mikoto-ch@esm-84-240-99-143.netplaza.fi) |
| 23:27:44 | <hpc> | if the whole screen changes, there might just not be much you can do about it |
| 23:28:12 | <hpc> | when i scroll rapidly in irssi i can see the disjoint screen refreshes |
| 23:28:15 | × | johnsoar quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 23:28:23 | → | johnsoar joins (~arj0019@162.218.254.7) |
| 23:28:49 | <hpc> | but also my screen taskbar ticks the time without messing anything up, so maybe you can get away with refreshing just specific parts of the screen? |
| 23:28:49 | × | johnsoar quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 23:28:55 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 23:28:57 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 23:29:09 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 23:29:17 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 23:29:28 | <maralorn> | hpc: That’s my experience too, as long as it’s only about a third of the screen flickering is small, if I redraw a lot it get’s harder. |
| 23:29:28 | <hpc> | at which point https://hoogle.haskell.org/?hoogle=curses might help |
| 23:29:33 | × | Alex_test quits (~al_test@178.34.160.206) (Ping timeout: 256 seconds) |
| 23:29:58 | <hpc> | terminal rendering is just generally quite slow |
| 23:30:04 | <maralorn> | Yeah, that is possible in principle but in my case really hard to achieve. |
| 23:30:27 | <maralorn> | My main problem ist, that I still want the terminal to have a consistent scroll back buffer in the end. |
| 23:30:52 | × | AlexZenon quits (~alzenon@178.34.160.206) (Ping timeout: 272 seconds) |
| 23:30:55 | → | causal joins (~user@50.35.83.177) |
| 23:31:18 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:385b:a633:1677:81b1) |
| 23:31:19 | <maralorn> | So what I do is I print logs, print my statusbar at the bottom, clear the status bar, print more logs, print the statusbar again, etc … |
| 23:31:30 | <hpc> | hmm |
| 23:31:31 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 23:31:40 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 23:31:44 | <hpc> | look at how less/more do it maybe? |
| 23:31:56 | <hpc> | iirc they have the sort of scrollback you describe... somehow |
| 23:31:56 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 23:32:05 | <EvanR> | terminal rendering is pretty fast when it's linux emergency console xD |
| 23:32:06 | <hpc> | maybe only more does, i don't know how scrolling back up would work |
| 23:32:10 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 23:32:29 | <EvanR> | that's the only way bbdemo the ascii art demo would run well |
| 23:33:48 | <maralorn> | EvanR: True, more seems to do it somehow. Although it doesn‘t have to deal with so many redraws. |
| 23:35:30 | → | Alex_test joins (~al_test@178.34.160.206) |
| 23:35:48 | → | AlexZenon joins (~alzenon@178.34.160.206) |
| 23:36:00 | <maralorn> | Ah, well more does not allow scrolling up, only down. That’s very easy no magic involved. The only need to clear and redraw the one line at the bottom and that’s quite tame. |
| 23:36:11 | <maralorn> | My problem is that my "statusbar" can fill up to a half of the terminal. |
| 23:36:19 | <geekosaur> | less just redraws the older part |
| 23:36:23 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 23:36:28 | <maralorn> | Ah, sorry wrong highlight. I meant hpc. |
| 23:36:29 | <geekosaur> | (to scroll "backwards") |
| 23:36:33 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 23:37:18 | × | Tuplanolla quits (~Tuplanoll@91-159-69-97.elisa-laajakaista.fi) (Quit: Leaving.) |
| 23:39:19 | <maralorn> | It is my summary, that unless there are deeper cross-terminal ways to interact with the terminal than ansii codes that the only way to achieve a consistent backlog is to regularly print newlines at the bottom of the screen to move the lines at the top of the screen out of the terminal. But that means that every log line moves my statusbar away from were it was, so I need to redraw it completely. |
| 23:39:24 | → | kimjetwav joins (~user@2607:fea8:2340:da00:cb6e:c5ea:ab85:281d) |
| 23:39:40 | <maralorn> | I‘d love to be proven wrong, though. |
| 23:39:56 | <geekosaur> | <ESC>[r |
| 23:40:09 | <geekosaur> | set the scroll area to the area above the "statusbar" |
| 23:40:36 | <geekosaur> | (more precisely, <ESC>[1;<lineno>r) |
| 23:41:05 | <geekosaur> | where <lineno> is the line above the start of the status area, remembering it's 1-based |
| 23:44:23 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 23:44:32 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 23:46:11 | → | mvk joins (~mvk@2607:fea8:5ce3:8500::4588) |
| 23:47:50 | × | DGMrKong quits (~arj0019@162.218.254.7) (Read error: Connection reset by peer) |
| 23:48:03 | → | DGMrKong joins (~arj0019@162.218.254.7) |
| 23:57:06 | <geekosaur> | and if I needed to update the status area, <esc>7 to save status, position into the status area, do my update, then <esc>8 to pop status |
| 23:57:25 | <geekosaur> | mm, make that save/restore state to avoid confusion with your status area |
| 23:57:42 | <geekosaur> | state includes scrolling area, cursor position, and a number of other things |
| 23:59:39 | <maralorn> | geekosaur: Are you saying there is a way with which I can save the state for a part of the screen then scroll the rest and then restore that part of the screen? Because that’s ultimately what I want. |
All times are in UTC on 2022-06-27.