Logs: freenode/#haskell
| 2020-10-15 18:23:07 | → | plast1k_ joins (~plast1k_@196.207.181.246) |
| 2020-10-15 18:23:20 | → | knupfer1 joins (~Thunderbi@mue-88-130-61-082.dsl.tropolys.de) |
| 2020-10-15 18:24:36 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 2020-10-15 18:24:48 | × | dyeplexer quits (~lol@unaffiliated/terpin) (Remote host closed the connection) |
| 2020-10-15 18:24:49 | × | wroathe quits (~wroathe@c-73-24-27-54.hsd1.mn.comcast.net) (Ping timeout: 258 seconds) |
| 2020-10-15 18:24:49 | → | chaosmasttter joins (~chaosmast@p200300c4a711b001c4478125cc0e8bf4.dip0.t-ipconnect.de) |
| 2020-10-15 18:25:05 | → | deviantfero joins (~deviantfe@190.99.48.231) |
| 2020-10-15 18:25:47 | → | shailangsa joins (~shailangs@host86-186-133-58.range86-186.btcentralplus.com) |
| 2020-10-15 18:26:17 | <jsynacek> | Hi! I'm having a problem understanding State and >>= together. |
| 2020-10-15 18:26:22 | <jsynacek> | I have this: foo :: State Int [Int] |
| 2020-10-15 18:26:27 | <jsynacek> | foo = get >>= \s -> pure [s+10] >>= \s' -> pure $ s' ++ [7,8,9] |
| 2020-10-15 18:26:54 | <jsynacek> | Can anyone please explain to me how the s' suddenly changes from Int to [Int]? I can't figure it out. |
| 2020-10-15 18:27:11 | → | isovector1 joins (~isovector@172.103.216.166) |
| 2020-10-15 18:27:13 | <jsynacek> | I mean it's still supposed to be of the same type as the state, right? |
| 2020-10-15 18:27:25 | × | knupfer quits (~Thunderbi@200116b82c60f7000c4226fffe43b3db.dip.versatel-1u1.de) (Ping timeout: 240 seconds) |
| 2020-10-15 18:27:25 | knupfer1 | is now known as knupfer |
| 2020-10-15 18:28:03 | → | xff0x joins (~fox@2001:1a81:5350:d900:f51f:ced4:4c46:54ba) |
| 2020-10-15 18:28:13 | × | dansho quits (~dansho@ip68-108-167-185.lv.lv.cox.net) (Quit: Leaving) |
| 2020-10-15 18:28:13 | <jsynacek> | So I would suppose that s and s' should both be Int. But s is Int and s' is [Int]. |
| 2020-10-15 18:28:14 | <verement> | :t \s -> pure [s+10] |
| 2020-10-15 18:28:15 | <lambdabot> | (Applicative f, Num a) => a -> f [a] |
| 2020-10-15 18:28:40 | → | acidjnk_new joins (~acidjnk@p200300d0c723781658597087ca157dd5.dip0.t-ipconnect.de) |
| 2020-10-15 18:29:23 | <monochrom> | I don't understand the "change" mental model. There is no change. |
| 2020-10-15 18:29:59 | <monochrom> | "pure x >>= \y -> ..." necessarily satisfies y=x therefore y has the same type as x. |
| 2020-10-15 18:30:18 | <larou> | johnw: it would be some arbitrary label, probably a Symbol, to accompany the instance - that way allowing many such instances, that otherwise would clash |
| 2020-10-15 18:30:20 | <monochrom> | Oh, x is a list this time? Then it is a list this time. |
| 2020-10-15 18:30:20 | <dolio> | You named the variables to confuse yourself. :) |
| 2020-10-15 18:31:05 | <johnw> | larou: I suppose if you used a Nat and yourself ensured monotonicity, you could impose a type-level ordering constraint |
| 2020-10-15 18:31:11 | <larou> | then you would have the downstream reference constrained to reference the corresponding label |
| 2020-10-15 18:31:27 | <larou> | johnw: hmm, good idea |
| 2020-10-15 18:31:57 | <larou> | maybe that aswell as a label |
| 2020-10-15 18:32:22 | <larou> | otherwise you would only be able to make one value of the datatype |
| 2020-10-15 18:32:43 | <larou> | or, have to use arbitrarily large first Nat for all the subsequent values |
| 2020-10-15 18:33:07 | → | cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) |
| 2020-10-15 18:33:09 | <geekosaur> | jsynacek, note that the only thing that does anything with the state is the `get`; you then produce a list, and then consume a list, and produce another list, carrying the state along without touching it |
| 2020-10-15 18:33:23 | <larou> | or maybe not a Nat |
| 2020-10-15 18:33:28 | <larou> | but like f () |
| 2020-10-15 18:33:33 | <larou> | for the linked container f |
| 2020-10-15 18:33:50 | <larou> | like, if it were a doubly linked list, a Nat would be ok - but not if it were a tree |
| 2020-10-15 18:34:03 | <larou> | erm, a pointer on (f ()) |
| 2020-10-15 18:34:22 | <jsynacek> | geekosaur: Yes, that's it. I totally confused myself. |
| 2020-10-15 18:34:28 | <jsynacek> | geekosaur++ |
| 2020-10-15 18:34:40 | <larou> | so the "name" label, has to be the same for every constructor used sequentially to construct the container |
| 2020-10-15 18:34:55 | <larou> | they are all just different bits of the "same container" |
| 2020-10-15 18:35:20 | <larou> | and the pointer to the position of the part being referenced would be like the Nat |
| 2020-10-15 18:35:32 | <larou> | not sure how your monotonicity constraint works then.. |
| 2020-10-15 18:36:05 | <larou> | i think the doubly linked list example has "the immediately preceding value" expressed via the constraint |
| 2020-10-15 18:36:16 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-10-15 18:36:21 | <larou> | not anything less than the current index |
| 2020-10-15 18:36:39 | <larou> | or did you mean monotinic position, like successive "forwards" positions of a zipper? |
| 2020-10-15 18:37:04 | <larou> | indexing at type level *each* of the positions, not just the cyclic references |
| 2020-10-15 18:37:06 | <hyperisco> | so with the Haskell VSCode extension... 1) any way to insert a suitable import given an identifier? 2) any way to have ctrl+shift+b build the project? |
| 2020-10-15 18:37:45 | <hyperisco> | so far the error underlining hasn't exploded so that is progress |
| 2020-10-15 18:37:58 | <larou> | i guess then you would have something like a tree zipper, and the constraint would be that you would only be able to navigate down and forwards, not upwards and backwards... thats kind of like the ordering of a Nat... |
| 2020-10-15 18:39:01 | <hyperisco> | I hate knowing a name like getArgs but not knowing what module it is in |
| 2020-10-15 18:39:07 | <hyperisco> | if the IDE could help me with that it would be a godsend |
| 2020-10-15 18:41:05 | <monochrom> | Tranditionally, people install hoogle locally for that. They probably also get their IDEs to call hoogle. |
| 2020-10-15 18:41:27 | <jsynacek> | hyperisco: vscode has a feature called Tasks. You can use it to run 'cabal build' on ctrl+shift+b. |
| 2020-10-15 18:41:34 | → | bitmagie joins (~Thunderbi@200116b806495000583b859276a8aad8.dip.versatel-1u1.de) |
| 2020-10-15 18:41:36 | <monochrom> | Me, I just crack open a web browser tab and use the haddock index. |
| 2020-10-15 18:42:14 | <jsynacek> | hyperisco: Check out https://code.visualstudio.com/docs/editor/tasks#vscode |
| 2020-10-15 18:42:37 | <hyperisco> | monochrom, when you have to import hundreds of things a day that adds up hugely |
| 2020-10-15 18:43:18 | → | fendor joins (~fendor@178.115.131.201.wireless.dyn.drei.com) |
| 2020-10-15 18:43:21 | <hyperisco> | jsynacek, okay thanks |
| 2020-10-15 18:43:40 | <hyperisco> | how about tabs… I have VSCode set to width 2 but for whatever reason in .hs files it is back to 4 |
| 2020-10-15 18:44:45 | × | sleblanc quits (~sleblanc@unaffiliated/sebleblanc) (Ping timeout: 258 seconds) |
| 2020-10-15 18:45:31 | × | jneira_ quits (~jneira@80.30.100.250) (Ping timeout: 258 seconds) |
| 2020-10-15 18:46:22 | × | bitmagie quits (~Thunderbi@200116b806495000583b859276a8aad8.dip.versatel-1u1.de) (Client Quit) |
| 2020-10-15 18:46:45 | → | jneira_ joins (~jneira@80.30.100.250) |
| 2020-10-15 18:47:04 | <hyperisco> | just need a file-extension-specific override... okay |
| 2020-10-15 18:47:28 | hackage | implicit-hie 0.1.2.0 - Auto generate hie-bios cradles & hie.yaml https://hackage.haskell.org/package/implicit-hie-0.1.2.0 (Avi_Dessauer) |
| 2020-10-15 18:49:40 | → | bitmagie joins (~Thunderbi@200116b806495000583b859276a8aad8.dip.versatel-1u1.de) |
| 2020-10-15 18:50:32 | × | thir quits (~thir@p200300f27f025800e13a3eca7002ede4.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 2020-10-15 18:51:09 | <hyperisco> | would be nice if you could get the type of a term |
| 2020-10-15 18:51:24 | <hyperisco> | seems you can only get types for imported names |
| 2020-10-15 18:51:53 | × | bitmagie quits (~Thunderbi@200116b806495000583b859276a8aad8.dip.versatel-1u1.de) (Client Quit) |
| 2020-10-15 18:51:55 | <hyperisco> | oh nvm it is working now... now I just wish there was a hotkey instead of hovering |
| 2020-10-15 18:52:02 | <hyperisco> | because going to the mouse is no good |
| 2020-10-15 18:53:27 | <hyperisco> | apparently is a vscode thing if you do ctrl+k+i ... hope this helps someone |
| 2020-10-15 18:54:32 | × | conal_ quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.) |
| 2020-10-15 18:54:52 | <hyperisco> | oh damnnnnnn it will auto import names |
| 2020-10-15 18:56:14 | <hyperisco> | ctrl+. while cursored on the name... gives several import options |
| 2020-10-15 18:56:41 | <hyperisco> | Haskell officially has good IDE support in my eyes… well done. where do I insert my money? |
| 2020-10-15 18:57:09 | <larou> | i guess the problem would then be that every version of the container would still have this label |
| 2020-10-15 18:57:29 | <larou> | maybe a synonym with a quantification would allow it to be polymorphic in this label |
| 2020-10-15 18:58:07 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-10-15 18:58:11 | <larou> | well, this is why it was called a "Let" class anyway, so that it binds the "name of the value" as a type parameter |
| 2020-10-15 18:58:36 | <larou> | then you can at least constrain the cyclic references to be to the same container |
| 2020-10-15 18:58:45 | <larou> | but im not sure what would happen when modifying it |
| 2020-10-15 18:59:01 | <larou> | like, i guess you would have to give it a new type label and Let instance |
| 2020-10-15 18:59:07 | <larou> | this seems impossible |
| 2020-10-15 18:59:29 | <larou> | its these kind of considerations that makes it seem like it would be better as a language feature than as a library |
| 2020-10-15 18:59:32 | × | kuribas quits (~user@ptr-25vy0i8gfnrq7cvfnez.18120a2.ip6.access.telenet.be) (Remote host closed the connection) |
| 2020-10-15 19:00:00 | <larou> | you would have all the knot tying stuff being done under the hood then too |
| 2020-10-15 19:00:22 | × | xff0x quits (~fox@2001:1a81:5350:d900:f51f:ced4:4c46:54ba) (Remote host closed the connection) |
| 2020-10-15 19:00:42 | → | xff0x joins (~fox@2001:1a81:5350:d900:f127:8532:42d4:579b) |
| 2020-10-15 19:01:25 | × | dhil quits (~dhil@195.213.192.122) (Ping timeout: 240 seconds) |
| 2020-10-15 19:02:14 | → | conal joins (~conal@64.71.133.70) |
| 2020-10-15 19:03:31 | → | berberman_ joins (~berberman@unaffiliated/berberman) |
| 2020-10-15 19:03:46 | × | taurux quits (~taurux@net-93-144-64-237.cust.dsl.teletu.it) (Ping timeout: 256 seconds) |
All times are in UTC.