Logs: freenode/#haskell
| 2020-10-05 15:23:00 | × | zacts quits (~zacts@dragora/developer/zacts) (Client Quit) |
| 2020-10-05 15:23:15 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-10-05 15:23:18 | <fog23> | pointers!? |
| 2020-10-05 15:23:40 | <fog23> | Tree = Free Nonempty |
| 2020-10-05 15:23:44 | <fog23> | thats pretty easy |
| 2020-10-05 15:23:45 | <dolio> | Doubly-linked stuff usually only works out well with pointers. |
| 2020-10-05 15:23:56 | <fog23> | rrg |
| 2020-10-05 15:24:01 | <fog23> | i dont understand |
| 2020-10-05 15:24:08 | <fog23> | where are the pointers in the regular tree? |
| 2020-10-05 15:24:11 | → | zacts joins (~zacts@dragora/developer/zacts) |
| 2020-10-05 15:24:16 | <fog23> | the lower branches? |
| 2020-10-05 15:24:17 | → | knupfer joins (~Thunderbi@87.123.206.236) |
| 2020-10-05 15:24:19 | <dolio> | Yes. |
| 2020-10-05 15:24:25 | <fog23> | why are you calling them pointers? |
| 2020-10-05 15:25:00 | <fog23> | DBLTree = Free (\a -> Nonempty a, Nonempty a) |
| 2020-10-05 15:25:01 | <fog23> | ? |
| 2020-10-05 15:25:08 | <fog23> | erm |
| 2020-10-05 15:25:18 | <fog23> | DBLTree = Free (\a -> (Nonempty a, Nonempty a) ) |
| 2020-10-05 15:25:35 | <fog23> | thats like, branches below and branches above |
| 2020-10-05 15:25:46 | <fog23> | oh, i guess it would be just *a* branch above |
| 2020-10-05 15:26:01 | <fog23> | DBLTree = Free (\a -> (a, Nonempty a) ) |
| 2020-10-05 15:26:33 | <sm[m]> | I use a doubly linked tree, using laziness to tie the knot |
| 2020-10-05 15:26:37 | <fog23> | (that `a' is going to be replaced by DBLTree a by Free) |
| 2020-10-05 15:26:55 | <fog23> | sm[m] can you paste that? |
| 2020-10-05 15:27:06 | <sm[m]> | (not a literal tree but a tree-shaped set of ADTs) |
| 2020-10-05 15:27:37 | × | kritzefitz quits (~kritzefit@fw-front.credativ.com) (Remote host closed the connection) |
| 2020-10-05 15:27:43 | <fog23> | but is that DBLTree written using Free correct? |
| 2020-10-05 15:28:54 | <fog23> | oh right, there is nothing intrinsicly built into the "data" syntax that allows the upper refference to be passed into the reference below |
| 2020-10-05 15:29:04 | <fog23> | might be a pretty cool functional language that could do that! |
| 2020-10-05 15:29:33 | × | GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie) |
| 2020-10-05 15:29:50 | <fog23> | i cnt get my head round how to do the several upwards pointing branches |
| 2020-10-05 15:29:51 | → | GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) |
| 2020-10-05 15:29:51 | × | GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host) |
| 2020-10-05 15:29:51 | → | GyroW joins (~GyroW@unaffiliated/gyrow) |
| 2020-10-05 15:29:58 | × | sethetter__ quits (sid17895@gateway/web/irccloud.com/x-igokhppslfuoizhb) (Quit: Updating details, brb) |
| 2020-10-05 15:30:12 | → | sethetter joins (sid17895@gateway/web/irccloud.com/x-dfvcqfcbhnjlhxfv) |
| 2020-10-05 15:30:20 | <sm[m]> | fog23: https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Data/Account.hs#L93 is one place |
| 2020-10-05 15:31:12 | <fog23> | i guess, the lower branches are like, by default "tree shaped" and there is no ambiguity - but just putting the extra list of beanches, where these are *supposed* to refer upwards - is not actually something thats built in using the GADT syntax |
| 2020-10-05 15:31:27 | <fog23> | so it kind of feels, incomplete |
| 2020-10-05 15:32:28 | ← | sethetter parts (sid17895@gateway/web/irccloud.com/x-dfvcqfcbhnjlhxfv) () |
| 2020-10-05 15:33:28 | <fog23> | sm[m] ah, so there is nothing intrinsic about the record that makes it a parent until you use that knot tying function |
| 2020-10-05 15:33:38 | <fog23> | i guess thats what makes it "complete" |
| 2020-10-05 15:34:05 | <fog23> | but this feels so clumsy, like, that the GADT is only actually specified correctly based on the function that ties the knot |
| 2020-10-05 15:34:29 | <fog23> | while, if there is no knot tying, then the lower branches are exactly that, just by construction |
| 2020-10-05 15:35:37 | <fog23> | well, i guess that means Free (\a -> (Nonempty a,Nonempty a)) *is* a valid way to do the "upwards branches" |
| 2020-10-05 15:35:46 | <fog23> | and i just need to do the knot typing function for it |
| 2020-10-05 15:36:17 | <fog23> | so how does this work, you pass in Nothing... and then... |
| 2020-10-05 15:36:56 | <fog23> | that acts as the parent of the top node |
| 2020-10-05 15:37:15 | <fog23> | and then it recurses, and has a node above to pass in for all the lower branches, that seems easy enough |
| 2020-10-05 15:37:35 | <fog23> | i guess it becomes more difficult when there is this, having to tie various different upper nodes |
| 2020-10-05 15:37:52 | <fog23> | there would have to be some way of directing which upper nodes were supposed to be referenced |
| 2020-10-05 15:37:54 | <sm[m]> | fog23: good question.. this seems to accept a tree of Account, and recurses through tying the knot for each one to its parent |
| 2020-10-05 15:38:07 | <sm[m]> | https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Data/Transaction.hs#L563 is a simpler example |
| 2020-10-05 15:38:51 | → | thir joins (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) |
| 2020-10-05 15:39:25 | × | chaosmasttter quits (~chaosmast@p200300c4a73b2e0100f3c5a701cd6e56.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 2020-10-05 15:39:58 | <fog23> | sm[m]: i dont see a recursive call to txnTieKnot, so im guessing its not a tree, or recursive datatype |
| 2020-10-05 15:40:08 | → | jiribenes_ joins (~jiribenes@rosa.jiribenes.com) |
| 2020-10-05 15:40:09 | × | gambpang quits (~gambpang@unaffiliated/gambpang) (Quit: ZNC 1.6.3+deb1+xenial0 - http://znc.in) |
| 2020-10-05 15:40:09 | × | wraithm_ quits (~wraithm@unaffiliated/wraithm) (Quit: ZNC 1.6.3+deb1+xenial0 - http://znc.in) |
| 2020-10-05 15:40:24 | <fog23> | ah, right, so its to do with "descending" into the tree, by recursive calls |
| 2020-10-05 15:40:32 | <sm[m]> | right, txnTieKnot just ties the knot for the postings of a single transaction |
| 2020-10-05 15:40:36 | <fog23> | then you always have the current node to pass in for the upper reference |
| 2020-10-05 15:41:01 | jiribenes | is now known as Guest77330 |
| 2020-10-05 15:41:01 | × | Guest77330 quits (jbjiribene@gateway/shell/matrix.org/x-vhnsqdmfgjajakfv) (Killed (egan.freenode.net (Nickname regained by services))) |
| 2020-10-05 15:41:01 | jiribenes_ | is now known as jiribenes |
| 2020-10-05 15:41:03 | <fog23> | so that typing many knots would be more difficult, since you cant just use the current position |
| 2020-10-05 15:41:08 | → | Guest77330 joins (jbjiribene@gateway/shell/matrix.org/x-klbutzrslfjoiooq) |
| 2020-10-05 15:41:08 | <fog23> | typing* |
| 2020-10-05 15:41:08 | <sm[m]> | data types: https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Data/Types.hs#L490, https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Data/Types.hs#L332 |
| 2020-10-05 15:41:14 | → | gambpang joins (~gambpang@unaffiliated/gambpang) |
| 2020-10-05 15:41:48 | ← | invaser parts (~Thunderbi@31.148.23.125) () |
| 2020-10-05 15:41:55 | × | gambpang quits (~gambpang@unaffiliated/gambpang) (Client Quit) |
| 2020-10-05 15:42:26 | <fog23> | ah, ok, so Account contains reference to [Account] as one of its records, but Transaction has no reference to Transaction at all, so its not a recursive datatype |
| 2020-10-05 15:42:40 | × | jiribenes quits (~jiribenes@rosa.jiribenes.com) (Client Quit) |
| 2020-10-05 15:42:41 | → | gambpang joins (~gambpang@unaffiliated/gambpang) |
| 2020-10-05 15:42:56 | × | thir quits (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) (Ping timeout: 244 seconds) |
| 2020-10-05 15:43:05 | <fog23> | unless one of its records refers to Account |
| 2020-10-05 15:43:10 | <fog23> | Transation* |
| 2020-10-05 15:43:14 | <fog23> | which i guess it must... |
| 2020-10-05 15:43:37 | × | lpy quits (~lpyfist@unaffiliated/elysian) (Quit: lpy) |
| 2020-10-05 15:44:13 | <fog23> | ah yes, its Posting https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Data/Types.hs#L285 |
| 2020-10-05 15:44:18 | <fog23> | that has a maybe Transaction |
| 2020-10-05 15:44:21 | <sm[m]> | Transaction refers to Posting which refers back to Transaction, this one is a tree of two types.. yep |
| 2020-10-05 15:44:27 | <fog23> | ok, this all seems quite straitforwards |
| 2020-10-05 15:44:56 | <fog23> | but again, this is a natural recursive function |
| 2020-10-05 15:45:00 | → | jiribenes joins (~jiribenes@rosa.jiribenes.com) |
| 2020-10-05 15:45:03 | <sm[m]> | that's haskell for you.. no big drama :) |
| 2020-10-05 15:45:11 | → | wraithm joins (~wraithm@unaffiliated/wraithm) |
| 2020-10-05 15:45:20 | <fog23> | and the "order of visitation" intrinsic, means it always has the think needed to tie the knot |
| 2020-10-05 15:45:58 | <fog23> | but if im trying to tie the knot on several upwards pointing branches - then i dont have those values available while descending by recusing |
| 2020-10-05 15:46:19 | <fog23> | thing* |
| 2020-10-05 15:46:23 | <sm[m]> | you could pass them down as you build the tree ? |
| 2020-10-05 15:46:36 | <fog23> | you mean, pass them up? |
| 2020-10-05 15:46:44 | <sm[m]> | (but that wouldn't be called a tree, right ? dunno) |
| 2020-10-05 15:46:52 | × | conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.) |
| 2020-10-05 15:46:53 | <fog23> | well its a cyclic tree |
| 2020-10-05 15:47:11 | <fog23> | im not sure if there is need to distinguish which is the "natural" parent |
| 2020-10-05 15:47:22 | <fog23> | or if all of the upper nodes are... |
| 2020-10-05 15:47:48 | <fog23> | hmm, i guess only one of them actually has the branches below that contain the branch that is with the upwards knots |
| 2020-10-05 15:47:53 | <fog23> | argh, so complicated |
All times are in UTC.