Logs on 2022-10-31 (liberachat/#haskell)
| 00:09:10 | → | nate3 joins (~nate@98.45.169.16) |
| 00:11:37 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds) |
| 00:14:12 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 248 seconds) |
| 00:17:42 | <cheater> | hi |
| 00:17:50 | <Axman6> | o/ |
| 00:17:56 | <cheater> | what's your favourite way to write gen :: [a] -> IO a? |
| 00:18:11 | <cheater> | spits out the next a every time it gets called, until there are no more |
| 00:18:45 | <Axman6> | what happens when it's called and there's nothing left? |
| 00:18:59 | <cheater> | idk, let's say it repeats |
| 00:19:15 | <cheater> | so then there's always something left |
| 00:19:17 | <Axman6> | IMO the type should be gen :: [a] -> IO (IO a) |
| 00:19:27 | ski | was just about to say |
| 00:19:31 | ham | is now known as hamster |
| 00:19:32 | <cheater> | why |
| 00:19:37 | <dsal> | You need a generator generator. It can close over an IORef and cycle the input. |
| 00:19:45 | <ski> | because it needs to initialize an `IORef' |
| 00:19:57 | <cheater> | i was thinking of using an IORef, yes |
| 00:20:24 | <cheater> | but i was hoping someone else had a better idea |
| 00:20:55 | <cheater> | though I was going to do something like gen :: [a] -> IORef Int -> IO a |
| 00:21:06 | <cheater> | but it doesn't really matter |
| 00:21:20 | <chromoblob> | how is Integer implemented in GHC? |
| 00:21:28 | <ski> | then the caller could potentially pass in a different `IORef Int', on different calls |
| 00:21:31 | <Axman6> | gen xs = do { ref <- newIORef xs; pure (do { ys <- readIORef ref; case ys of [a] -> pure a; (z:zs) -> do { writeIORef ref zs; pure z}; _ -> error "oh no}} |
| 00:21:42 | <cheater> | yes, ski, that is possible. it doesn't bother me |
| 00:21:59 | <ski> | % :i Integer |
| 00:22:00 | <yahb2> | type Integer :: * ; data Integer ; = GHC.Num.Integer.IS GHC.Prim.Int# ; | GHC.Num.Integer.IP GHC.Prim.ByteArray# ; | GHC.Num.Integer.IN GHC.Prim.ByteArray# ; -- Defined in ‘GHC.Num.Integer... |
| 00:22:15 | <ski> | chromoblob ^ |
| 00:23:34 | × | perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1) |
| 00:23:53 | <ski> | cheater : there's no need to leak implementation details, though |
| 00:24:20 | <geekosaur> | more to the point, it's usually backed by GMP (there is an option for a slower native Haskell implementation, for those who prefer to avoid touching the GPL — mostly corporate users) |
| 00:24:35 | <ski> | Axman6's snippet is how to do it. except if you wanted to cycle, you'd modify accordingly |
| 00:24:58 | <Axman6> | IIRC it's not always slower, some operations are faster because of the efficient encoding of small values and signs |
| 00:25:09 | × | chomwitt quits (~chomwitt@2a02:587:dc18:4a00:1ac0:4dff:fedb:a3f1) (Ping timeout: 246 seconds) |
| 00:26:40 | <Axman6> | ByteArray# is nearly identical to the representation used by GMP (I was sure it used WordArray# though...) |
| 00:27:52 | <dsal> | I think I ran into two or three bugs caused by postgresql-simple trying to avoid using libpq normal parameter binding. I can't work around one of them so that's unfortunate. |
| 00:28:45 | <Axman6> | I've always prefered hasql - but mostly for performance reasons |
| 00:29:49 | <dsal> | I'm using sqlite-simple in this project and could copy and paste most of the implementation to get postgres working. Except for the parts that don't work. The way I built this abstraction, though, nothing outside of this one file knows anything about how it talks to postgres. |
| 00:30:18 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 00:31:01 | → | nate3 joins (~nate@98.45.169.16) |
| 00:32:33 | <[Leary]> | % :t \xs -> newIORef (cycle xs) <&> \ref -> atomicModifyIORef ref \(h:t) -> (t,h) |
| 00:32:34 | <yahb2> | \xs -> newIORef (cycle xs) <&> \ref -> atomicModifyIORef ref \(h:t) -> (t,h) ; :: [b] -> IO (IO b) |
| 00:32:43 | <[Leary]> | cheater: I wrote one of these just recently. ^ |
| 00:32:58 | <[Leary]> | Though it's better to use a `cycle :: NonEmpty a -> Stream a`. |
| 00:34:01 | <dsal> | Yeah, `NonEmpty` + `cycle` is a good call. |
| 00:34:41 | <cheater> | neat :) thanks |
| 00:36:04 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 248 seconds) |
| 00:57:16 | × | mixfix41 quits (~sdeny9ee@user/mixfix41) (Ping timeout: 252 seconds) |
| 00:59:53 | → | causal joins (~user@50.35.83.177) |
| 01:04:24 | × | emmanuelux quits (~emmanuelu@user/emmanuelux) (Quit: au revoir) |
| 01:10:13 | → | perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
| 01:11:43 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 01:17:51 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 01:23:49 | × | Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
| 01:24:12 | → | Feuermagier joins (~Feuermagi@user/feuermagier) |
| 01:26:16 | <yin> | how are records represented internally? is getting/setting record fields always preferable to maps? |
| 01:27:26 | × | gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
| 01:27:54 | <c_wraith> | Not if the record has 1000 fields |
| 01:29:28 | <c_wraith> | anyway. GHC's runtime representation of a record is a header then... usually pointers to every value. (Usually because sometimes fields get unpacked so they're stored directly in the record) |
| 01:29:46 | <c_wraith> | Updating a record is copying all of it except for the field you're updating. |
| 01:32:59 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 276 seconds) |
| 01:34:44 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds) |
| 01:37:35 | × | mokee quits (~mokee@37.228.215.235) (Quit: off) |
| 01:39:13 | → | mokee joins (~mokee@37.228.215.235) |
| 01:39:41 | → | nate3 joins (~nate@98.45.169.16) |
| 01:40:51 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 01:41:13 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 01:41:40 | × | motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 248 seconds) |
| 01:41:43 | × | qrpnxz quits (~qrpnxz@fsf/member/qrpnxz) (Read error: Connection reset by peer) |
| 01:42:49 | → | ham2 joins (~ham@user/ham) |
| 01:44:20 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 248 seconds) |
| 01:44:44 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 250 seconds) |
| 01:45:24 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds) |
| 01:45:40 | × | hamster quits (~ham@user/ham) (Ping timeout: 252 seconds) |
| 01:46:02 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 01:51:00 | <yin> | ouch. why not just update the pointer? |
| 01:51:20 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Remote host closed the connection) |
| 01:51:35 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 01:51:40 | <c_wraith> | because that violates purity |
| 01:51:41 | <ski> | how would that work ? |
| 01:52:08 | <c_wraith> | well. it violates immutability, more directly |
| 01:55:43 | × | mmhat quits (~mmh@p200300f1c730765eee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1) |
| 01:57:14 | <Axman6> | GHC could make thew optimisation with linear types, but AFAIK it doesn't currently do so |
| 01:57:21 | → | jero98772 joins (~jero98772@2800:484:1d80:d8ce:3490:26c5:1782:da8c) |
| 01:57:30 | <Axman6> | that* |
| 02:03:16 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds) |
| 02:04:21 | <[Leary]> | You could feasibly make all your fields explicit references, then construct a pure linear interface to the type after the fact (with liberal application of unsafeCoerce and unsafePerformIO). |
| 02:04:54 | <Axman6> | sounds like edwardk's structs package |
| 02:05:08 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 02:06:21 | × | perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1) |
| 02:10:29 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds) |
| 02:13:42 | <Axman6> | yin: in general "changing" a field in a record is pretty cheap, it's just a memcpy of a known size and then each modified field is set. There isn't really any way around that because of the immutability of all Haskell data types. But we do also get the benefit that sharing is always safe, so if you want to store the entire history of your app, the bare minimum is copied |
| 02:14:20 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds) |
| 02:21:46 | <yin> | i get it |
| 02:23:54 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 02:26:12 | → | [_] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 02:26:28 | → | sadmax joins (~user@209.205.174.253) |
| 02:28:09 | × | jargon quits (~jargon@184.101.77.52) (Remote host closed the connection) |
| 02:28:42 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 246 seconds) |
| 02:30:56 | × | [_] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer) |
| 02:33:09 | → | perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
| 02:45:08 | × | ddellacosta quits (~ddellacos@89.45.224.130) (Ping timeout: 248 seconds) |
| 03:04:20 | × | sadmax quits (~user@209.205.174.253) (Ping timeout: 248 seconds) |
| 03:05:49 | → | jmorris joins (uid537181@id-537181.uxbridge.irccloud.com) |
| 03:06:15 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds) |
| 03:07:39 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 03:09:14 | × | jero98772 quits (~jero98772@2800:484:1d80:d8ce:3490:26c5:1782:da8c) (Remote host closed the connection) |
| 03:09:23 | × | bilegeek quits (~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf) (Remote host closed the connection) |
| 03:09:52 | → | bilegeek joins (~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf) |
| 03:15:00 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds) |
| 03:15:16 | → | nate3 joins (~nate@98.45.169.16) |
| 03:15:36 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 246 seconds) |
| 03:16:55 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 03:19:27 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Quit: Lost terminal) |
| 03:25:37 | → | Feuermagier_ joins (~Feuermagi@154.28.188.170) |
| 03:26:19 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds) |
| 03:27:57 | × | td_ quits (~td@83.135.9.47) (Ping timeout: 240 seconds) |
| 03:28:31 | × | Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 252 seconds) |
| 03:29:23 | → | mvk joins (~mvk@2607:fea8:5ce3:8500::f30b) |
| 03:29:57 | → | td_ joins (~td@83.135.9.57) |
| 03:34:54 | × | chexum_ quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 03:35:10 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 03:38:28 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds) |
| 03:40:37 | → | dzdcnfzd joins (~dzdcnfzd@pool-72-69-177-248.nycmny.fios.verizon.net) |
| 03:43:38 | → | Dev-Inchy joins (~Dev-Inchy@136.144.35.100) |
| 03:43:52 | × | Dev-Inchy quits (~Dev-Inchy@136.144.35.100) (Client Quit) |
| 03:47:13 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 03:47:43 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 03:48:19 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds) |
| 03:49:37 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 03:53:30 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 255 seconds) |
| 03:53:40 | × | ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Remote host closed the connection) |
| 03:56:54 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 03:56:54 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 03:56:54 | finn_elija | is now known as FinnElija |
| 03:58:41 | → | ezzieyguywuf joins (~Unknown@user/ezzieyguywuf) |
| 04:03:32 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds) |
| 04:05:07 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 04:06:08 | → | mbuf joins (~Shakthi@49.204.120.214) |
| 04:11:25 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 04:13:40 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds) |
| 04:15:41 | × | jlgw_ quits (~jw@83-233-104-81.cust.bredband2.com) (Remote host closed the connection) |
| 04:17:23 | × | bilegeek quits (~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf) (Remote host closed the connection) |
| 04:17:23 | → | Guest38 joins (~Guest38@76.128.170.130) |
| 04:18:08 | → | bilegeek joins (~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf) |
| 04:20:48 | <chromoblob> | i recently had an epiphany |
| 04:20:52 | <chromoblob> | an application of a lambda to arguments is like a coroutine with state = these arguments |
| 04:21:16 | <chromoblob> | if lambda returns application of constructor, then the coroutine returns the tag of the constructor |
| 04:21:37 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 04:21:42 | <chromoblob> | if constructor has more than one field, coroutine splits into two or more coroutines |
| 04:22:46 | <chromoblob> | a scheme for compilation of fp language can be based on that |
| 04:26:14 | → | freeside_ joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 04:27:22 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds) |
| 04:30:15 | <chromoblob> | if constructor has no fields, the coroutine ends |
| 04:31:22 | × | zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!) |
| 04:31:50 | <chromoblob> | cool thing with Haskell and such is that you can specify how coroutine's return type will change over "invocations" |
| 04:32:55 | <chromoblob> | that it will change at all, too |
| 04:33:20 | <chromoblob> | so Haskell is just splitting coroutines :p |
| 04:36:27 | <c_wraith> | describing it in terms of coroutines sounds a bit indirect to me. |
| 04:36:30 | <c_wraith> | It's just functions |
| 04:37:45 | × | bitmapper quits (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 04:38:23 | × | bilegeek quits (~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf) (Remote host closed the connection) |
| 04:38:51 | → | bilegeek joins (~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf) |
| 04:40:23 | <chromoblob> | c_wraith: they are like coroutines in that values are returned bit by bit rather than entirely in one step, in other wordOCs, codata |
| 04:40:35 | <chromoblob> | in other words * |
| 04:43:29 | → | redmp joins (~redmp@mobile-166-170-43-64.mycingular.net) |
| 04:45:32 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds) |
| 04:47:06 | <ski> | in Charity, function (exponential) type can be specified as something like `codata S -> (A => B) where apply : S * A -> B' (which gives the morphism `apply : (A => B) * A -> B' for elimination. for introduction, you construct a morphism in `S -> (A => B)' by putting in a morphism in `S * A -> B') |
| 04:47:07 | × | Vajb quits (~Vajb@2001:999:504:1841:9e47:1ec7:a52e:1d57) (Read error: Connection reset by peer) |
| 04:48:16 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) |
| 04:49:12 | <ski> | in a similar way, you can specify a synchronous stream processor type by `codata S -> ssp(A,B) where step : S * A -> S * B' (giving elimination morphism `step : ssp(A,B) * A -> ssp(A,B) * B', so you get a new "coroutine" state together with the output in `B', so that you can feed another `A' as input and repeat) |
| 04:49:34 | Axman6 | has no idea what anyone is on about at the moment |
| 04:50:01 | <Axman6> | All's I know is I likes my Haskell and I likes it lazy! |
| 04:50:43 | <chromoblob> | coroutineness *is* laziness |
| 04:50:51 | <ski> | (in Haskell, the corresponding type could be declared as `data SSP a b = MkSSP {step :: a -> (SSP a b,b)}' or as `data SSP a b = forall s. MkSSP s (s -> a -> (s,b))') |
| 04:50:57 | <Axman6> | I don't believe that's true chromoblob |
| 04:51:06 | <chromoblob> | but why |
| 04:52:02 | <Axman6> | Well for one, giving something a name in a lazy language ensure it will only be evaluated once (possibly more but that's a side effect of concurrency). I don't know of any coroutine-y things which do that |
| 04:54:07 | <Axman6> | but also that the named thing may not be evaluated at all - generally evaluating a coroutine, correct me if I'm wrong, would need to be evaluated to be given the name, or would need to be re-evaluated each time its value was needed |
| 04:55:43 | × | dzdcnfzd quits (~dzdcnfzd@pool-72-69-177-248.nycmny.fios.verizon.net) (Quit: Client closed) |
| 04:55:55 | <ski> | (i'm probably botching the syntax in Charity somewhat .. but that's basically how you do right/codata (and dually left/data) types, in it. anyway, point being that the function type `A => B' isn't really like a coroutine type there, if you want to think of the coroutine as progressing by successively supplying it with arguments. otoh, the `ssp(A,B)' type is a bit like a coroutine that you successively feed |
| 04:56:01 | <ski> | `A's as inputs, and get corresponding `B's as outputs) |
| 04:58:02 | <ski> | @where Charity |
| 04:58:02 | <lambdabot> | http://pll.cpsc.ucalgary.ca/charity1/www/home.html |
| 04:59:46 | × | eL_Bart0 quits (eL_Bart0@dietunichtguten.org) (Ping timeout: 252 seconds) |
| 05:00:50 | <ski> | <http://pll.cpsc.ucalgary.ca/charity1/download/examples/prelude/exp.ch> resp. <http://pll.cpsc.ucalgary.ca/charity1/download/examples/misc/proc.ch> are the two Charity types i was remembering the idea, but not the concrete syntax, of |
| 05:04:50 | <chromoblob> | yeah, you need to overwrite a pointer to coroutine state (application of lambda) with a pointer to record holding the constructor and fields, after which reevaluation shouldn't happen |
| 05:05:39 | <chromoblob> | that is if a variable which is bound to this is needed somewhere later on |
| 05:05:56 | → | eL_Bart0 joins (eL_Bart0@dietunichtguten.org) |
| 05:07:39 | <chromoblob> | i think you need a pointer and a bit, bit = 0 -> pointer is to application of lambda, bit = 1 -> pointer is to constructed value |
| 05:08:22 | <chromoblob> | if bit unset, go evaluate; if bit set, do nothing; now, value is evaluated. |
| 05:10:08 | <chromoblob> | next state(s) of the coroutine can be found in the value's field(s) |
| 05:11:54 | <chromoblob> | multiple if it forks |
| 05:15:03 | × | Spukgespenst quits (~user@user/siracusa) (Quit: Bye!) |
| 05:18:14 | <ski> | forks ? |
| 05:18:42 | <chromoblob> | data T = Datum Int | Fork (T, T) |
| 05:18:44 | × | freeside_ quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds) |
| 05:18:55 | <chromoblob> | coroutine forks into two |
| 05:19:26 | <chromoblob> | oops, i meant data T = Datum Int T | Fork (T, T) |
| 05:19:50 | <chromoblob> | so at each step a T either gives an Int or forks into two T's |
| 05:20:42 | <chromoblob> | and type-level arguments are typestate... coolness |
| 05:21:13 | <ski> | hm, a tree with unary and binary nodes, and `Int's in the unary nodes |
| 05:21:35 | × | redmp quits (~redmp@mobile-166-170-43-64.mycingular.net) (Ping timeout: 246 seconds) |
| 05:21:51 | <chromoblob> | not just a tree, i stress that it is lazily computed and returned bit by bit |
| 05:22:20 | <ski> | could also be represented as `exists t. t * (t -> Int * t + t * t)' |
| 05:23:35 | <ski> | (it being lazily computed goes without saying, with a lazy implementation of Haskell, and the bit by bit just comes from the non-strictness of Haskell) |
| 05:24:45 | <ski> | where does the forking fit in to what you were talking about previously ? or perhaps it didn't really, was just something you were reminded of, for coroutines in general ? |
| 05:25:58 | × | dsrt^ quits (~dsrt@76.145.185.103) (Remote host closed the connection) |
| 05:26:01 | <ski> | (at first, the bit you were talking about sounded like the bit telling whether you have an evaluated (and cached) thunk, or a still unevaluated one) |
| 05:27:50 | <chromoblob> | an evaluated value is a record with a constructor tag and multiple pointers pointing to coroutine states into which the old coroutine forked |
| 05:30:11 | <chromoblob> | recursive value definitions also allow us to specify that a coroutine "loops forever" on one of its fork-tos |
| 05:33:18 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 05:33:40 | → | Vajb joins (~Vajb@2001:999:504:1841:9e47:1ec7:a52e:1d57) |
| 05:34:18 | × | detuneattune quits (~detuneatt@user/detuneattune) (Quit: The Lounge - https://thelounge.chat) |
| 05:38:15 | → | Luj3 joins (~Luj@2a01:e0a:5f9:9681:a8ec:74c1:b9fd:4789) |
| 05:38:48 | × | mvk quits (~mvk@2607:fea8:5ce3:8500::f30b) (Ping timeout: 255 seconds) |
| 05:43:48 | × | eL_Bart0 quits (eL_Bart0@dietunichtguten.org) (Ping timeout: 248 seconds) |
| 05:43:53 | → | detuneattune joins (~detuneatt@user/detuneattune) |
| 05:46:07 | <ski> | mhm |
| 05:49:49 | <chromoblob> | haskell is just a really concise language for programming with coroutines-in-this-sense |
| 05:51:25 | <chromoblob> | let x = 1:2:3:x in x, how many lines of code would you need to express this in imperative languages |
| 05:52:04 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds) |
| 05:52:06 | <chromoblob> | if the language directly supports coroutines, it's better, though |
| 05:53:27 | <chromoblob> | but the typestates and forking, uber abilities |
| 05:53:44 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 05:55:32 | → | kenran joins (~user@user/kenran) |
| 05:55:34 | × | kenran quits (~user@user/kenran) (Remote host closed the connection) |
| 06:05:36 | → | vglfr joins (~vglfr@145.224.100.22) |
| 06:07:21 | → | mixfix41 joins (~sdeny9ee@user/mixfix41) |
| 06:08:11 | × | troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 260 seconds) |
| 06:18:02 | → | chomwitt joins (~chomwitt@2a02:587:dc18:4a00:1ac0:4dff:fedb:a3f1) |
| 06:21:50 | <EvanR> | x = 1:2:3:x more like codata than coroutine right |
| 06:23:44 | <chromoblob> | what's the difference? |
| 06:25:04 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds) |
| 06:25:17 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 06:28:19 | <c_wraith> | like... [a] matches up with one definition of a coroutine. But what does an infinite lazy binary tree match up with? |
| 06:29:32 | <chromoblob> | with a coroutine which can fork, returning two instances of coroutine state instead of one |
| 06:29:42 | <c_wraith> | or... with codata. |
| 06:29:52 | <c_wraith> | throw out coroutines. they don't do that. |
| 06:29:55 | <c_wraith> | just use codata |
| 06:30:54 | <c_wraith> | In fact, a coroutine is bad version of even [a], as [a] can remember previous results. |
| 06:31:30 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 258 seconds) |
| 06:31:51 | <chromoblob> | "memoized forking coroutines" i suppose i really like coroutines, i just extend them to match what happens in Haskell |
| 06:32:05 | <c_wraith> | right. why burden yourself with that mental overhead? |
| 06:32:15 | <c_wraith> | things are allowed to just be different |
| 06:32:38 | <chromoblob> | it's not overhead, it's a kind of deep understanding |
| 06:35:10 | <chromoblob> | things are not just different, if a thing is an understood modification of another thing then i can understand thing in terms of that other thing |
| 06:36:20 | <chromoblob> | this notion of coroutines helps me see that there is nothing magical in Haskell's entities |
| 06:36:40 | <chromoblob> | and helps me implement a functional language |
| 06:42:03 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 06:42:19 | → | michalz joins (~michalz@185.246.207.221) |
| 06:46:00 | × | Guest38 quits (~Guest38@76.128.170.130) (Quit: Client closed) |
| 06:47:15 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 07:13:51 | → | Guest42 joins (~Guest42@41.59.37.224) |
| 07:16:36 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds) |
| 07:22:46 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 07:34:15 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 07:35:36 | × | jmorris quits (uid537181@id-537181.uxbridge.irccloud.com) (Quit: Connection closed for inactivity) |
| 07:37:59 | × | asm quits (~alexander@burner.asm89.io) (Changing host) |
| 07:37:59 | → | asm joins (~alexander@user/asm) |
| 07:44:36 | → | jtomas joins (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) |
| 07:44:51 | × | Sgeo_ quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 07:49:15 | → | acidjnk joins (~acidjnk@p200300d6e7137a70ac64450b6466d6c8.dip0.t-ipconnect.de) |
| 07:50:24 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 07:52:42 | → | mmhat joins (~mmh@p200300f1c730765eee086bfffe095315.dip0.t-ipconnect.de) |
| 08:03:13 | → | gmg joins (~user@user/gehmehgeh) |
| 08:06:57 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Remote host closed the connection) |
| 08:07:41 | × | bilegeek quits (~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf) (Quit: Leaving) |
| 08:07:54 | → | zeenk joins (~zeenk@2a02:2f04:a105:5d00:c862:f190:2ea:d494) |
| 08:08:01 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 08:08:43 | → | gmg joins (~user@user/gehmehgeh) |
| 08:12:21 | <cheater> | any good way of taking this out of IO? https://paste.tomsmeding.com/OMGavsPG |
| 08:14:00 | → | CiaoSen joins (~Jura@p200300c9570c54002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 08:15:16 | × | mixfix41 quits (~sdeny9ee@user/mixfix41) (Ping timeout: 248 seconds) |
| 08:16:53 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 08:18:47 | × | Guest42 quits (~Guest42@41.59.37.224) (Ping timeout: 244 seconds) |
| 08:23:48 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds) |
| 08:24:22 | → | Midjak joins (~Midjak@82.66.147.146) |
| 08:24:33 | × | Teacup_ quits (~teacup@user/teacup) (Quit: Teacup_) |
| 08:28:47 | <merijn> | no? |
| 08:29:01 | <merijn> | There's never a *good* way to take things out of IO |
| 08:29:46 | <cheater> | as in make the loop a pure function |
| 08:30:12 | → | schweers joins (~user@p200300e5773c9a00c23ebafffe9bd9c9.dip0.t-ipconnect.de) |
| 08:30:23 | → | Guest42 joins (~Guest42@41.59.37.224) |
| 08:33:21 | × | Guest42 quits (~Guest42@41.59.37.224) (Client Quit) |
| 08:34:51 | <opqdonut> | cheater: I assume getAIO should be getFooIO? in that case, the number of calls to getFooIO depends on the result of getFooIO, so you can't purify the loop |
| 08:34:56 | <cheater> | rec is actually :: (IO FooM) -> ... where FooM is Either MyError (MyNormal Foo) |
| 08:34:59 | <opqdonut> | it's a "true" monadic computation |
| 08:35:06 | <cheater> | opqdonut: yes, it should |
| 08:35:29 | <opqdonut> | (monadic computations are those whose shape depends on runtime. applicative computations have a static structure.) |
| 08:35:54 | <cheater> | well i was thinking of something like sequencing getFooIO to get a lazy [Foo] in a pure context, and then passing that to a pure version of rec instead |
| 08:35:56 | → | Teacup joins (~teacup@user/teacup) |
| 08:36:19 | <cheater> | since getFooIO isn't actually taking any of its previous outputs |
| 08:36:23 | <cheater> | or any other stuff |
| 08:37:10 | <opqdonut> | you could rewrite rec using something like unfoldrM |
| 08:37:22 | <opqdonut> | but I think the explicit recursion here is nice |
| 08:38:17 | <cheater> | yeah i don't feel like using those crazy rare-case loop constructs |
| 08:38:30 | <cheater> | i just wonder if doing the lazy list thing would be a good idea |
| 08:38:42 | <opqdonut> | you can't make the [Foo] truly lazy without using some lazy IO constructs. sequence in IO is strict (as in, it runs all the IO ops before producing the head of the list) |
| 08:38:49 | <opqdonut> | lazy IO is usually a bad idea :) |
| 08:39:05 | <cheater> | hmmmmm |
| 08:39:13 | <cheater> | it's strict |
| 08:39:17 | <cheater> | right |
| 08:41:30 | × | talismanick quits (~talismani@76.133.152.122) (Ping timeout: 255 seconds) |
| 08:43:50 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 08:43:56 | × | schweers quits (~user@p200300e5773c9a00c23ebafffe9bd9c9.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 08:43:58 | <merijn> | @hackage monad-loops |
| 08:43:58 | <lambdabot> | https://hackage.haskell.org/package/monad-loops |
| 08:44:17 | <merijn> | cheater: Anyway, why do you want to make it pure? |
| 08:44:40 | <cheater> | why not? just wondering if it's possible to restructure that way. |
| 08:44:49 | ← | cheater parts (~Username@user/cheater) (BitchX by panasync) |
| 08:44:53 | → | cheater joins (~Username@user/cheater) |
| 08:44:55 | <cheater> | oops |
| 08:46:05 | <merijn> | cheater: Because attempting to remove IO from a place where it's kinda inherent is a great way to spend hours of time and end up with more brittle code ;) |
| 08:46:53 | <cheater> | there's no reason to believe it's inherent until you find out that there is no way to take io out |
| 08:48:17 | <merijn> | cheater: If the logic depends on the value produced by the IO, then it's always inherent and at best you can minimise the scope, but I think that's already mostly the case here |
| 08:48:35 | <merijn> | You could maybe clean it up a little bit via ExceptT to do the Either+IO at once |
| 08:48:51 | <merijn> | but depends on the rest of the code whether that's worth it |
| 08:48:53 | <cheater> | i don't feel like monad stacks |
| 08:49:06 | <cheater> | or rather transformer stacks |
| 08:49:16 | <cheater> | but it might be a good idea in other cases |
| 08:49:45 | <tdammers> | you could generalize it from IO to Monad m => m, because the Monad constraint really is all you depend on, it doesn't have to be IO |
| 08:51:01 | <tdammers> | (at least if the code is fixed the way I think it's intended to be fixed - as it is pasted, it won't compile) |
| 08:52:38 | → | thyriaen joins (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) |
| 08:52:55 | <ski> | if you parameterize over `sumAcc', you can make it more polymorphic |
| 08:58:40 | × | foul_owl quits (~kerry@174-21-75-230.tukw.qwest.net) (Ping timeout: 255 seconds) |
| 09:00:03 | × | sibnull[m] quits (~sibnullma@2001:470:69fc:105::1:1291) (Quit: You have been kicked for being idle) |
| 09:00:56 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 09:01:23 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:97e6:998a:289d:5f8e) |
| 09:01:44 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 09:02:25 | → | kenran joins (~user@user/kenran) |
| 09:03:52 | × | kenran quits (~user@user/kenran) (Remote host closed the connection) |
| 09:03:59 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 09:05:57 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 09:07:26 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) |
| 09:12:06 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Ping timeout: 255 seconds) |
| 09:12:41 | → | fserucas|eod joins (~fserucas|@2001:818:e376:a400:fb92:70c1:dd88:c7d7) |
| 09:12:43 | → | foul_owl joins (~kerry@23.82.194.108) |
| 09:12:49 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds) |
| 09:13:24 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 248 seconds) |
| 09:17:22 | × | fserucas|eod quits (~fserucas|@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Client Quit) |
| 09:19:05 | × | tzh_ quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
| 09:26:01 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 09:26:47 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 09:27:24 | × | CiaoSen quits (~Jura@p200300c9570c54002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 255 seconds) |
| 09:28:10 | → | chele joins (~chele@user/chele) |
| 09:43:17 | → | echoone joins (~echoone@2a02:8109:a1c0:5d05:709d:fe7b:7272:b443) |
| 09:44:00 | × | TheCoffeMaker quits (~TheCoffeM@user/thecoffemaker) (Ping timeout: 250 seconds) |
| 09:44:15 | → | eaxli joins (~eax@user/eaxli) |
| 09:44:36 | → | __monty__ joins (~toonn@user/toonn) |
| 09:46:57 | → | `2jt joins (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) |
| 09:47:42 | <cheater> | there's only one sumAcc that i'm interested in here |
| 09:47:48 | <cheater> | this polymorphism doesn't add anything here :) |
| 09:48:34 | × | jtomas quits (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) (Ping timeout: 252 seconds) |
| 09:48:45 | <Hecate> | richie sumAcc hahaha |
| 09:48:52 | <Hecate> | *rishi |
| 09:49:50 | → | TheCoffeMaker joins (~TheCoffeM@user/thecoffemaker) |
| 09:54:37 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 252 seconds) |
| 09:56:28 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 09:57:08 | × | `2jt quits (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) (Quit: Leaving) |
| 10:01:09 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 10:02:35 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 10:13:47 | × | eaxli quits (~eax@user/eaxli) (Quit: leaving) |
| 10:20:30 | <ski> | well, it'd give you parametricity, that your looping code doesn't mess with the accumulator, just from the types. but that might not be an issue for this particular piece of code, sure |
| 10:26:00 | → | Midjak2 joins (~Midjak@82.66.147.146) |
| 10:27:32 | → | lucerne joins (~lucerne@5.113.197.120) |
| 10:27:50 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 10:28:10 | × | Midjak quits (~Midjak@82.66.147.146) (Ping timeout: 252 seconds) |
| 10:30:06 | × | cyphase quits (~cyphase@user/cyphase) (Ping timeout: 260 seconds) |
| 10:35:13 | → | cyphase joins (~cyphase@user/cyphase) |
| 10:39:43 | × | Teacup quits (~teacup@user/teacup) (Ping timeout: 252 seconds) |
| 10:40:13 | → | Teacup joins (~teacup@user/teacup) |
| 10:46:17 | × | vglfr quits (~vglfr@145.224.100.22) (Read error: Connection reset by peer) |
| 10:46:31 | → | vglfr joins (~vglfr@145.224.100.22) |
| 11:00:25 | × | sweater1 quits (~sweater@206.81.18.26) (Quit: WeeChat 2.8) |
| 11:04:13 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 11:04:17 | × | sa quits (sid1055@id-1055.tinside.irccloud.com) (Ping timeout: 240 seconds) |
| 11:04:36 | × | jackdk quits (sid373013@cssa/jackdk) (Ping timeout: 255 seconds) |
| 11:04:58 | × | hongminhee quits (sid295@id-295.tinside.irccloud.com) (Ping timeout: 246 seconds) |
| 11:04:59 | × | polo quits (sid532813@user/polo) (Ping timeout: 276 seconds) |
| 11:05:02 | × | kristjansson quits (sid126207@id-126207.tinside.irccloud.com) (Ping timeout: 250 seconds) |
| 11:05:07 | × | jmct quits (sid160793@id-160793.tinside.irccloud.com) (Ping timeout: 246 seconds) |
| 11:05:32 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 11:06:14 | → | hongminhee joins (sid295@id-295.tinside.irccloud.com) |
| 11:06:15 | → | jmct joins (sid160793@id-160793.tinside.irccloud.com) |
| 11:06:37 | → | polo joins (sid532813@user/polo) |
| 11:06:41 | → | jackdk joins (sid373013@cssa/jackdk) |
| 11:06:51 | → | sa joins (sid1055@2a03:5180:f::41f) |
| 11:07:31 | → | kristjansson joins (sid126207@2a03:5180:f::1:ecff) |
| 11:08:54 | → | zer0bitz_ joins (~zer0bitz@196.244.192.57) |
| 11:10:12 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds) |
| 11:12:41 | × | zer0bitz quits (~zer0bitz@2001:2003:f748:2000:5894:8e10:5893:ce6f) (Ping timeout: 260 seconds) |
| 11:14:28 | × | jinsun quits (~jinsun@user/jinsun) (Ping timeout: 248 seconds) |
| 11:14:55 | × | foul_owl quits (~kerry@23.82.194.108) (Ping timeout: 252 seconds) |
| 11:16:02 | × | bw_ quits (sid2730@id-2730.ilkley.irccloud.com) () |
| 11:17:03 | → | bw_ joins (sid2730@user/betawaffle) |
| 11:18:08 | bw_ | is now known as bw |
| 11:19:05 | → | jinsun joins (~jinsun@user/jinsun) |
| 11:25:33 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 11:28:07 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 11:28:07 | → | comerijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 11:28:31 | → | foul_owl joins (~kerry@23.82.194.108) |
| 11:30:52 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 11:31:13 | → | o-90 joins (~o-90@gateway/tor-sasl/o-90) |
| 11:32:59 | × | o-90 quits (~o-90@gateway/tor-sasl/o-90) (Client Quit) |
| 11:35:35 | comerijn | is now known as merijn |
| 11:43:59 | × | acidjnk quits (~acidjnk@p200300d6e7137a70ac64450b6466d6c8.dip0.t-ipconnect.de) (Ping timeout: 276 seconds) |
| 11:46:41 | × | pie_ quits (~pie_bnc@user/pie/x-2818909) () |
| 11:47:05 | → | pie_ joins (~pie_bnc@user/pie/x-2818909) |
| 11:49:36 | × | vglfr quits (~vglfr@145.224.100.22) (Ping timeout: 255 seconds) |
| 11:50:29 | → | vglfr joins (~vglfr@145.224.100.22) |
| 11:59:14 | → | frost5 joins (~frost@user/frost) |
| 12:15:46 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 12:18:34 | → | eL_Bart0 joins (eL_Bart0@dietunichtguten.org) |
| 12:21:08 | × | arahael quits (~arahael@14-200-56-241.tpgi.com.au) (Ping timeout: 248 seconds) |
| 12:22:25 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 12:30:35 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
| 12:33:57 | → | arahael joins (~arahael@124.168.94.52) |
| 12:34:10 | → | irrgit joins (~irrgit@176.113.74.74) |
| 12:36:19 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds) |
| 12:38:36 | → | irrgit_ joins (~irrgit@176.113.74.74) |
| 12:41:49 | × | irrgit quits (~irrgit@176.113.74.74) (Ping timeout: 252 seconds) |
| 12:44:19 | × | mcglk quits (~mcglk@131.191.49.120) (Quit: (seeya)) |
| 12:44:57 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 255 seconds) |
| 12:50:19 | → | king_gs joins (~Thunderbi@2806:103e:29:47b9:f34b:ffff:4cfc:90a6) |
| 12:52:54 | polo | is now known as money |
| 12:57:35 | <yin> | if i want a data type with 8 values (Word3) what's the best way to represent it for efficiency? data A = A0 | A1 | A2 | A3 | A4 | A5 | A6 | A7 or just type A = Word ? |
| 12:57:52 | <merijn> | Define efficiency |
| 12:59:31 | <yin> | a simulation with billion "atoms" that each can be in one of 8 states. speed is prioritized over space efficiency |
| 13:00:02 | <yin> | lots of updates |
| 13:00:03 | <merijn> | yin: tbh, you'd probably want some kinda packed array representation then |
| 13:00:10 | <merijn> | and/or SIMD accommodating stuf |
| 13:00:27 | <yin> | what is SIMD? |
| 13:01:21 | <merijn> | https://en.wikipedia.org/wiki/Single_instruction,_multiple_data |
| 13:02:01 | <yin> | oh i know what that is :) |
| 13:02:52 | <yin> | i don't need that much |
| 13:03:45 | <yin> | forget billion, let's say hundreds |
| 13:04:32 | <yin> | between those 2 choices or something similar, what should i be expecting? |
| 13:04:53 | × | shriekingnoise quits (~shrieking@186.137.167.202) (Quit: Quit) |
| 13:07:36 | × | frost5 quits (~frost@user/frost) (Ping timeout: 244 seconds) |
| 13:08:13 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Ping timeout: 252 seconds) |
| 13:09:13 | → | mcglk joins (~mcglk@131.191.49.120) |
| 13:09:14 | → | zer0bitz joins (~zer0bitz@196.244.192.57) |
| 13:09:23 | <Axman6> | yin: try both and benchmark |
| 13:12:37 | × | zer0bitz_ quits (~zer0bitz@196.244.192.57) (Ping timeout: 252 seconds) |
| 13:15:30 | <probie> | If you can afford the RAM, why not experiment with a one-hot encoding? newtype A = A Word8; pattern A0 = A 1; pattern A1 = A 2; pattern A2 = A 4; ... pattern A7 = A 128 |
| 13:17:19 | <Axman6> | yeh anpther good idea - makes -acking them into an unboxed vector trivial |
| 13:17:39 | → | Guest811 joins (~Guest811@185.134.101.4) |
| 13:17:44 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 13:17:53 | × | vglfr quits (~vglfr@145.224.100.22) (Remote host closed the connection) |
| 13:18:28 | → | vglfr joins (~vglfr@145.224.100.22) |
| 13:21:05 | <Axman6> | Hecate: well, I laughed at the Rishi Sunak joke XD |
| 13:21:59 | × | vglfr quits (~vglfr@145.224.100.22) (Remote host closed the connection) |
| 13:22:17 | → | vglfr joins (~vglfr@145.224.100.22) |
| 13:24:06 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 255 seconds) |
| 13:25:15 | → | irrgit__ joins (~irrgit@146.70.27.218) |
| 13:26:26 | × | vglfr quits (~vglfr@145.224.100.22) (Remote host closed the connection) |
| 13:27:00 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 13:27:22 | → | vglfr joins (~vglfr@145.224.100.22) |
| 13:27:28 | × | irrgit_ quits (~irrgit@176.113.74.74) (Ping timeout: 252 seconds) |
| 13:29:09 | × | vglfr quits (~vglfr@145.224.100.22) (Remote host closed the connection) |
| 13:29:42 | → | vglfr joins (~vglfr@145.224.100.22) |
| 13:30:05 | → | irrgit_ joins (~irrgit@176.113.74.130) |
| 13:30:13 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds) |
| 13:30:22 | × | vglfr quits (~vglfr@145.224.100.22) (Remote host closed the connection) |
| 13:30:32 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 13:31:55 | → | vglfr joins (~vglfr@145.224.100.22) |
| 13:32:25 | × | irrgit__ quits (~irrgit@146.70.27.218) (Ping timeout: 252 seconds) |
| 13:32:26 | → | ystael joins (~ystael@user/ystael) |
| 13:33:40 | × | shapr quits (~user@68.54.166.125) (Ping timeout: 248 seconds) |
| 13:34:23 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 246 seconds) |
| 13:34:29 | × | vglfr quits (~vglfr@145.224.100.22) (Remote host closed the connection) |
| 13:35:52 | → | vglfr joins (~vglfr@145.224.100.22) |
| 13:36:53 | × | Guest811 quits (~Guest811@185.134.101.4) (Quit: Client closed) |
| 13:39:19 | <Hecate> | Axman6: :D |
| 13:41:31 | Kaipei | is now known as Kaiepi |
| 13:45:42 | → | acidjnk joins (~acidjnk@p200300d6e7137a36f0ab6f680c2cefbd.dip0.t-ipconnect.de) |
| 13:47:03 | <kaol> | Why's there no Contravariant instance for (->)? |
| 13:47:51 | <merijn> | kaol: The types don't line up |
| 13:48:06 | <merijn> | kaol: The contravariant instance would be on the first argument to (->), not the second |
| 13:48:56 | <kaol> | I thought it'd be something like that. |
| 13:48:57 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 13:49:08 | <merijn> | You can write "instance Functor ((->) a) where" but there's no way to write, like, "instance Contravariant (Flip (->) a)" or "instance Contravariant ((->) ? a)" |
| 13:49:18 | → | seydar joins (~seydar@154-27-113-252.starry-inc.net) |
| 13:49:29 | <merijn> | It requires type level lambdas to do that, which is a whole other can of worms |
| 13:50:07 | <merijn> | You could write "newtype FlipFun b a = FlipFun (a -> b)" instance Contravariant (FlipFun r)" though |
| 13:50:37 | → | shapr joins (~user@68.54.166.125) |
| 13:50:56 | <kaol> | Reminds me of TypeApplications somewhat. They can do stuff like "f @_ @Int". |
| 13:51:22 | <merijn> | kaol: More usefully, Profunctor includes both options for (->) |
| 13:51:25 | <seydar> | is there a better way to store GPS coordinates so that I can do a faster distance calculation? |
| 13:51:37 | → | Teacup_ joins (~teacup@user/teacup) |
| 13:52:25 | <kaol> | Yeah, no big loss of anything if I use it as profunctor instead. I was just wondering about it. |
| 13:53:19 | × | irrgit_ quits (~irrgit@176.113.74.130) (Ping timeout: 252 seconds) |
| 13:53:27 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 13:54:12 | × | Teacup quits (~teacup@user/teacup) (Quit: No Ping reply in 180 seconds.) |
| 13:54:35 | × | Teacup_ quits (~teacup@user/teacup) (Read error: Connection reset by peer) |
| 13:55:31 | → | Teacup joins (~teacup@user/teacup) |
| 14:00:23 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 14:01:39 | → | Guest75 joins (~Guest75@178.141.197.193) |
| 14:02:09 | <Guest75> | Hello! I'm learning and trying to compose a function that break string on certain character: |
| 14:02:19 | <Guest75> | myBreak "" _ = [] |
| 14:02:19 | <Guest75> | myBreak x c = (takeWhile (/= c) x):myBreak(drop 1 (dropWhile (/= c) x)) |
| 14:02:50 | <Guest75> | when I've had one parameter and '\n' instead of c in (/= c) it worked fine, and like this I'm getting type error |
| 14:03:30 | <c_wraith> | what's your desired type? |
| 14:03:43 | <Guest75> | myBreak Char -> String -> [String] |
| 14:05:15 | <Guest75> | myBreak '\n' "apple\nbanana\norange" |
| 14:05:53 | <probie> | myBreak takes two arguments, yet in myBreak(drop 1 (dropWhile (/= c) x)) you're only giving it one argument |
| 14:06:19 | <kaol> | seydar: I'm going to say store in PosgreSQL and use PostGIS. |
| 14:06:31 | <c_wraith> | I'm surprised the error message didn't say you probably meant to pass it another argument |
| 14:07:10 | <Guest75> | probie thanks! really didn't see that :D |
| 14:07:43 | <Guest75> | c_wraith it's like that: https://paste.tomsmeding.com/gYuCJmfO |
| 14:08:34 | <Guest75> | I've used too much to overwhelming error messages, so will take some time to get acquainted with useful ones |
| 14:08:57 | <probie> | The other problem is that the you've got the two arguments backwards. Your provided type is Char -> String -> [String], but what you've written is a function String -> Char -> [String] |
| 14:09:53 | <probie> | In your example "c" (the character you break on) is the first argument. In the definition of myBreak you've given, it's the second argument |
| 14:11:37 | <Guest75> | probie yes, thanks. I fixed all errors now |
| 14:11:37 | <seydar> | kaol: thanks! |
| 14:11:59 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) |
| 14:12:44 | × | seydar quits (~seydar@154-27-113-252.starry-inc.net) (Quit: leaving) |
| 14:13:28 | <Guest75> | I actually think I'll be leaving most of the work to Haskell. i.e. instead of writing type signatues I'll write a function (if I understand it well) and then type :t <my function> to check etc |
| 14:14:08 | <geekosaur> | that's actually something of a bad idea. the compiler will produce much more helpful error nmessages if you declare all the expected types up front |
| 14:15:50 | <Guest75> | Will that be true still if dealing with more "relaistic" and complex tasks like e.g. using Aeson module, fns from Foldable/Traversable/Witherable etc typeclasses and other stuff? |
| 14:16:18 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Ping timeout: 255 seconds) |
| 14:18:12 | <c_wraith> | When type classes get involved, it becomes a lot more valuable. |
| 14:18:41 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 14:19:08 | <Guest75> | aha |
| 14:19:51 | <geekosaur> | the compiler will tend to make weird "assumptions" to try to make code typecheck unless you use a type signature to steer it in the correct direction |
| 14:20:06 | <geekosaur> | (sorry, p0hone call) |
| 14:20:14 | <Guest75> | had a look at this yesterday: https://paste.tomsmeding.com/KOJdzuvW |
| 14:21:24 | → | zebrag joins (~chris@user/zebrag) |
| 14:21:42 | <Guest75> | I agree that's still readable |
| 14:21:46 | × | echoone quits (~echoone@2a02:8109:a1c0:5d05:709d:fe7b:7272:b443) (Quit: Client closed) |
| 14:23:38 | <Guest75> | My actual goal with Haskell now it so process/analyse Python code (which I converted to JSON in good time) |
| 14:24:18 | <merijn> | Wait...why did you convert python to JSON to analyse *that*? :o |
| 14:24:33 | <Guest75> | @merij |
| 14:24:33 | <lambdabot> | Unknown command, try @list |
| 14:26:15 | <Guest75> | merijn: there's this Python module: https://github.com/Instagram/LibCST which parses Python code into set of nested nodes (subclasses of CSTNode). CSTNode is a dataclass (i.e. just merely like a record that has a name as in Haskell) |
| 14:27:38 | <merijn> | Guest75: What kinda processing/analysis are you trying to do? |
| 14:28:36 | <Guest75> | so for that dataclasses I've created a couple of procedures: https://dpaste.com/BFL46EM46 whcih convert to and from JSON (notice type/typeparam name clash LOL) |
| 14:29:59 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 14:30:04 | <Guest75> | merijn I usually code Python (and JavaScript) for food (kinda). In a project I work on is a lot of copy and paste code that's hard to maintain. I first come up with this tool to speed up the process: https://github.com/andrewboltachev/mega-copy |
| 14:30:23 | × | king_gs quits (~Thunderbi@2806:103e:29:47b9:f34b:ffff:4cfc:90a6) (Ping timeout: 276 seconds) |
| 14:30:27 | <Guest75> | (ah unfortunantly README disappeared) |
| 14:30:33 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 14:31:19 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 14:35:12 | <Guest75> | https://dpaste.com/5B6L2K97P like this really :/ |
| 14:37:20 | × | arahael quits (~arahael@124.168.94.52) (Ping timeout: 252 seconds) |
| 14:39:56 | <Guest75> | merijn so in fact I want to create sth like subset of Python: https://dpaste.com/7X8VCYP2G which will help to find "patterns" of code first |
| 14:40:49 | <merijn> | I mean, you're effectively trying to create a compiler/DSL :) |
| 14:41:18 | <merijn> | Which is generally easier to do when you actually approach things as a compiler/DSL problem |
| 14:41:44 | <Guest75> | The thing is that the code above is 100% syntactically correct. I don't need to parse it. I just need to interpret |
| 14:42:18 | <merijn> | Do I have some bad news for you :) |
| 14:42:26 | <Guest75> | please? |
| 14:42:43 | <merijn> | That you WILL have to parse it |
| 14:43:04 | <merijn> | The only question is whether you're parsing it from the JSON format you mentioned earlier or just Python directly |
| 14:43:47 | <merijn> | You need structured data to implement an interpreter and going from unstructured JSON (or python source) to a structured representation *is* parsing |
| 14:44:37 | <Guest75> | JSON for the above is like that currently: https://dpaste.com/3A6B3MW5X |
| 14:45:05 | nckhexen | is now known as jeffbezos |
| 14:45:32 | <Guest75> | Python directly is scary to me yet :-) |
| 14:45:36 | × | phma quits (~phma@2001:5b0:211f:2dc8:ca7e:3ef3:1458:a7b3) (Read error: Connection reset by peer) |
| 14:46:19 | <merijn> | Guest75: You will probably still want to define your AST type to work with. Whether you construct that AST from JSON or python source isn't *that* important |
| 14:46:47 | <merijn> | But working with an actual AST will make your life considerably easier than working with a mess of JSON |
| 14:47:13 | <Guest75> | But this JSON *is* and AST. It's even a CST (generated by LibCST) |
| 14:47:18 | <Guest75> | *an AST |
| 14:48:06 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 14:48:18 | → | phma joins (~phma@2001:5b0:2172:ba88:9bea:3e0e:39f6:5a74) |
| 14:49:18 | <ski> | the point of using a dedicated AST datatype is to rule out (some) invalid representations. if you're using a generic JSON format, chances are most of the allowed inputs are syntactically invalid |
| 14:49:31 | <ski> | (well, part of the point, anyway) |
| 14:50:27 | <Guest75> | ski yes I've been thinking to generate a datatype like... data PyCSTNode = SimpleWhitespace { value :: String } | Expr { value :: CSTNode ...} ... |
| 14:50:31 | <yin> | use GADTs to make illegal states unrepresentable! |
| 14:50:40 | → | arahael joins (~arahael@124.168.94.52) |
| 14:50:41 | <yin> | (am i doing this right?) |
| 14:50:49 | <Guest75> | but want to do that more or less automatically :-) |
| 14:51:01 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 14:51:21 | <ski> | you're representing whitespace ? |
| 14:51:24 | × | chomwitt quits (~chomwitt@2a02:587:dc18:4a00:1ac0:4dff:fedb:a3f1) (Ping timeout: 246 seconds) |
| 14:52:01 | <Guest75> | ski that's part of LibCST format ("concete" syntax tree, not "abstract"). In fact LibCST has very clever approach to Whitespace |
| 14:52:07 | <ski> | are you sure you're not doing a parse tree, a *concrete* syntax tree, rather than an *abstract* syntax tree ? |
| 14:52:18 | <ski> | mhm |
| 14:52:39 | <Guest75> | "clever" in a way that if you generate it from scratch |
| 14:52:59 | <Guest75> | it auto-adds useful defaults |
| 14:53:26 | <Guest75> | and yes the end goal is to write python back to files |
| 14:53:28 | <ski> | yin : .. maybe, maybe not ? |
| 14:54:26 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 14:55:09 | × | shapr quits (~user@68.54.166.125) (Remote host closed the connection) |
| 14:55:35 | yin | shrugs |
| 14:56:05 | <Guest75> | yin yes I will love to see anything algebraic :-) |
| 14:56:45 | <Guest75> | I wonder why this isn't popular in other languages. e.g. "reduce" function is really something that works on Monoid |
| 14:56:48 | × | phma quits (~phma@2001:5b0:2172:ba88:9bea:3e0e:39f6:5a74) (Read error: Connection reset by peer) |
| 14:57:05 | → | sadmax joins (~user@209.205.174.253) |
| 14:57:09 | <ski> | hm, well. sometimes "AST" means "Abstract Syntax Tree". but sometimes (more in a Haskell context) "AST" can also mean "Algebraic Data Type" |
| 14:57:21 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 14:57:38 | <Guest75> | aha |
| 14:58:52 | <Guest75> | One Clojure developer I talked to said that "Trying to find Monads and other patterns in code is more like trying to find birds in tree" |
| 14:59:53 | <geekosaur> | huh? isn;t that ADT? |
| 15:00:05 | <Guest75> | but I think I'm yet to discover algebraic types' usability |
| 15:00:14 | <ski> | er .. sorry, brainfart |
| 15:00:23 | <geekosaur> | although I think ADT has its own dual meaning |
| 15:00:32 | <ski> | i was thinking of "Abstract Data Type" versus "Algebraic Data Type" |
| 15:01:16 | <geekosaur> | right, that |
| 15:01:32 | <merijn> | Guest75: Fairly straightforward? :p |
| 15:01:45 | <merijn> | Finding birds in trees isn't particularly challenging |
| 15:01:54 | <ski> | Guest75 : "reduce" in which sense ? |
| 15:02:33 | <geekosaur> | depends. I could hear a catbird in a nearby tree but couldn't spot it for the life of me this morning |
| 15:03:00 | <Guest75> | @ski: reduce e.g. collapse a list to a value. is it called foldl/foldr? Us who doesn't know about moniods (not me) can say: "reduce" has 0 element and binary operation |
| 15:03:00 | <lambdabot> | Unknown command, try @list |
| 15:03:04 | <Guest75> | ski: reduce e.g. collapse a list to a value. is it called foldl/foldr? Us who doesn't know about moniods (not me) can say: "reduce" has 0 element and binary operation |
| 15:03:39 | <Guest75> | @merijn : I thought he said that it's funny but not useful |
| 15:03:39 | <lambdabot> | Unknown command, try @list |
| 15:03:40 | <yin> | finding birds in trees is trivial but finding birds in trees in a specific order can be challanging |
| 15:03:43 | <Guest75> | merijn : I thought he said that it's funny but not useful |
| 15:04:13 | <geekosaur> | huh? patterns are very useful. patterns are how we think |
| 15:04:54 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:97e6:998a:289d:5f8e) (Ping timeout: 255 seconds) |
| 15:04:56 | → | ddellacosta joins (~ddellacos@143.244.47.76) |
| 15:05:43 | <Guest75> | I think Clojure tend to simplify things (to just plain data mostly), and found out monads and other structures are complex |
| 15:06:18 | <Guest75> | Creator of Clojure Rich Hickey gave this talk, naming it after Maybe in Haskell: https://www.youtube.com/watch?v=YR5WdGrpoug |
| 15:07:27 | <probie> | Guest75: don't tag people with an "@" - it's not idiomatic on IRC (and it confuses lambdabot) |
| 15:07:44 | <Guest75> | aha ty probie |
| 15:08:49 | <merijn> | tbh, I kinda liked Rich Hickey's philosophy (it's not for me, but has at least some internal consistency), but he's very dismissive about things like Haskell without, imho, demonstrating that he actually understands them well enough to have an opinion on it |
| 15:09:03 | <ski> | Guest75 : well, "fold" can have two distinct meanings (in this context). (a) combine a sequence of "elements" into a single result -- this combination could be monoidal (`fold',`foldMap'), or it could be left- or right- associated (`foldl',`foldr'); or (b) replace the constructors of a (usually recursive) data type with provided callback functions, "crushing/smashing" the structure down to a single result |
| 15:09:35 | <ski> | Guest75 : for (single-linked, right-associated) lists, `foldr' happens to be both (a) and (b). but in general, these are distinct things |
| 15:09:38 | → | zer0bitz_ joins (~zer0bitz@196.244.192.57) |
| 15:10:26 | <chromoblob> | :t (\(const x -> y) x -> y) |
| 15:10:27 | <lambdabot> | b -> p -> Expr |
| 15:10:43 | <Guest75> | merjin: for me the saddest thing is that Clojure as a result (or however else) still doesn't have decent typing system. https://github.com/clojure/core.typed this one just failed. and clojure.spec is a runtime mechanism |
| 15:10:58 | <chromoblob> | interesting, how does the view pattern access variables that happen on right of it? |
| 15:11:21 | <chromoblob> | it's not a straightforward transformation to cases any more |
| 15:11:43 | <ski> | ime, `reduce' is often used where the neutral element is only used when there's zero elements. while `foldl' and `foldr' will use the "initial state" / "bottom recursive result" (which need not be a neutral element in a monoid) in every case |
| 15:11:56 | <jean-paul[m]> | is there a simple API to get the current time as a POSIX timestamp as an integer? :/ There's so many ways to get other kinds of time or POSIX timestamps as other types but I can't find this one. |
| 15:12:23 | <ski> | chromoblob : it doesn't |
| 15:12:31 | <ski> | that uses `x :: Expr' from `simplereflect' |
| 15:12:44 | <ski> | @type x |
| 15:12:45 | <lambdabot> | Expr |
| 15:12:48 | <ski> | > x^5 |
| 15:12:50 | <lambdabot> | x * x * (x * x) * x |
| 15:13:04 | <chromoblob> | :t (\(const lala -> y) lala -> y) |
| 15:13:04 | × | zer0bitz quits (~zer0bitz@196.244.192.57) (Ping timeout: 252 seconds) |
| 15:13:05 | <lambdabot> | error: |
| 15:13:05 | <lambdabot> | • Variable not in scope: lala |
| 15:13:05 | <lambdabot> | • Perhaps you meant ‘ala’ (imported from Control.Lens) |
| 15:13:09 | <Guest75> | ski : thanks, I expect to be more complicated meanings of it there. AFAIK all "reduces" I worked with do use neutral element if it's given |
| 15:13:11 | <chromoblob> | ah, okay |
| 15:14:00 | <ski> | Guest75 : yea, often it's used as a synonym for `foldl'/`fold-left' |
| 15:14:01 | <chromoblob> | but could it in principle do that |
| 15:14:17 | <chromoblob> | via letrecs somehow |
| 15:14:59 | → | phma joins (phma@2001:5b0:210d:ac28:95ba:8163:b584:2813) |
| 15:15:23 | <ski> | @type let map _ [] = []; map f ((f -> y):(map f -> ys)) = y:ys in map |
| 15:15:24 | <lambdabot> | (t -> a) -> [t] -> [a] |
| 15:15:53 | <ski> | @type \x x -> x |
| 15:15:54 | <lambdabot> | error: |
| 15:15:54 | <lambdabot> | • Conflicting definitions for ‘x’ |
| 15:15:54 | <lambdabot> | Bound at: <interactive>:1:2 |
| 15:16:21 | <ski> | given ^, it would make sense for `\(const x -> y) x -> y' to work as you wanted, imho |
| 15:17:59 | <ski> | (but perhaps this is because of matching patterns from left to right, hm) |
| 15:18:37 | <Guest75> | geekosaur : do you guys use more "advanced" constructs from CT in Haskell such as Limits/Co-limits? |
| 15:19:13 | <ski> | we don't tend to talk about limits and colimits much, really |
| 15:19:15 | <Guest75> | (talking directly from B. Milewski's book :-) ) |
| 15:19:49 | <Guest75> | so in practice that's a bit "overhyped"? |
| 15:20:28 | <ski> | it can be fun to know about, if you enjoy math. but it's not essential to use Haskell, no |
| 15:20:48 | <Guest75> | I only understood what a Monad is in Haskell about 2 weeks ago, and I wonder if other things will bring much use or not |
| 15:21:24 | <ski> | occasionally, such a CT concept may be relevant, to some degree. and occasionally, it can be nice to be able to recognize/spot a categorical pattern, in code or interfaces (and possibly even be able to exploit the pattern for some good) |
| 15:21:51 | <geekosaur> | that said, I'm a sysadmin, not a mathy type, and I get by without all the advanced math |
| 15:21:59 | <geekosaur> | even maintain a couple Haskell packages |
| 15:22:14 | → | python476 joins (~user@88.160.31.174) |
| 15:22:17 | <merijn> | Guest75: You can see how useful abstractions are by how quickly they took over Haskell :p |
| 15:22:28 | × | pie_ quits (~pie_bnc@user/pie/x-2818909) (Ping timeout: 248 seconds) |
| 15:22:29 | <ski> | e.g. (not quite the same thing, since it's just abstract algebra, not category theory(, but in the two videos where kmett talks about monoidal parsing, he talks about the pattern of semi-direct product popping up several times in practical programming |
| 15:22:46 | <merijn> | Guest75: Monadic IO wasn't in the first 3 (4?) versions of Haskell, but when it was added took over everything instantly |
| 15:23:08 | <Guest75> | geekosaur: aha, ty! I recall someone told me about a Haskell package for custom keyboard control (i.e. hardware) |
| 15:23:11 | <merijn> | Guest75: Similarly, Applicative wasn't discovered until, like, 2004 and was *everywhere* in the Haskell ecosystem within 3 years |
| 15:23:24 | <geekosaur> | merijn, even that can be misleading though. Monad got in not because it wasCT but because it provided something a whole lot more reliable than `main :: [Response] -> [Request]` |
| 15:23:30 | <merijn> | Meanwhile, Arrows language in obscurity |
| 15:23:32 | <Guest75> | https://math.mit.edu/~dspivak/informatics/talks/galois.pdf this is one idea that took over me at least :-) |
| 15:23:42 | <geekosaur> | Guest75, kmonad? |
| 15:23:51 | × | darkstardevx quits (~darkstard@50.126.124.156) (Read error: Connection reset by peer) |
| 15:23:55 | <ski> | the biggest problem with `Arrow' is probably `arr' |
| 15:24:18 | <Guest75> | geekosaur : yes, must be! |
| 15:25:10 | × | vglfr quits (~vglfr@145.224.100.22) (Ping timeout: 252 seconds) |
| 15:26:03 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Read error: Connection reset by peer) |
| 15:26:43 | <ski> | geekosaur : yes. even making `newtype Answer = MkAnswer ([Response] -> [Request])' an abstract data type, and coding in CPS (effectively `Cont Answer', without the monadic abstraction) would have gone quite some way towards more reliability |
| 15:26:44 | → | pie_ joins (~pie_bnc@user/pie/x-2818909) |
| 15:26:52 | <merijn> | ski: Sure, but the question was "I wonder if other things will bring as much use" and I'm just arguing that "adoption rate" is a pretty good proxy metric for that :p |
| 15:27:16 | <merijn> | Profunctor seems much more useful than Arrow, because it's much more widely adopted and used than Arrow |
| 15:27:57 | <Guest75> | merjin : I think I'll agree with the adoption rate criteria :-) |
| 15:28:28 | <ski> | Andrew Appel in "Modern Compiler Implementation in {ML|Java|C}" in 1998 at <https://www.cs.princeton.edu/~appel/modern/> uses such a CPS `Answer' type for a pure functional language, in one chapter |
| 15:28:57 | <ski> | merijn : sure :b |
| 15:29:54 | ski | still thinks `Profunctor' should probably have been named `Difunctor' |
| 15:30:36 | × | Kaiepi quits (~Kaiepi@108.175.84.104) (Ping timeout: 246 seconds) |
| 15:31:02 | <jbggs[m]> | What's a profunctor? |
| 15:31:21 | <chromoblob> | :t (\a b -> let const x -> y = a; x = b in y) |
| 15:31:22 | <lambdabot> | error: parse error on input ‘->’ |
| 15:31:28 | <chromoblob> | :t (\a b -> let (const x -> y) = a; x = b in y) |
| 15:31:29 | <lambdabot> | b -> p -> Expr |
| 15:31:36 | → | darkstardevx joins (~darkstard@50.126.124.156) |
| 15:31:50 | <chromoblob> | :t (\a b -> let (const lala -> mama) = a; lala = b in mama) |
| 15:31:51 | <lambdabot> | error: |
| 15:31:51 | <lambdabot> | • Variable not in scope: lala |
| 15:31:51 | <lambdabot> | • Perhaps you meant one of these: |
| 15:32:48 | × | darkstardevx quits (~darkstard@50.126.124.156) (Remote host closed the connection) |
| 15:32:52 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds) |
| 15:32:56 | <chromoblob> | :t (\a b -> let lala = b; (const lala -> mama) = a in mama) |
| 15:32:57 | <lambdabot> | error: |
| 15:32:57 | <lambdabot> | • Variable not in scope: lala |
| 15:32:57 | <lambdabot> | • Perhaps you meant ‘ala’ (imported from Control.Lens) |
| 15:33:12 | → | darkstardevx joins (~darkstard@50.126.124.156) |
| 15:33:25 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 15:33:44 | → | Kaiepi joins (~Kaiepi@108.175.84.104) |
| 15:33:48 | <ski> | i'm not sure to which extent usage of `ViewPatterns' outside of function formal parameter patterns were given that much thought, in the design and implementation of the extension |
| 15:33:59 | <Guest75> | jbggs[m] : I also didn't understood that yet. but there are materials about it: https://www.youtube.com/watch?v=wtIKd8AhJOc&list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_&index=14 |
| 15:35:35 | <Guest75> | jbggs[m] : e.g. at 41:10 |
| 15:35:39 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) |
| 15:35:40 | <merijn> | jbggs[m]: A type that is a Contravariant functor in it's first type argument, but functor in it's second argument |
| 15:36:06 | <merijn> | jbggs[m]: You can kinda think of "Functor" as "producers" of a value of type 'a' that you can adapt into "producers" of a new type 'b' |
| 15:36:35 | <merijn> | You can kinda think of Contravariant as a "sink"/"consumer" of a value of type 'a' that you can adapt into a "sink" of values of a new type 'b' |
| 15:36:45 | → | Spukgespenst joins (~user@user/siracusa) |
| 15:37:14 | <merijn> | And along those lines Profunctors would be connectors that act as a "sink" for one type that "produces" another type (so you can independently change the type it accepts and that it produces) |
| 15:38:36 | <Guest75> | merijn : what's usage example for that? can it be explained with such easy functors as Maybe and [ ] ? |
| 15:39:41 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 15:39:57 | <ski> | i think i saw some language suggesting that the codomain of a profunctor needing to be `Set' (or `Hask', in the Haskell approximation) .. this not needing to be the case for a difunctor. but i'm not sure about this |
| 15:41:33 | <ski> | Guest75 : a "pipe" between threads that you can pass `a's into, and accept `b's out of, would be one example |
| 15:41:35 | <jbggs[m]> | I think I get the gist, but I think I'm gonna have to spend a lot more time understanding Contravariant before I get it |
| 15:42:39 | <ski> | imagine something like `mkPipe :: IO (Pipe a b,Pipe b a)', and then you go on using one direction in one thread, and the other in another (e.g. `forkIO'ed) thread |
| 15:43:09 | <ski> | or the various streaming I/O libraries, for that matter |
| 15:43:32 | <Guest75> | so that actually has to do with parallel Haskell |
| 15:43:52 | <Guest75> | web/websockets etc too |
| 15:43:55 | <ski> | the latter doesn't have to do with parallelism, nor (preemptive) concurrency |
| 15:44:21 | <merijn> | Guest75: Maybe and [] only have one type argument, so can't be Profunctors |
| 15:44:26 | <Guest75> | aha |
| 15:44:39 | <Guest75> | are pipes like CSP channels (in go or Clojure)? |
| 15:44:42 | <merijn> | jbggs[m]: Have you seen, for example, Conduit before? |
| 15:44:54 | <ski> | (well, i guess you'd produce `Pipe a a', and then `dimap' over that) |
| 15:45:00 | <merijn> | Guest75: "pipes" is a hand-wavy vague term without definite meaning there |
| 15:45:18 | <Guest75> | aha |
| 15:45:23 | <merijn> | Guest75: i.e. a function 'a -> b' is a profunctor it "consumes as and produces bs" |
| 15:45:42 | <merijn> | You can use a function "d -> a" to turn a function "a -> b" into "d -> b" |
| 15:45:44 | <ski> | functions are the basic example, of course |
| 15:46:06 | <merijn> | You can also use a function 'b -> e' to turn "a -> b" into "a -> e" |
| 15:46:34 | <merijn> | :t dimap |
| 15:46:34 | <lambdabot> | Profunctor p => (a -> b) -> (c -> d) -> p b c -> p a d |
| 15:46:34 | <ski> | dimap :: (a1 -> a0) -> (b0 -> b1) -> ((a0 -> b0) -> (a1 -> b1)) |
| 15:46:42 | <merijn> | Now imagine p = "(->)" and see how that follows my exampe |
| 15:47:13 | <ski> | dimap :: (a1 -> a0) -> (b0 -> b1) -> (p a0 b0 -> p a1 b1) -- in the general case |
| 15:47:42 | <Guest75> | yes, speaking of me I have few hunderds of pages (C. Allen and B. Milewski) to comprehend yet and then I'll be able to understand that :-) |
| 15:47:50 | <chromoblob> | :t (\a b -> let (y, Just x) = let (const x -> y) = a in (y, b) in y) |
| 15:47:51 | <lambdabot> | b -> Maybe a -> a |
| 15:48:29 | <chromoblob> | whew |
| 15:48:54 | <merijn> | Guest75: tbh I haven't read that book and now fuck all about CT and I still follow the Profunctor thing :p |
| 15:48:55 | <Guest75> | now I only understand that p is generalization of a function (->) and then there're multiple functions/mappings/pipes etc that work together. that still has to fit with CT as well |
| 15:48:59 | <merijn> | Guest75: CT is overrated |
| 15:49:13 | <merijn> | (for productive Haskell, that is) |
| 15:49:59 | <Guest75> | aha... I'm not sure if CT is useful for math either. Or... is math useful :P |
| 15:50:07 | <Guest75> | (for programming) |
| 15:50:12 | <ski> | is music useful ? |
| 15:50:33 | × | foul_owl quits (~kerry@23.82.194.108) (Ping timeout: 246 seconds) |
| 15:50:42 | <chromoblob> | music useful for musicians, lets them make money :p |
| 15:50:45 | <ski> | math is an artform |
| 15:51:14 | <Guest75> | ski: yes. I have DIY alaram clock that wakes me up with "Pink Floyd - Time" every morning :-) |
| 15:51:16 | <APic> | No Science exists that cannot be seen as Form of Art |
| 15:52:24 | × | Guest75 quits (~Guest75@178.141.197.193) (Quit: Client closed) |
| 15:52:36 | → | Guest75 joins (~Guest75@178.141.197.193) |
| 15:52:43 | <chromoblob> | now, how to devise a general transform... |
| 15:52:59 | → | kenran joins (~user@user/kenran) |
| 15:53:01 | <geekosaur> | math is useful only to the extent that some (not all) mathematical constructs are useful in understanding or producing real world things |
| 15:53:05 | <ski> | (aesthetic notions, like elegance, symmetry, balance, are very important in mathematics. "for every notion of structure there ought to be a corresponding notion of structure-preserving homomorphism" is an aesthetic (deontic) judegment) |
| 15:53:49 | × | kenran quits (~user@user/kenran) (Remote host closed the connection) |
| 15:53:49 | <geekosaur> | physics understands this and regularly abuses math to get the results it wants 🙂 |
| 15:53:49 | <ski> | @quote is.not.optional |
| 15:53:49 | <lambdabot> | O'Keefe says: "Elegance is not optional." |
| 15:54:34 | <dolio> | No they don't. They just lie about what math they're using. |
| 15:54:36 | <ski> | (with more elegant abstractions, things tend to be more succinct, concise, clear, orthogonal, less space for bugs to hide) |
| 15:54:42 | <Guest75> | In my career I only once or so used arctg (trigonometric function) to calc position of a point in a JS widget correctly. It worked very well, but I wasn't sure about edge cases |
| 15:55:12 | <Guest75> | I guess ppl who are good in math know everything |
| 15:55:18 | <ski> | nah |
| 15:56:28 | <ski> | "arctg" being arctangens, for computing angle from position ? |
| 15:56:48 | <ski> | @type atan2 |
| 15:56:49 | <lambdabot> | RealFloat a => a -> a -> a |
| 15:56:53 | <Guest75> | ski: yes. I wrote function called "unrotate" to "unrotate" the point |
| 15:57:19 | <ski> | .. rotate backwards ? |
| 15:57:30 | justHaunted | is now known as DeliriumTremens_ |
| 15:58:59 | → | vglfr joins (~vglfr@145.224.100.22) |
| 16:00:12 | <Guest75> | ski: I've used ReactJS (to be more precise: https://nebula.gl/ this thing from Über) and a 2D map. In my fn (event handler) I already had coords of a point that was rotated or sth like this |
| 16:00:37 | → | nate3 joins (~nate@98.45.169.16) |
| 16:00:52 | <Guest75> | I'm still not sure if it's as simple as rotate back (to (negate angle) of a given one) |
| 16:00:56 | <ski> | mhm, ic |
| 16:01:03 | <dsal> | The responses to the bugs I filed against postgresql-simple are pretty encouraging for my hasql port. |
| 16:01:10 | → | econo joins (uid147250@user/econo) |
| 16:01:51 | <ski> | well .. you could simply multiply by a rotation matrix, rather than mucking with `atan' or `atan2' |
| 16:02:01 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 16:02:31 | <Guest75> | ski: that's 3x3 matrix right?:-) that's why I say about math |
| 16:02:35 | <chromoblob> | how can i see Core code of a function without installing GHC? |
| 16:02:40 | × | ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 258 seconds) |
| 16:02:43 | <Guest75> | affine transformations etc |
| 16:03:27 | <chromoblob> | i was reading "Implementing functional languages" of Simon Peyton Jones and was wondering if GHC currently uses FATBAR operator, or what does it use instead of it |
| 16:04:21 | <chromoblob> | THE IMPLEMENTATION |
| 16:04:21 | <chromoblob> | OF FUNCTIONAL |
| 16:04:22 | <chromoblob> | PROGRAMMING LANGUAGES |
| 16:04:24 | <chromoblob> | i mean |
| 16:04:34 | <chromoblob> | sorry for newlines |
| 16:04:34 | → | foul_owl joins (~kerry@23.82.194.108) |
| 16:04:45 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 16:04:52 | <chromoblob> | 1987 book |
| 16:04:57 | <Guest75> | ski : I agree using more standard tool like matrix might be more clear (for another developer to read the code later) |
| 16:05:21 | <ski> | if `(x,y)' is the original point, and you want to rotate it an angle `alpha' counter-clockwise from the positive `x'-axis, you'd compute `(x*cos(alpha)-y*sin(alpha),x*sin(alpha)+y*cos(alpha))' |
| 16:06:31 | <ski> | Guest75 : no, two-by-two matrix, `[[cos(alpha),sin(alpha)],[-sin(alpha),cos(alpha)]]', not three-by-three |
| 16:06:47 | <Guest75> | the points also have offset |
| 16:07:11 | <Guest75> | maybe even after rotation |
| 16:07:18 | <ski> | yea, so subtract the orogin around which you want to rotate, then rotate, then add it back in |
| 16:07:28 | <ski> | s/orogin/origin/ |
| 16:08:13 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Remote host closed the connection) |
| 16:09:10 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 16:10:40 | <chromoblob> | for those who don't know, the book describes a function x FATBAR y = x if x /= FAIL, y otherwise, where FAIL is a special value returned by a right-hand side of an equation where pattern matching has failed |
| 16:10:43 | <ski> | (affine transformations are transformations of points. linear transformations are transformations of vectors. difference of two points is a vector. adding a vector to a point yields a point. often when material teaches matrices and vectors, vectors and points are blurred together) |
| 16:12:34 | <ski> | chromoblob : that sounds like a semantic device used to describe the meaning of programs on a mathematical level, but not (necessarily) of much use in an implementation (except perhaps proving it correct wrt a spec) |
| 16:13:31 | <ski> | presumably it could be used in the semantics of pattern-matching, the `case' construct (?) |
| 16:13:51 | <chromoblob> | ski: in the book, pattern matching is implemented by calls to FATBAR, i.e. expressions are transformed to those that contain FATBAR |
| 16:13:54 | <chromoblob> | book shows how to get rid of FATBAR in some cases, but not all cases |
| 16:14:12 | <ski> | ok |
| 16:14:59 | <chromoblob> | so in the implementation way that is presented by the book, FATBAR and FAIL are built-in |
| 16:15:32 | <chromoblob> | so i was wondering, what is in place of FATBAR in GHC |
| 16:15:50 | <ski> | in the implementation, presumably there's forcing of thunks, and then case analysis of tags |
| 16:16:29 | <ski> | i would expect there's no thing directly corresponding to this "FATBAR" |
| 16:17:35 | <chromoblob> | is there FAIL in GHC? the book doesn't show how completely get rid of it |
| 16:18:14 | <ski> | > let Just x = Nothing in x |
| 16:18:16 | <lambdabot> | *Exception: <interactive>:3:5-20: Non-exhaustive patterns in Just x |
| 16:19:14 | <chromoblob> | this simple example can be implemented using case, without FAIL at all |
| 16:19:29 | <chromoblob> | but there are more complex examples |
| 16:19:39 | × | maerwald_ quits (~maerwald@mail.hasufell.de) (Quit: gone) |
| 16:19:58 | → | maerwald joins (~maerwald@mail.hasufell.de) |
| 16:20:29 | <ski> | examples that can be generated from Haskell source, and not just from this "intermediate language" using "FATBAR" and "FAIL" ? |
| 16:21:03 | → | apache2 joins (apache2@anubis.0x90.dk) |
| 16:21:22 | × | sadmax quits (~user@209.205.174.253) (Remote host closed the connection) |
| 16:23:25 | × | pie_ quits (~pie_bnc@user/pie/x-2818909) () |
| 16:25:54 | → | kenran joins (~user@user/kenran) |
| 16:26:13 | × | kenran quits (~user@user/kenran) (Remote host closed the connection) |
| 16:28:19 | → | pie_ joins (~pie_bnc@user/pie/x-2818909) |
| 16:28:40 | DeliriumTremens_ | is now known as justache |
| 16:30:12 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds) |
| 16:30:53 | <chromoblob> | ok i found one example in the book, but now i see that it can be transformed using let, and FATBAR probably isn't needed otherwise |
| 16:31:27 | <chromoblob> | the book omits the transformation using let |
| 16:32:54 | × | mbuf quits (~Shakthi@49.204.120.214) (Quit: Leaving) |
| 16:36:33 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 16:37:42 | <chromoblob> | it's let f a b [] [] = a; f a b xs ys = b xs ys; f compiles to two nested case exprs on first and second list, and both (:) cases for inner and outer case expressions return (b xs ys), and book uses FATBAR to avoid duplicating the returned expression |
| 16:38:03 | <chromoblob> | but it can just be bound to a variable inside a let |
| 16:38:12 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds) |
| 16:39:08 | <chromoblob> | though, in the [] [] case the allocation of variable is unnecessary |
| 16:39:13 | <monochrom> | chromoblob: https://play-haskell.tomsmeding.com/ can show core code. Click the "Core" button. |
| 16:39:20 | <chromoblob> | thank you |
| 16:40:24 | <monochrom> | Eventually it is still better to install your own GHC so you have finer control. |
| 16:40:24 | × | Guest75 quits (~Guest75@178.141.197.193) (Quit: Client closed) |
| 16:45:51 | <chromoblob> | lots of fluff in that core output |
| 16:46:10 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 16:48:09 | → | gurkenglas joins (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
| 16:48:33 | × | ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
| 16:49:07 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 16:49:38 | → | Guest7596 joins (~Guest75@178.141.197.193) |
| 16:50:28 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds) |
| 16:50:58 | → | titibandit joins (~titibandi@xdsl-87-79-250-160.nc.de) |
| 16:54:16 | × | motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 252 seconds) |
| 16:54:16 | × | arahael quits (~arahael@124.168.94.52) (Ping timeout: 252 seconds) |
| 16:54:41 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 16:56:36 | → | king_gs joins (~Thunderbi@187.201.83.115) |
| 17:00:03 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 17:01:23 | → | shriekingnoise joins (~shrieking@186.137.167.202) |
| 17:01:43 | <chromoblob> | in core, in "case x of wild_abc { ... }", what is meaning of wild_abc? |
| 17:01:58 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 17:02:13 | → | chomwitt joins (~chomwitt@athe730-c-multi-217.home.otenet.gr) |
| 17:03:48 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 248 seconds) |
| 17:05:08 | <dolio> | That is an alias for the thing being scrutinized. GHC also remembers that it's guaranteed to be evaluated. |
| 17:05:57 | × | titibandit quits (~titibandi@xdsl-87-79-250-160.nc.de) (Quit: Leaving.) |
| 17:06:01 | → | troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua) |
| 17:06:28 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds) |
| 17:07:18 | → | arahael joins (~arahael@124.168.94.52) |
| 17:08:36 | <probie> | You'll also see `sat_abc` but I've never looked into what the `sat_` actually means |
| 17:08:44 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) |
| 17:09:06 | → | Guest38 joins (~Guest38@76.128.170.130) |
| 17:10:17 | → | zer0bitz joins (~zer0bitz@196.244.192.57) |
| 17:10:45 | × | Guest38 quits (~Guest38@76.128.170.130) (Client Quit) |
| 17:13:09 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Ping timeout: 255 seconds) |
| 17:13:14 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 17:13:31 | × | zer0bitz_ quits (~zer0bitz@196.244.192.57) (Ping timeout: 252 seconds) |
| 17:14:37 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 17:14:42 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) |
| 17:15:55 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Client Quit) |
| 17:16:34 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 17:16:36 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 248 seconds) |
| 17:18:40 | → | irrgit_ joins (~irrgit@146.70.27.218) |
| 17:19:27 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 255 seconds) |
| 17:22:31 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 17:23:11 | → | sadmax joins (~user@209.205.174.253) |
| 17:23:51 | → | python47` joins (~user@88.160.31.174) |
| 17:24:17 | × | python476 quits (~user@88.160.31.174) (Read error: Connection reset by peer) |
| 17:27:58 | × | sadmax quits (~user@209.205.174.253) (Remote host closed the connection) |
| 17:29:13 | → | sadmax joins (~user@209.205.174.253) |
| 17:29:35 | × | Kaiepi quits (~Kaiepi@108.175.84.104) (Ping timeout: 246 seconds) |
| 17:29:44 | × | sadmax quits (~user@209.205.174.253) (Read error: Connection reset by peer) |
| 17:30:07 | × | pie_ quits (~pie_bnc@user/pie/x-2818909) (Read error: Connection reset by peer) |
| 17:30:24 | → | sadmax joins (~user@209.205.174.253) |
| 17:30:34 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 17:30:58 | → | pie_ joins (~pie_bnc@user/pie/x-2818909) |
| 17:34:33 | × | darkstardevx quits (~darkstard@50.126.124.156) (Read error: Connection reset by peer) |
| 17:34:47 | → | darkstardevx joins (~darkstard@50.126.124.156) |
| 17:34:49 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Remote host closed the connection) |
| 17:35:04 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 17:35:35 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 17:39:00 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 248 seconds) |
| 17:39:48 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 17:40:05 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds) |
| 17:42:11 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 17:42:38 | → | redmp joins (~redmp@mobile-166-170-43-64.mycingular.net) |
| 17:44:05 | × | python47` quits (~user@88.160.31.174) (Remote host closed the connection) |
| 17:45:18 | → | Kaiepi joins (~Kaiepi@108.175.84.104) |
| 17:47:04 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 17:50:44 | × | Kaiepi quits (~Kaiepi@108.175.84.104) (Ping timeout: 248 seconds) |
| 18:02:25 | × | Feuermagier_ quits (~Feuermagi@154.28.188.170) (Quit: Leaving) |
| 18:02:45 | <chromoblob> | okay, i finally managed to create an example where expressions in cases are duplicated thus: case x of { A _ -> case y of { A _ -> ...; abcy -> f x abcy; }; abcx -> f abcx y; }; here (f x abcy) and (f abcx y) is same |
| 18:03:01 | <chromoblob> | GHC doesn't optimize this, even with -O2 |
| 18:04:02 | → | Kaiepi joins (~Kaiepi@108.175.84.104) |
| 18:05:09 | <probie> | They're not the same are they? If `A _` doesn't match, `y` doesn't need to be in whnf for `f abcx y` |
| 18:05:26 | <L29Ah> | are there haskell testing frameworks that make it easy to launch the program (main) with various args and check results? |
| 18:05:31 | <EvanR> | chromoblob, if you want "everything is an extension of some 'more basic' thing" it's interesting to pick coroutine for that |
| 18:05:43 | <probie> | s/`A _` doesn't match/`A _` doesn't match for x/ |
| 18:05:46 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 252 seconds) |
| 18:05:50 | <EvanR> | more often people try everything is an object, or everything is a set first |
| 18:06:56 | × | Inoperable quits (~PLAYER_1@fancydata.science) (Quit: All your buffer are belong to us!) |
| 18:07:22 | <probie> | chromoblob: out of curiosity, does it optimise it if you write "y `seq` case x of { A _ -> case y of { A _ -> ...; abcy -> f x abcy; }; abcx -> f abcx y; };"? |
| 18:07:23 | <EvanR> | in the case of process calculi, everything is a process, but coroutine would be a special case of implementation of that |
| 18:08:01 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 18:08:29 | <sm> | L29Ah: I think most of them show examples of a minimal main module, and offer an api that can select specific tests, but you have to hook those up yourself, processing command line args |
| 18:08:50 | × | tdammers quits (~tdammers@77.109.72.118.res.static.edpnet.net) (Ping timeout: 250 seconds) |
| 18:08:52 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 18:09:36 | <sm> | Happy Hallowe'en all 🎃 |
| 18:09:46 | <L29Ah> | sm: i mean the testing framework running my program in its entirety, as opposed to unit testing |
| 18:10:08 | <probie> | sm: Happy first of November |
| 18:10:10 | <L29Ah> | and comparing its output against other program for example |
| 18:10:27 | <sm> | ohh.. yes my shelltestrunner is one |
| 18:10:32 | <EvanR> | is Halloween is only appropriate time to suggest a new extension -XFRankeNTypes |
| 18:10:38 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Remote host closed the connection) |
| 18:11:04 | <sm> | probie: wow, belated then |
| 18:11:39 | <EvanR> | what in gods name timezone is it already Nov 1 |
| 18:12:05 | <probie> | GMT+11. It's 5am |
| 18:12:11 | <sm> | australia I'm thinking |
| 18:12:15 | → | Inoperable joins (~PLAYER_1@fancydata.science) |
| 18:13:15 | <L29Ah> | sm: interesting, can it be integrated with cabal nicely? hledger doesn't do that it seems |
| 18:13:56 | <sm> | L29Ah: no particular suppor for that, maybe a custom Setup could do it ? |
| 18:13:56 | <chromoblob> | probie: no, it only adds an enclosing case which implements the seq |
| 18:15:16 | <EvanR> | chromoblob, I was told CSE (when they actually are the same express even) is not commonly used. This example doesn't even get there |
| 18:16:18 | <EvanR> | CSE can cause unwanted sharing which could be bad |
| 18:16:26 | <sm> | L29Ah: or I guess a test suite that runs it |
| 18:17:38 | <chromoblob> | EvanR: how is sharing bad, you mean more memory will be used? |
| 18:18:40 | <L29Ah> | https://github.com/bennofs/hcltest/ looks the best so far but it's abandoned :< |
| 18:18:46 | × | irrgit_ quits (~irrgit@146.70.27.218) (Read error: Connection reset by peer) |
| 18:18:48 | <ski> | sharing is sometimes good, sometimes bad |
| 18:19:04 | <EvanR> | in the base case scenario you use very little memory because of lazy evaluation, the pieces being evaluated for temporary purposes are quickly collected |
| 18:19:12 | <EvanR> | best case* |
| 18:19:35 | <ski> | use very little memory, at the same time |
| 18:20:16 | <EvanR> | time dependent memory *thonk* |
| 18:20:23 | <EvanR> | memory at time t |
| 18:21:38 | <chromoblob> | EvanR: did you know that classes (structs) are coroutines? fields are state for coroutine, and every method sends a message to the coroutine |
| 18:22:06 | <EvanR> | sounds like everything is a ism |
| 18:22:41 | <EvanR> | https://wiki.c2.com/?EverythingIsa |
| 18:25:04 | → | tdammers joins (~tdammers@77.109.72.118.res.static.edpnet.net) |
| 18:25:08 | × | king_gs quits (~Thunderbi@187.201.83.115) (Read error: Connection reset by peer) |
| 18:25:27 | → | king_gs joins (~Thunderbi@2806:103e:29:47b9:f34b:ffff:4cfc:90a6) |
| 18:26:32 | <EvanR> | you can get a lot done in haskell thinking everything is an expression to be evaluated, perhaps with the possible "result" of ⊥ |
| 18:28:58 | → | Guest joins (~Guest@185.216.186.110) |
| 18:29:21 | × | Guest quits (~Guest@185.216.186.110) (Client Quit) |
| 18:29:37 | → | Guest2944 joins (~Guest29@185.216.186.110) |
| 18:32:13 | <Guest2944> | Hello. I have a question. A binary tree in Haskell is data BinaryTree a = Leaf | Node a (BinaryTree a) (BinaryTree a). Is it possible to add a parent pointer? |
| 18:32:22 | <chromoblob> | yes |
| 18:32:53 | <EvanR> | no, but you can express paths to a place in the tree using another data type |
| 18:33:17 | <EvanR> | also called a one hole context |
| 18:33:39 | <EvanR> | and a one hole context + the subtree at that location is called a zipper |
| 18:33:40 | <chromoblob> | data BinaryTree a = Leaf (Maybe (BinaryTree a)) | Node a (BinaryTree a) (BinaryTree a) (Maybe (BinaryTree a)) |
| 18:34:02 | <chromoblob> | every Maybe (BinaryTree a) is Nothing if no parent, or Just parent |
| 18:35:53 | <Guest2944> | Evan, thank you, I will have to google zipper and context |
| 18:36:55 | <EvanR> | specifically, one hole context |
| 18:36:55 | <geekosaur> | chromoblob, the problem with that is you need to use a lazy update / "tying the knot" to get the parent pointer in there, and updates become very difficult |
| 18:36:56 | <monochrom> | chromoblob: Regarding the haskell playground outputting too much: This is why it is advantageous to run your own GHC, because then you can specify -dsuppress-all (or more fine-grained -dsuppress-* options) for less verbose output. |
| 18:37:04 | <geekosaur> | one-hole contexts work better |
| 18:37:59 | <Guest2944> | chromoblob, did you successfully work with this or is it an idea? |
| 18:38:07 | <chromoblob> | just idea |
| 18:39:04 | <probie> | geekosaur: that might depend on what you're doing. If the tree is static and you just walk it, "tying the knot" will probably be more efficient |
| 18:39:17 | <sclv> | L29Ah , sm : if a test-suite has a build-tools-depends on an executable, then the code in the test suite can proceed with the executable in the path |
| 18:39:26 | <EvanR> | yeah updating the tree is pretty easy when it's not required |
| 18:39:32 | <geekosaur> | well, yes, that'swhy I specified updates |
| 18:39:45 | <monochrom> | Guest2944: https://wiki.haskell.org/Zipper may help. This is not parent pointer. However, it solves a lot of the problems that imperative people use parent pointers to solve. |
| 18:39:46 | <geekosaur> | if you're just walking it, no problem |
| 18:39:59 | <EvanR> | chromoblob's thing might be good as a read-only tree |
| 18:40:03 | <sm> | sclv: +1 |
| 18:40:24 | <Guest2944> | monochrom, thanks |
| 18:40:25 | <EvanR> | still pretty noisy though |
| 18:40:30 | <probie> | My mistake, I thought you made two separate statements when really they were one |
| 18:40:38 | <sm> | though, doesn't the user have to ensure it's installed ? |
| 18:40:43 | <monochrom> | I may actually go bold and claim they solve the exact same problems. |
| 18:41:07 | <sclv> | what if the problem that a parent pointer solves is "i want a pointer to a location in memory" :-P |
| 18:41:14 | <sm> | I doubt shelltestrunner is on cabals list of auto-installable tools |
| 18:41:24 | <EvanR> | sclv sounds like an XY problem xD |
| 18:41:39 | <sclv> | build-tool-depends can specify any executable in any haskell package. |
| 18:41:41 | <EvanR> | even in C locations in memory is usually not relevant, while pointers are |
| 18:41:59 | <sclv> | including an executable provided by the same package the test suite is for iirc |
| 18:42:38 | <sclv> | the only "magic" list cabal has that isn't really extensible yet is _auto preprocessors_ like cpp, c2hs, etc |
| 18:43:21 | <monochrom> | sclv: Haha you got me. |
| 18:43:28 | <EvanR> | though C and Haskell both let you basically do int * ptr = 1234 if "necessary" xD |
| 18:43:41 | <EvanR> | *1234 = 9 |
| 18:44:29 | <probie> | EvanR: Not treating them as "locations in memory", but you might be treating them as numbers if you're silly enough to "save" a word when implementing doubly-linked lists in C |
| 18:45:09 | <chromoblob> | damn, XOR linked lists are cool |
| 18:45:50 | <monochrom> | struct unary_nat { struct unary_nat *next; }; /* >:) */ |
| 18:47:26 | <sm> | sclv: cool, I did not know that |
| 18:47:44 | <EvanR> | NULL was a billion dollar mistake while zero was called "the singlemost important technological advancement of mankind" ? xD |
| 18:48:08 | <chromoblob> | xD |
| 18:48:40 | <sclv> | https://cabal.readthedocs.io/en/stable/cabal-package.html#pkg-field-build-tool-depends |
| 18:48:44 | <monochrom> | Perhaps all technological advancements are billion dollar mistakes, too. >:) |
| 18:50:54 | × | biberu quits (~biberu@user/biberu) (Read error: Connection reset by peer) |
| 18:52:29 | <chromoblob> | i opened https://wiki.haskell.org/Zipper and read phrase "differentiating the data structure", interesting, what is that? link there is dead |
| 18:53:44 | <monochrom> | Try https://en.wikibooks.org/wiki/Haskell/Zippers#Differentiation_of_data_types |
| 18:54:45 | → | biberu joins (~biberu@user/biberu) |
| 18:55:07 | <EvanR> | I got so caught up in differentiating data types I never really understood zippers. So that's why I didn't mention it xD |
| 18:55:10 | <monochrom> | You can also look for footnote 6 Conor McBride's paper "The Derivative of a Regular Type is its Type of One-Hole Contexts". |
| 18:55:40 | <geekosaur> | http://strictlypositive.org/diff.pdf |
| 18:55:55 | <EvanR> | by just solving your zipper problem in isolation maybe you can accomplish the task and get a raise, and do hilarious calculus later |
| 18:57:58 | <monochrom> | Well, I get my zipper from formal differentiation. It's faster and less error-prone than "think about it". |
| 18:58:01 | × | motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 252 seconds) |
| 18:58:36 | <monochrom> | I do not know why differentiation gives the correct answer, to be sure. |
| 18:59:02 | <EvanR> | there is a paragraph on that at the end of mcbride's paper |
| 18:59:06 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
| 18:59:15 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 18:59:16 | <EvanR> | about what partial differentiation even is |
| 18:59:32 | <monochrom> | So, my view is just use the formula to accomplish the task and get a raise, and understand hilarious calculus later! |
| 18:59:39 | <EvanR> | though he doesn't seem to be sure either |
| 19:00:42 | <monochrom> | This may be up there in the same genre as "why do quantum wave functions give probabilities?" :) |
| 19:01:02 | <geekosaur> | or just ignore the question and use it because it works, like me 🙂 |
| 19:01:09 | _________ | is now known as ___boo___ |
| 19:01:10 | ___boo___ | is now known as _________ |
| 19:01:24 | geekosaur | not very interested in type theory, much less the calculus thereof |
| 19:01:54 | <dolio> | The obvious answer is that it's exactly the same operation that mathematicians do on polynomials. The only deep question is why the operation on polynomials (which are syntactic expressions) has anything to do with other stuff in calculus. |
| 19:03:01 | <monochrom> | There may be some Lie Algebra reason going on behind both. |
| 19:03:06 | <dolio> | But you could already be asking that question in math if it weren't obscured over there. |
| 19:03:14 | <EvanR> | I bet whatever the answer is, it's spelled with category theory xD |
| 19:03:34 | → | aliosablack joins (~chomwitt@2a02:587:dc18:4a00:1ac0:4dff:fedb:a3f1) |
| 19:04:06 | <dolio> | Because mathematicians are so bad at keeping syntax vs semantics and expressions vs. functions straight. :þ |
| 19:04:27 | <dolio> | At least, when teaching stuff. |
| 19:05:11 | <L29Ah> | sclv: then it means sticking with cabal-v1 as build-tools-depends is picky // https://github.com/haskell/cabal/issues/8434 |
| 19:06:00 | <EvanR> | mcbride says maybe it's not what varying x means that is important but what else is staying the same (which is relevant for zippers) |
| 19:06:00 | <sclv> | no it doesn't. |
| 19:06:16 | × | chomwitt quits (~chomwitt@athe730-c-multi-217.home.otenet.gr) (Ping timeout: 252 seconds) |
| 19:06:22 | <sclv> | iirc build-tool-depends doesn't even really work with v1 stuff very well. |
| 19:06:36 | <EvanR> | we hold all the other variables constant for a partial derivative |
| 19:06:37 | <sclv> | it works great with v2 stuff -- it just doesn't have a mechanism for external package managers to hook into it yet! |
| 19:06:56 | <EvanR> | which corresponds to the branches not taken in a one-hole context |
| 19:08:17 | <EvanR> | --- |
| 19:08:30 | <EvanR> | and so in calculus, probably very little in the rules of differentiation has anything to do with calculus xD |
| 19:08:46 | <L29Ah> | sclv: in v1 it does work, as seen in https://github.com/gentoo-haskell/gentoo-haskell/issues/1074 |
| 19:09:07 | <sclv> | vis a vis one hole types and derivatives this is the same as the operation on combinatorial species, and you can connect that operation, categorically, to lawvere's axiomitization of synthetic differential geometry |
| 19:09:53 | <EvanR> | "I knew it" |
| 19:10:39 | <chromoblob> | "Amusingly, the following power series resembles list x" OMG, division by types? |
| 19:10:43 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 19:11:05 | <chromoblob> | but that's not quotient types |
| 19:11:07 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) |
| 19:11:10 | <sclv> | anyway i maintain it works fine for v2 stuff if you don't try to make it interact with an external package manager |
| 19:11:31 | × | chele quits (~chele@user/chele) (Remote host closed the connection) |
| 19:11:46 | <EvanR> | the power series for the list type looks like division just formally |
| 19:11:57 | <EvanR> | (or is it just formally) |
| 19:12:08 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds) |
| 19:12:41 | <EvanR> | (rather could that formal formula "keep going" into the laws of fields lol) |
| 19:12:46 | <monochrom> | Ugh Leibniz, not Newton?! >:) |
| 19:13:16 | <EvanR> | at least, the derivative of that formula (1 / (1 - x))^2 is the right answer |
| 19:13:45 | <EvanR> | the classic zipper |
| 19:13:54 | <dolio> | Right, all those syntactic rules work on power series, and expressions equivalent to formal power series. |
| 19:15:31 | <dolio> | Probably by definition? |
| 19:15:33 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Ping timeout: 255 seconds) |
| 19:15:37 | <sclv> | i think the "related work" section of d-for-data covers briefly the connection i mentioned http://www.strictlypositive.org/dfordata.pdf |
| 19:17:02 | → | Nolrai joins (~Nolrai@c-67-171-154-216.hsd1.or.comcast.net) |
| 19:18:05 | <sclv> | i think one can probably derive the intuition for why the syntactic rules arise from the underlying math vis a vis normal derivatives by considering the purely formal structure of synthetic differential stuff the right way -- that would be a great article to read! |
| 19:19:24 | × | zeenk quits (~zeenk@2a02:2f04:a105:5d00:c862:f190:2ea:d494) (Quit: Konversation terminated!) |
| 19:21:56 | <EvanR> | thanks sclv my afternoon is now shot |
| 19:23:23 | <sclv> | on the last, here is a good book if you have not seen https://users-math.au.dk/kock/sdg99.pdf |
| 19:24:36 | <monochrom> | That would shot a whole year :) |
| 19:24:47 | <monochrom> | err, shoot! Damn English. |
| 19:26:05 | <EvanR> | honestly would shot seems cromulent |
| 19:26:36 | <dolio> | Yeah, I imagine the rules for everything fall out via some 'obvious' analogues stuff you could do via rings. |
| 19:28:24 | <dolio> | Like, derivatives in SDG are kind of like, 'take your polynomial, and evaluate it on x+dx inside R[x,dx]/(dx^2 = 0).' |
| 19:28:31 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 19:28:57 | <dolio> | Or R[[x]][dx]/(dx^2 = 0), where [[x]] means power series. |
| 19:32:05 | <sclv> | i think for the basics its really only page 1-18 of the book. and if you don't care about categorical models, only pages 1-90 for the "whole thing" |
| 19:32:10 | <dolio> | And regular types are like formal power series on the 'ring of types'. |
| 19:33:09 | → | sadmax` joins (~user@209.205.174.253) |
| 19:33:29 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds) |
| 19:34:19 | × | sadmax quits (~user@209.205.174.253) (Ping timeout: 252 seconds) |
| 19:34:28 | → | Everything joins (~Everythin@37.115.210.35) |
| 19:35:53 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 19:36:08 | × | darkstardevx quits (~darkstard@50.126.124.156) (Read error: Connection reset by peer) |
| 19:36:18 | → | darkstardevx joins (~darkstard@50.126.124.156) |
| 19:36:36 | → | titibandit joins (~titibandi@xdsl-87-79-250-160.nc.de) |
| 19:36:39 | × | Guest7596 quits (~Guest75@178.141.197.193) (Ping timeout: 244 seconds) |
| 19:37:37 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds) |
| 19:37:41 | × | Nolrai quits (~Nolrai@c-67-171-154-216.hsd1.or.comcast.net) (Ping timeout: 244 seconds) |
| 19:37:57 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 19:40:11 | × | titibandit quits (~titibandi@xdsl-87-79-250-160.nc.de) (Client Quit) |
| 19:40:38 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 19:41:27 | → | tzh_ joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 19:42:14 | ski | . o O ( "Objects of Categories as Complex Numbers" by Marcelo Fiore,Tom Leinster in 2002-12-30 at <https://arxiv.org/abs/math/0212377> ; <https://golem.ph.utexas.edu/category/2009/07/searching_for_a_video_proof_of.html> ; "This Week's Finds in Mathematical Physics (Week 202)" by John Baez in 2004-02-21 at <https://math.ucr.edu/home/baez/week202.html> ; "Seven Trees in One" by Andreas Blass in 1995 |
| 19:42:20 | ski | at <https://dept.math.lsa.umich.edu/~ablass/cat.html> ) |
| 19:44:13 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Ping timeout: 252 seconds) |
| 19:48:06 | × | king_gs quits (~Thunderbi@2806:103e:29:47b9:f34b:ffff:4cfc:90a6) (Ping timeout: 268 seconds) |
| 19:50:39 | × | mjs2600 quits (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) (Quit: ZNC 1.8.2 - https://znc.in) |
| 19:50:40 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 19:52:15 | → | mjs2600 joins (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) |
| 19:55:29 | → | Tuplanolla joins (~Tuplanoll@91-159-69-11.elisa-laajakaista.fi) |
| 20:10:57 | <chromoblob> | is there a ready made program for computing seven trees from one, i'd take a look |
| 20:12:14 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:c9d:1a05:4084:603c) |
| 20:15:48 | × | ddellacosta quits (~ddellacos@143.244.47.76) (Ping timeout: 248 seconds) |
| 20:16:45 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:c9d:1a05:4084:603c) (Ping timeout: 255 seconds) |
| 20:17:53 | <EvanR> | :t \x -> (x,x,x,x,x,x,x) -- xD |
| 20:17:54 | <lambdabot> | g -> (g, g, g, g, g, g, g) |
| 20:18:57 | <geekosaur> | what? |
| 20:19:02 | <geekosaur> | oh |
| 20:19:10 | <geekosaur> | I think it wasn't meant that way |
| 20:21:33 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 20:21:33 | <geekosaur> | but I'm not going to try to read it because "cat" suggests to me some CT thing being involved with how one tree can represent 7 |
| 20:26:39 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 255 seconds) |
| 20:28:15 | <chromoblob> | okay the program is here http://blog.sigfpe.com/2007/09/arboreal-isomorphisms-from-nuclear.html |
| 20:28:32 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 20:30:15 | <ski> | it's a (non-recursively defined) bijection between `Tree' and `(Tree,Tree,Tree,Tree,Tree,Tree,Tree)', where `data Tree = Tip | Branch Tree Tree' |
| 20:30:47 | <yin> | what's the advantage of using Word8 over Word (besides range) ? |
| 20:30:48 | <EvanR> | T = 1 + T^2, has a solution 0.5 + 0.866i, which is sixth root of 1, i.e. 1 = T^6 |
| 20:31:03 | <EvanR> | or T = T^7 |
| 20:32:37 | <EvanR> | it has the feel of some bogus thing someone in high school math would try to pull on the teacher xD |
| 20:33:02 | <EvanR> | (to prove that 1 tree = 7 trees) |
| 20:34:15 | × | michalz quits (~michalz@185.246.207.221) (Remote host closed the connection) |
| 20:35:04 | <dolio> | Well, it's not particularly surprising than an infinite set is isomorphic to its own 7-fold product. The particular example is more involved than just that, though. |
| 20:38:44 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 20:40:12 | × | ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 258 seconds) |
| 20:40:14 | × | mmhat quits (~mmh@p200300f1c730765eee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 276 seconds) |
| 20:40:56 | × | sadmax` quits (~user@209.205.174.253) (Remote host closed the connection) |
| 20:40:59 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 20:41:28 | <tomsmeding> | while the fact that T is set-isomorphic to T^7 is not very surprising, it would be _very_ surprising if 1 = T^6 |
| 20:41:42 | <tomsmeding> | not just surprising, clearly false |
| 20:42:06 | <tomsmeding> | EvanR: so I fear there is some part of your deduction that doesn't follow ;) |
| 20:43:04 | <EvanR> | yeah don't worry about the 1 = T^6 |
| 20:43:38 | <EvanR> | the paper explains why it's ok that makes no sense for types but it does for complex numbers |
| 20:44:07 | <dolio> | The point is that when 1 = T^6 holds for e.g. complex numbers, T = T^7 holds in a more general class of rings. |
| 20:44:37 | <dolio> | When you interpret T into both. |
| 20:46:17 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds) |
| 20:48:44 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 246 seconds) |
| 20:51:02 | × | mokee quits (~mokee@37.228.215.235) (Remote host closed the connection) |
| 20:53:02 | → | mmhat joins (~mmh@p200300f1c7307603ee086bfffe095315.dip0.t-ipconnect.de) |
| 20:56:43 | <monochrom> | False statements are extremely surprising, in information theory. >:) |
| 20:58:41 | → | caryhartline joins (~caryhartl@2600:1700:2d0:8d30:8d35:fb39:2b22:5607) |
| 21:03:21 | → | titibandit joins (~titibandi@xdsl-87-79-250-160.nc.de) |
| 21:05:19 | × | ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
| 21:05:42 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 21:09:07 | × | rburkholder quits (~blurb@96.45.2.121) (Quit: Leaving) |
| 21:09:28 | → | rburkholder joins (~blurb@96.45.2.121) |
| 21:11:50 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds) |
| 21:13:49 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 21:17:52 | <darkling> | ... true or false? ;) |
| 21:18:06 | <EvanR> | or file not found |
| 21:18:37 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 21:19:28 | <darkling> | It's a little-known fact that George Boole was an amateur carpenter, but kept forgetting where he put his tools. |
| 21:19:50 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 21:19:53 | <monochrom> | He needs more bits for his memory. >:) |
| 21:21:03 | → | jmdaemon joins (~jmdaemon@user/jmdaemon) |
| 21:21:15 | × | Everything quits (~Everythin@37.115.210.35) (Quit: leaving) |
| 21:31:20 | <hpc> | he needed more bits for his drill too |
| 21:31:37 | <monochrom> | haha |
| 21:34:21 | <darkling> | Well played. |
| 21:34:49 | × | titibandit quits (~titibandi@xdsl-87-79-250-160.nc.de) (Remote host closed the connection) |
| 21:37:51 | → | darkstarx joins (~darkstard@50.126.124.156) |
| 21:40:16 | × | darkstardevx quits (~darkstard@50.126.124.156) (Ping timeout: 252 seconds) |
| 21:41:40 | × | vglfr quits (~vglfr@145.224.100.22) (Ping timeout: 248 seconds) |
| 21:42:15 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Ping timeout: 255 seconds) |
| 21:46:10 | → | vglfr joins (~vglfr@145.224.100.22) |
| 21:49:58 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 21:51:24 | → | emad joins (~emad@156.214.225.151) |
| 21:52:18 | <koz> | I'm a bit confused about the free Applicative. Specifically, suppose I wanted to define an equivalent to Reader with it. |
| 21:52:35 | <koz> | I have no idea how to give it the capability to do (the equivalent of) `local`. |
| 21:54:03 | × | emad quits (~emad@156.214.225.151) (Client Quit) |
| 21:55:03 | × | lagash quits (lagash@lagash.shelltalk.net) (Quit: ZNC - https://znc.in) |
| 21:55:15 | → | lagash joins (lagash@lagash.shelltalk.net) |
| 21:56:16 | × | dcoutts quits (~duncan@host86-163-164-210.range86-163.btcentralplus.com) (Ping timeout: 255 seconds) |
| 21:58:00 | × | thonkpod_ quits (~thonkpod@user/thonkpod) (Ping timeout: 255 seconds) |
| 21:59:02 | → | thonkpod_ joins (~thonkpod@user/thonkpod) |
| 21:59:23 | → | Guest71 joins (~Guest71@78-68-106-126-no2000.tbcn.telia.com) |
| 21:59:50 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 21:59:53 | × | Guest71 quits (~Guest71@78-68-106-126-no2000.tbcn.telia.com) (Client Quit) |
| 22:00:03 | → | Guest71 joins (~Guest71@78-68-106-126-no2000.tbcn.telia.com) |
| 22:00:34 | → | talismanick joins (~talismani@c-73-41-86-39.hsd1.ca.comcast.net) |
| 22:03:31 | → | zmt01 joins (~zmt00@user/zmt00) |
| 22:04:28 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 22:04:53 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 22:05:06 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 22:07:36 | × | zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 250 seconds) |
| 22:08:05 | → | thegeekinside joins (~thegeekin@189.180.115.115) |
| 22:09:43 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 22:14:01 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:c9d:1a05:4084:603c) |
| 22:14:49 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 22:14:55 | × | Midjak2 quits (~Midjak@82.66.147.146) (Quit: Leaving) |
| 22:15:32 | → | Midjak joins (~Midjak@82.66.147.146) |
| 22:15:36 | → | Midjak2 joins (~Midjak@82.66.147.146) |
| 22:15:54 | × | acidjnk quits (~acidjnk@p200300d6e7137a36f0ab6f680c2cefbd.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
| 22:16:00 | × | Midjak2 quits (~Midjak@82.66.147.146) (Client Quit) |
| 22:16:00 | × | Midjak quits (~Midjak@82.66.147.146) (Client Quit) |
| 22:17:29 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 22:17:56 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds) |
| 22:18:23 | jinsun | is now known as Guest9966 |
| 22:18:23 | → | jinsun__ joins (~jinsun@user/jinsun) |
| 22:18:23 | × | Guest9966 quits (~jinsun@user/jinsun) (Killed (sodium.libera.chat (Nickname regained by services))) |
| 22:18:23 | jinsun__ | is now known as jinsun |
| 22:18:42 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:c9d:1a05:4084:603c) (Ping timeout: 255 seconds) |
| 22:19:33 | × | hueso quits (~root@user/hueso) (Ping timeout: 272 seconds) |
| 22:19:59 | → | hueso joins (~root@user/hueso) |
| 22:23:14 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds) |
| 22:26:21 | × | aliosablack quits (~chomwitt@2a02:587:dc18:4a00:1ac0:4dff:fedb:a3f1) (Ping timeout: 255 seconds) |
| 22:36:04 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 22:36:07 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 22:40:46 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds) |
| 22:42:18 | <talismanick> | I'm translating the example (SML?) code from the Wikipedia page on Normalization by Evaluation, and ran into a snag midway through: it generates fresh (unique) variable IDs while mutual recursing |
| 22:42:57 | <talismanick> | newUnique's type is IO Unique, so I need to somehow thread unique values through it |
| 22:43:39 | <ski> | pass in an infinite list of unique values ? |
| 22:43:52 | <talismanick> | I have a few options: pass them as arguments explicitly, lift the computation into a free monad, or think really hard and unroll the mutual recursion |
| 22:44:16 | <ski> | (possibly state-threading, if you have more than one recursive call (in the same branch)) |
| 22:44:21 | <monochrom> | The minimum requirement is a state monad. |
| 22:44:39 | <monochrom> | Use the state to help you generate fresh IDs. |
| 22:44:43 | <ski> | (well, possibly you could use a split operation, as well) |
| 22:44:49 | <talismanick> | ski: Hm, yeah, that's a bit more elegant |
| 22:45:10 | <talismanick> | (than the first option of just prepending `Unique ->` to the signature) |
| 22:45:55 | <monochrom> | OK, mine is just one of the two minimums. The other is a reader monad plus a split operation. :) |
| 22:46:32 | <talismanick> | It does mean it's up to the caller to build a "correct" (infinite) list, but it's a small price in clarity otherwise |
| 22:47:24 | <talismanick> | just `forM_ (newUnique <$ [1..]) $ <normalize by evaluation, blah blah>` |
| 22:47:36 | <talismanick> | wait, that's not right, but you get the idea... |
| 22:48:17 | × | gabriel_sevecek quits (~gabriel@188-167-229-200.dynamic.chello.sk) (Quit: WeeChat 3.7) |
| 22:48:25 | <koz> | Anyone able to assist me with my free-Applicative-based definition of Reader with local? |
| 22:48:32 | <koz> | I genuinely have no idea how to write such a thing. |
| 22:48:56 | → | gabriel_sevecek joins (~gabriel@188-167-229-200.dynamic.chello.sk) |
| 22:49:52 | × | johnw quits (~johnw@2600:1700:cf00:db0:6c87:b668:9831:2008) (Quit: ZNC - http://znc.in) |
| 22:50:52 | <koz> | Essentially, I need to figure out the f so I can write 'newtype MyReader a = MyReader (Ap f a)', so I can define 'local' on it. |
| 22:51:25 | <koz> | The bit that confuses me is that, unlike 'ask', local takes an already-defined computation, so I have no idea if that needs to be in 'f' somehow. |
| 22:54:01 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 22:54:57 | <geekosaur> | isn't f irrelevant to local? it cares only about the a |
| 22:55:24 | <geekosaur> | and we know because Functor f => Applicative f that f doesn't matter there |
| 22:55:27 | <koz> | geekosaur: How would you define 'local' then? |
| 22:55:42 | <koz> | This is the part I'm not getting here. |
| 22:58:35 | <koz> | I believe that 'f' needs to be something like 'ReaderF r a where Ask :: ReaderF r r' |
| 23:01:23 | × | redmp quits (~redmp@mobile-166-170-43-64.mycingular.net) (Ping timeout: 246 seconds) |
| 23:01:45 | <geekosaur> | I'm not great at free <whatever>, sadly |
| 23:01:56 | <koz> | Yeah, me neither, which is why I'm asking. |
| 23:02:14 | <koz> | Because I never quite got how stuff like 'local' works here. |
| 23:02:33 | <koz> | I get operations like 'ask' or 'get' or 'put', since those don't modify computations. |
| 23:02:44 | <koz> | (or rather, they don't take a computation as an argument) |
| 23:03:29 | → | redmp joins (~redmp@mobile-166-170-43-64.mycingular.net) |
| 23:03:36 | <geekosaur> | unwrap the computation, apply the passed function to the environment, evaluate the passed action, produce its result |
| 23:04:10 | <koz> | Wouldn't this require `local` to be given an interpreter function? |
| 23:04:26 | <koz> | That kind of defeats the entire purpose. |
| 23:04:46 | <geekosaur> | no, because you're modifying the computation itself, it being free |
| 23:05:02 | <koz> | Maybe I'm just slow, but I don't get it at all. |
| 23:05:37 | <geekosaur> | mm, I'm sort of seeing it but I'd need to see some types to be certain |
| 23:05:43 | <koz> | OK, let me sketch. |
| 23:08:34 | <koz> | https://gist.github.com/kozross/7bcc45d37347d8c7c253713937e55771 |
| 23:16:37 | <ski> | (remind me how `Ap' is defined ?) |
| 23:18:41 | <koz> | ski: https://hackage.haskell.org/package/free-5.1.9/docs/Control-Applicative-Free.html |
| 23:18:56 | <ski> | data Ap f a = Pure a | forall b. Ap (f b) (Ap f (b -> a))', ok |
| 23:23:51 | <[Leary]> | koz: I'm not well read or practised in this area, but the issue could be that `local` is not an "algebraic effect". I've seen an extension to free monads that allows "scoped effects" and could support it, but I don't know of an equivalent for free applicative. |
| 23:23:59 | × | ajb_ quits (~ajb@mimas.whatbox.ca) (Quit: bye) |
| 23:24:03 | <[Leary]> | This is the blind leading the blind, but perhaps I've given you some new search terms. |
| 23:25:42 | <koz> | [Leary]: I mean... that seems _awfully_ strange, considering that Reader is about as algebraic as it gets, and `local` is a capability every single algebraic effect library built on _monads_ offers AFAICT. |
| 23:25:54 | <koz> | It might be true, but it'd be very odd to me if it were. |
| 23:26:45 | → | ajb joins (~ajb@mimas.whatbox.ca) |
| 23:27:00 | <ski> | local f (Reader ia) = Reader (loop ia) |
| 23:27:03 | <ski> | where |
| 23:27:13 | <ski> | loop (Pure a) = Pure a |
| 23:27:17 | <ski> | loop (Ap Ask ira) = Ap Ask ((. f) <$> loop ira) |
| 23:27:21 | <ski> | something like this, possibly ? |
| 23:28:03 | <ski> | (may need an explicit signature on `loop', for polymorphic recursion .. and then would need `ScopedTypeVariables' for `local', as well) |
| 23:29:00 | <ski> | .. there's probably also a way to avoid the repeated `(<$>)'s |
| 23:29:14 | <koz> | Ah so that's how. |
| 23:29:34 | <koz> | So you'd have to disassemble the actual representation. |
| 23:29:39 | × | ajb quits (~ajb@mimas.whatbox.ca) (Client Quit) |
| 23:29:53 | → | ajb joins (~ajb@mimas.whatbox.ca) |
| 23:30:22 | <ski> | perhaps if you `Codensity' that, you may be able to batch the traversals or something ... hm |
| 23:31:36 | <ski> | (i guess in some sense, `local' is admissible, but not derivable ? is that a sensible thing to say ?) |
| 23:32:50 | × | ajb quits (~ajb@mimas.whatbox.ca) (Client Quit) |
| 23:34:50 | × | Guest71 quits (~Guest71@78-68-106-126-no2000.tbcn.telia.com) (Ping timeout: 244 seconds) |
| 23:34:55 | × | ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
| 23:35:05 | → | ajb joins (~ajb@mimas.whatbox.ca) |
| 23:35:30 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 23:36:26 | <koz> | ski: If you use the final encoding you probably can. |
| 23:36:39 | <koz> | Since that is https://hackage.haskell.org/package/free-5.1.9/docs/Control-Applicative-Free-Final.html |
| 23:36:45 | <koz> | And your method should translate. |
| 23:37:59 | × | ajb quits (~ajb@mimas.whatbox.ca) (Client Quit) |
| 23:39:50 | → | ajb joins (~ajb@mimas.whatbox.ca) |
| 23:42:44 | × | ajb quits (~ajb@mimas.whatbox.ca) (Client Quit) |
| 23:42:55 | → | ajb joins (~ajb@mimas.whatbox.ca) |
| 23:45:06 | <monochrom> | Oh ha, I am finally experiencing GHC 9.2 reminding me "don't define return". :) |
| 23:45:53 | → | Guest71 joins (~Guest71@94.234.103.245) |
| 23:46:03 | <monochrom> | Ah, "return = pure" is the preferred way. |
| 23:47:34 | × | ajb quits (~ajb@mimas.whatbox.ca) (Client Quit) |
| 23:49:07 | × | adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection) |
| 23:49:25 | → | adanwan joins (~adanwan@gateway/tor-sasl/adanwan) |
| 23:50:54 | <jackdk> | monochrom: `return = pure` is the default definition in recent base, btw |
| 23:51:57 | → | mvk joins (~mvk@2607:fea8:5ce3:8500::f30b) |
| 23:52:11 | × | caryhartline quits (~caryhartl@2600:1700:2d0:8d30:8d35:fb39:2b22:5607) (Quit: caryhartline) |
| 23:55:34 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds) |
| 23:59:28 | × | mmhat quits (~mmh@p200300f1c7307603ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1) |
All times are in UTC on 2022-10-31.