2024/05/16

Newest at the top

2024-05-16 17:42:22 +0200 <lambdabot> Defined.
2024-05-16 17:42:21 +0200 <ski> @let tabulate :: Ix i => (i,i) -> (i -> e) -> Array i e; tabulate ix f = listArray ix [f i | i <- range ix]
2024-05-16 17:41:02 +0200 <ski> `rec' is for something else (recursive bindings in `do')
2024-05-16 17:40:41 +0200 <ski> there is no state, adding to the map, unless you express this with state in some fashion .. and it's probably better to avoid that, if you can
2024-05-16 17:38:50 +0200 <Guest13> I've seen the rec keyword but this is also something I am unsure about
2024-05-16 17:38:24 +0200 <Guest13> ie adds to the map, or checks the map
2024-05-16 17:38:01 +0200 <Guest13> I can't think about it functionally very well, I am thinking that each time it does a call it updates an internal "state"
2024-05-16 17:37:26 +0200 <Guest13> I understand to use a map but I don't know how I would implement it
2024-05-16 17:36:42 +0200zzz(~yin@user/zero)
2024-05-16 17:33:37 +0200 <ski> .. but if your domain is large, the map would also be large. sometimes you can allocate the association structure itself, lazily, incrementally (like the infinite linked list above)
2024-05-16 17:32:32 +0200 <ski> anyway, if you already know from the start (perhaps from the initial parameters) how large domain you need for the recursive calls corresponding to subproblems of that initial problem, you can allocate a map (recursively defined) that has an association mapping each element of your domain to the corresponding result value (lazily computed)
2024-05-16 17:30:46 +0200 <ski> (oh, and jfyi, that `memo_fib' still uses `fib' (but not `memo_fib') for each individual call, so not reusing the list resulting from the `map' as a cache)
2024-05-16 17:29:08 +0200 <ski> .. or how large is your domain ?
2024-05-16 17:28:48 +0200 <ski> so use a map ?
2024-05-16 17:24:21 +0200 <Guest13> it is the sort of problem where I would want to have a map to store previous calls
2024-05-16 17:23:23 +0200 <Guest13> hi, how can I memoize recursive calls that aren't simple like the fibonacci. I see on the wiki for memoization there is an example memo_fib= (map fib [1..] !!), but the problem I am trying to solve has the recursive calls in an order I don't necessarily know
2024-05-16 17:21:36 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 255 seconds)
2024-05-16 17:18:48 +0200califax(~califax@user/califx)
2024-05-16 17:18:33 +0200neiluj(~neiluj@193.203.71.162)
2024-05-16 17:18:28 +0200Square2(~Square4@user/square) (Ping timeout: 260 seconds)
2024-05-16 17:15:01 +0200califax(~califax@user/califx) (Remote host closed the connection)
2024-05-16 17:14:18 +0200chele(~chele@user/chele) (Remote host closed the connection)
2024-05-16 17:10:16 +0200califax(~califax@user/califx)
2024-05-16 17:08:23 +0200califax(~califax@user/califx) (Remote host closed the connection)
2024-05-16 17:05:25 +0200zzz(~yin@user/zero) (Ping timeout: 255 seconds)
2024-05-16 17:04:30 +0200Guest13(~Guest13@cpc93370-hers8-2-0-cust590.6-3.cable.virginm.net)
2024-05-16 17:03:23 +0200ocra8(ocra8@user/ocra8)
2024-05-16 17:02:33 +0200neiluj(~neiluj@193.203.71.162) (Ping timeout: 256 seconds)
2024-05-16 16:56:41 +0200Square2(~Square4@user/square)
2024-05-16 16:51:52 +0200califax(~califax@user/califx)
2024-05-16 16:51:27 +0200random-jellyfish(~developer@user/random-jellyfish)
2024-05-16 16:51:27 +0200random-jellyfish(~developer@2a02:2f04:11e:c600:4e7a:622:23f0:da46) (Changing host)
2024-05-16 16:51:27 +0200random-jellyfish(~developer@2a02:2f04:11e:c600:4e7a:622:23f0:da46)
2024-05-16 16:49:51 +0200califax(~califax@user/califx) (Remote host closed the connection)
2024-05-16 16:48:17 +0200califax(~califax@user/califx)
2024-05-16 16:47:18 +0200Square2(~Square4@user/square) (Ping timeout: 256 seconds)
2024-05-16 16:43:45 +0200califax(~califax@user/califx) (Remote host closed the connection)
2024-05-16 16:41:00 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
2024-05-16 16:38:56 +0200billchenchina(~billchenc@103.152.35.21)
2024-05-16 16:38:47 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Read error: Connection reset by peer)
2024-05-16 16:38:14 +0200billchenchina(~billchenc@103.152.35.21) (Remote host closed the connection)
2024-05-16 16:35:06 +0200raehik(~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net)
2024-05-16 16:31:08 +0200califax(~califax@user/califx)
2024-05-16 16:29:55 +0200neiluj(~neiluj@193.203.71.162)
2024-05-16 16:26:49 +0200califax(~califax@user/califx) (Remote host closed the connection)
2024-05-16 16:25:18 +0200billchenchina(~billchenc@103.152.35.21)
2024-05-16 16:24:54 +0200billchenchina(~billchenc@2a0d:2580:ff0c:1:e3c9:c52b:a429:5bfe) (Max SendQ exceeded)
2024-05-16 16:24:12 +0200billchenchina(~billchenc@2a0d:2580:ff0c:1:e3c9:c52b:a429:5bfe)
2024-05-16 16:23:44 +0200billchenchina-(~billchenc@103.152.35.21) (Remote host closed the connection)
2024-05-16 16:17:35 +0200EvanR(~EvanR@user/evanr)