Newest at the top
2024-05-18 20:05:26 +0200 | <ncf> | (0, 2) in your `a` |
2024-05-18 20:05:12 +0200 | <ncf> | first and last index |
2024-05-18 20:05:00 +0200 | <justsomeguy> | What is a bounds? |
2024-05-18 20:04:43 +0200 | <justsomeguy> | (an IArray, sorry) |
2024-05-18 20:04:34 +0200 | <justsomeguy> | and the last argument is an Array. |
2024-05-18 20:04:24 +0200 | <justsomeguy> | And they you provide a unary function to manipulate each index. |
2024-05-18 20:04:08 +0200 | <justsomeguy> | So, the first argument is a range of indices supplied as a tulpe, right? |
2024-05-18 20:03:20 +0200 | <justsomeguy> | I'm 100% lost. |
2024-05-18 19:59:12 +0200 | <ncf> | so if you want to apply some transformation f to the indices, you need to apply f to the bounds and give f⁻¹ as the mapping |
2024-05-18 19:59:01 +0200 | <aryah> | hahah, yeah, well it was a bad accident with my credentials overall tbh. |
2024-05-18 19:58:34 +0200 | <ncf> | the function creates an array with the given bounds, then applies the function to each *new* index to get the element corresponding to that index from the old array |
2024-05-18 19:58:05 +0200 | <geekosaur> | I use a password manager to keep track of such things 🙂 |
2024-05-18 19:57:39 +0200 | <aryah> | yeah, prob, I didn't want to need to dig up my github acc... |
2024-05-18 19:57:18 +0200 | <mauke> | justsomeguy: ah, then what ncf said |
2024-05-18 19:57:02 +0200 | <geekosaur> | aryah, that might best be posted to the proposal issue? |
2024-05-18 19:57:00 +0200 | <ncf> | justsomeguy: read the type carefully |
2024-05-18 19:56:50 +0200 | <aryah> | soo, which is it? I guess the latter, but the text should surely be consistent before acceptence. |
2024-05-18 19:56:37 +0200 | <ncf> | well i guess your Iso would need to be well-behaved |
2024-05-18 19:56:36 +0200 | <justsomeguy> | I was expecting to use ixmap (0,2) (+1) a to create a new Array like array (1,3) [(1,'a'),(2,'b'),(3,'c')]. But honestly I'm not sure what ixmap does and I'm just trying to go through each function in IArray and try them out on sample inputs. |
2024-05-18 19:56:09 +0200 | <ncf> | apply it backwards to the bounds to determine the new bounds, then forwards to get the elements |
2024-05-18 19:55:56 +0200 | <aryah> | there's a contradiction in the 'extensions lifecycle' proposal (601). explaining experimental, it says "an Experimental extension must be Deprecated prior to removal", but then they recently expanded the section "transitions that are possible but left at the discretion of implementers..." with Experimental -> (does not exist) |
2024-05-18 19:55:49 +0200 | <ncf> | surprised there isn't a lens combinator that takes an Iso |
2024-05-18 19:54:20 +0200 | y04nn | (~username@45.129.56.202) |
2024-05-18 19:54:18 +0200 | <mauke> | justsomeguy: what do you mean by "map (+1) to each index"? |
2024-05-18 19:54:09 +0200 | <ncf> | "what bounds do you want", "how do you get back to the old indices" |
2024-05-18 19:53:53 +0200 | <lambdabot> | (Ix i, Ix j) => (i, i) -> (i -> j) -> Array j e -> Array i e |
2024-05-18 19:53:52 +0200 | <ncf> | :t ixmap |
2024-05-18 19:53:22 +0200 | <ncf> | ixmap (1, 3) (subtract 1) a |
2024-05-18 19:53:20 +0200 | <glguy> | subtract 1 |
2024-05-18 19:53:18 +0200 | <glguy> | subtrace 1 |
2024-05-18 19:53:17 +0200 | <glguy> | otherway |
2024-05-18 19:53:14 +0200 | <ncf> | nope |
2024-05-18 19:53:05 +0200 | <glguy> | that is tricky |
2024-05-18 19:52:55 +0200 | <glguy> | ixmap (1,3) (+1) a |
2024-05-18 19:52:53 +0200 | aryah | (~aryah@52-123.dsl.iskon.hr) |
2024-05-18 19:52:50 +0200 | <glguy> | oh, I guess you'd want: |
2024-05-18 19:52:37 +0200 | <glguy> | ixmap (0,2) (+1) a |
2024-05-18 19:52:19 +0200 | <justsomeguy> | I have an array a = array (0,2) [(0,'a'),(1,'b'),(2,'c')] :: Array Int Char and am trying to map (+1) to each index in the array. |
2024-05-18 19:50:58 +0200 | <justsomeguy> | How do I use the Data.Array.IArray.ixmap function? I don't see any examples in the documentation. |
2024-05-18 19:50:11 +0200 | justsomeguy | (~justsomeg@user/justsomeguy) |
2024-05-18 19:45:44 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-05-18 19:42:15 +0200 | visilii_ | visilii |
2024-05-18 19:37:47 +0200 | mikess | (~mikess@user/mikess) |
2024-05-18 19:35:29 +0200 | Sgeo | (~Sgeo@user/sgeo) |
2024-05-18 19:31:06 +0200 | euleritian | (~euleritia@dynamic-176-006-188-140.176.6.pool.telefonica.de) |
2024-05-18 19:26:53 +0200 | euleritian | (~euleritia@p200300d40f4af80011ef9d47c01a966a.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
2024-05-18 19:26:30 +0200 | Square | (~Square@user/square) |
2024-05-18 19:21:17 +0200 | ph88 | (~ph88@2a02:8109:9e26:c800:6411:ca4c:6107:b01c) (Ping timeout: 240 seconds) |
2024-05-18 19:20:58 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-05-18 19:19:26 +0200 | joeyadams | (~joeyadams@2603:6010:5100:2ed:b273:9497:4ffe:5456) (Quit: Leaving) |