Logs: freenode/#haskell
| 2020-09-21 02:32:10 | × | Guest42888 quits (~lagothrix@unaffiliated/lagothrix) (Killed (rothfuss.freenode.net (Nickname regained by services))) |
| 2020-09-21 02:32:16 | → | lagothrix joins (~lagothrix@unaffiliated/lagothrix) |
| 2020-09-21 02:32:18 | <ski> | (if there's several `forall's in a type, then we say the overall rank is the maximum of the individual ranks of the `forall's in it. ordinary polymorphic operations are rank-one. monomorphic operations could be said to be rank-zero, i suppose ..) |
| 2020-09-21 02:32:26 | <ski> | inkbottle : is this making sense ? |
| 2020-09-21 02:34:05 | <inkbottle> | I'm not done reading, I've been interrupted |
| 2020-09-21 02:34:30 | × | thir quits (~thir@p200300f27f0fc600ed2222922a5678d5.dip0.t-ipconnect.de) (Ping timeout: 244 seconds) |
| 2020-09-21 02:35:00 | <ski> | take your time. if anything is unclear, if you want further elaboration, or you have questions or comments, please do tell |
| 2020-09-21 02:36:02 | <ski> | here's one other example of a rank-two (and in this case also polymorphic) operation : |
| 2020-09-21 02:36:13 | <ski> | runST :: forall a. (forall s. ST s a) -> a |
| 2020-09-21 02:38:23 | <inkbottle> | The explanation in terms of "who pick 'a" is very interesting |
| 2020-09-21 02:38:37 | <ski> | for "running" (executing/performing) an `ST s'-action (`ST s' expressing a kind of state effects, where one can dynamically allocate mutable reference cells (and arrays), and read from and write to them. implemented in terms of actual update-in-place, unlike say `State s' (which has a single global state `s', no dynamic allocation)) |
| 2020-09-21 02:39:26 | <ski> | yea, that's the main thing that happens, as we pass to higher ranks, we alternate between caller and callee picking |
| 2020-09-21 02:40:04 | <ski> | the usual reason for wanting to define a rank-two operation is that you actually want to use a callback with multiple choices for your type variable(s) |
| 2020-09-21 02:40:20 | <ski> | (as in my `blah' example a bit up) |
| 2020-09-21 02:40:38 | → | fulc9277 joins (~fulc927@unaffiliated/fulc927) |
| 2020-09-21 02:40:38 | → | mariatsji joins (~mariatsji@2a01:79d:53aa:c66c:342b:5324:f59b:5b0e) |
| 2020-09-21 02:41:19 | <ski> | another reason is to want to hide some implementation detail of the function, from its caller. that is, hide which (possiby single) type that the implementation uses |
| 2020-09-21 02:42:17 | <ski> | here's some kind of example of that. consider |
| 2020-09-21 02:42:28 | hackage | monad-memo 0.5.2 - Memoization monad transformer https://hackage.haskell.org/package/monad-memo-0.5.2 (EduardSergeev) |
| 2020-09-21 02:42:45 | <ski> | newtype StateT s m a = MkStateT (s -> m (a,s)) |
| 2020-09-21 02:43:08 | → | asan joins (~yan4138@114.84.148.87) |
| 2020-09-21 02:43:14 | <ski> | there is a function |
| 2020-09-21 02:43:16 | <ski> | @type mapStateT |
| 2020-09-21 02:43:18 | <lambdabot> | (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b |
| 2020-09-21 02:43:46 | → | howdoi joins (uid224@gateway/web/irccloud.com/x-mtwkarqdregvoupa) |
| 2020-09-21 02:44:00 | <ski> | that can be used to change the `m' in `StateT s m a' to another monad, `n' (also here swapping `a' out for `b') |
| 2020-09-21 02:44:47 | <ski> | however, in the callback, we can see that we're handed an action of type `m (a,s)', that will produce a pair. and we're to give back a new action of type `n (b,s)', that will also produce a pair |
| 2020-09-21 02:45:01 | <ski> | one might consider this as "implementation detail leaking" |
| 2020-09-21 02:45:08 | <ski> | so, one could make a variant |
| 2020-09-21 02:45:26 | → | pera joins (~pera@unaffiliated/pera) |
| 2020-09-21 02:45:32 | × | mariatsji quits (~mariatsji@2a01:79d:53aa:c66c:342b:5324:f59b:5b0e) (Ping timeout: 260 seconds) |
| 2020-09-21 02:45:48 | <ski> | mapStateT' :: (forall h. m h -> n h) -> StateT s m a -> StateT s n a |
| 2020-09-21 02:46:46 | <ski> | where `h' here hides the pair type from the caller of the function. in some cases, this can be useful to prevent the callback that the caller provides, from messing around with the internal implementation (the values of the "hidden" type `h') |
| 2020-09-21 02:47:00 | → | TooDifficult joins (~TooDiffic@139.59.59.230) |
| 2020-09-21 02:47:44 | → | suppi joins (~suppi@172.246.241.246) |
| 2020-09-21 02:48:07 | <ski> | inkbottle : is that reasonably clear ? |
| 2020-09-21 02:48:41 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-09-21 02:49:59 | <ski> | (there are probably more suggestive examples of this "information hiding" capability of rank-two .. but i can't think offhand of one that would be quick to showcase) |
| 2020-09-21 02:52:34 | → | dansho joins (~dansho@ip68-108-167-185.lv.lv.cox.net) |
| 2020-09-21 02:53:26 | → | Stanley00 joins (~stanley00@unaffiliated/stanley00) |
| 2020-09-21 02:55:04 | × | suppi quits (~suppi@172.246.241.246) (Ping timeout: 272 seconds) |
| 2020-09-21 02:55:47 | × | Volt_ quits (~Volt_@c-73-145-164-70.hsd1.mi.comcast.net) (Quit: ) |
| 2020-09-21 02:55:47 | × | danso quits (~dan@107-190-41-58.cpe.teksavvy.com) (Read error: Connection reset by peer) |
| 2020-09-21 02:56:22 | → | danso joins (~dan@107-190-41-58.cpe.teksavvy.com) |
| 2020-09-21 02:56:50 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2020-09-21 02:57:27 | → | suppi joins (~suppi@2605:f700:40:c00::e6fc:6842) |
| 2020-09-21 02:58:14 | × | ryansmccoy quits (~ryansmcco@156.96.151.132) (Ping timeout: 272 seconds) |
| 2020-09-21 02:58:41 | → | ryansmccoy joins (~ryansmcco@193.37.254.27) |
| 2020-09-21 02:59:45 | × | theDon quits (~td@muedsl-82-207-238-073.citykom.de) (Ping timeout: 240 seconds) |
| 2020-09-21 03:00:01 | × | Xing`1 quits (~Xing`@185.244.214.216) () |
| 2020-09-21 03:00:20 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-21 03:01:43 | → | kenran joins (~maier@b2b-37-24-119-190.unitymedia.biz) |
| 2020-09-21 03:01:53 | → | theDon joins (~td@muedsl-82-207-238-036.citykom.de) |
| 2020-09-21 03:03:54 | × | cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Quit: Goodbye) |
| 2020-09-21 03:04:48 | → | cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) |
| 2020-09-21 03:09:40 | → | notzmv` joins (~user@177.103.86.92) |
| 2020-09-21 03:11:46 | → | toorevitimirp joins (~tooreviti@117.182.182.33) |
| 2020-09-21 03:12:10 | → | iscke joins (~black@60.225.157.201) |
| 2020-09-21 03:12:45 | × | notzmv quits (~user@unaffiliated/zmv) (Ping timeout: 240 seconds) |
| 2020-09-21 03:12:56 | <ski> | inkbottle : anyway .. if you want to, perhaps we could continue this conversation later (getting to existentials, hopefully), as it's quite late here |
| 2020-09-21 03:13:25 | × | notzmv` quits (~user@177.103.86.92) (Changing host) |
| 2020-09-21 03:13:25 | → | notzmv` joins (~user@unaffiliated/zmv) |
| 2020-09-21 03:13:30 | notzmv` | is now known as notzmv |
| 2020-09-21 03:14:05 | × | bloodstalker quits (~bloodstal@46.166.187.178) (Remote host closed the connection) |
| 2020-09-21 03:14:35 | × | ryansmccoy quits (~ryansmcco@193.37.254.27) (Ping timeout: 240 seconds) |
| 2020-09-21 03:14:50 | → | petersen joins (~petersen@redhat/juhp) |
| 2020-09-21 03:16:57 | → | ryansmccoy joins (~ryansmcco@68.235.48.108) |
| 2020-09-21 03:17:39 | × | gmt quits (~gmt@pool-71-105-108-44.nycmny.fios.verizon.net) (Ping timeout: 260 seconds) |
| 2020-09-21 03:18:48 | × | acidjnk_new2 quits (~acidjnk@p200300d0c736584378afc0f7e05aaafd.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 2020-09-21 03:21:09 | × | teardown quits (~user@unaffiliated/mrush) (Ping timeout: 260 seconds) |
| 2020-09-21 03:22:56 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds) |
| 2020-09-21 03:27:40 | → | mmohammadi981261 joins (~mmohammad@2.178.188.114) |
| 2020-09-21 03:30:32 | → | modaljunk joins (~modaljunk@gateway/tor-sasl/modaljunk) |
| 2020-09-21 03:30:52 | × | modaljunk quits (~modaljunk@gateway/tor-sasl/modaljunk) (Remote host closed the connection) |
| 2020-09-21 03:31:18 | → | modaljunk joins (~modaljunk@gateway/tor-sasl/modaljunk) |
| 2020-09-21 03:34:44 | × | TooDifficult quits (~TooDiffic@139.59.59.230) (Quit: TooDifficult) |
| 2020-09-21 03:35:04 | → | TooDifficult joins (~TooDiffic@139.59.59.230) |
| 2020-09-21 03:36:07 | × | justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 272 seconds) |
| 2020-09-21 03:38:14 | → | justanotheruser joins (~justanoth@unaffiliated/justanotheruser) |
| 2020-09-21 03:39:24 | → | mirrorbird joins (~psutcliff@m83-187-173-228.cust.tele2.se) |
| 2020-09-21 03:39:54 | × | TooDifficult quits (~TooDiffic@139.59.59.230) (Client Quit) |
| 2020-09-21 03:43:43 | × | suppi quits (~suppi@2605:f700:40:c00::e6fc:6842) (Ping timeout: 272 seconds) |
| 2020-09-21 03:45:28 | hackage | stm-actor 0.1.0.0 - See the README https://hackage.haskell.org/package/stm-actor-0.1.0.0 (sgschlesinger) |
| 2020-09-21 03:45:37 | × | ericsagnes quits (~ericsagne@2405:6580:0:5100:5585:9ff6:72b9:d99a) (Ping timeout: 260 seconds) |
| 2020-09-21 03:47:29 | → | isovector1 joins (~isovector@node-1w7jr9squrfoy3fci95ksrhpu.ipv6.telus.net) |
| 2020-09-21 03:47:45 | × | asan quits (~yan4138@114.84.148.87) (Ping timeout: 240 seconds) |
| 2020-09-21 03:48:01 | → | asan joins (~yan4138@124.78.128.72) |
| 2020-09-21 03:49:26 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-09-21 03:53:47 | → | TooDifficult joins (~TooDiffic@139.59.59.230) |
| 2020-09-21 03:54:50 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds) |
| 2020-09-21 03:54:56 | → | suppi joins (~suppi@172.246.241.246) |
| 2020-09-21 03:55:07 | × | modaljunk quits (~modaljunk@gateway/tor-sasl/modaljunk) (Remote host closed the connection) |
| 2020-09-21 03:55:33 | → | modaljunk joins (~modaljunk@gateway/tor-sasl/modaljunk) |
| 2020-09-21 03:56:13 | → | kini1 joins (~kini@195.206.169.184) |
| 2020-09-21 03:56:29 | × | modaljunk quits (~modaljunk@gateway/tor-sasl/modaljunk) (Client Quit) |
| 2020-09-21 03:57:53 | → | ericsagnes joins (~ericsagne@2405:6580:0:5100:25d0:9c91:85b6:2191) |
| 2020-09-21 04:06:38 | × | perrier-jouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 2.9) |
| 2020-09-21 04:06:39 | → | Sanchayan joins (~Sanchayan@122.167.114.73) |
| 2020-09-21 04:11:27 | × | dansho quits (~dansho@ip68-108-167-185.lv.lv.cox.net) (Remote host closed the connection) |
| 2020-09-21 04:11:52 | → | dansho joins (~dansho@ip68-108-167-185.lv.lv.cox.net) |
All times are in UTC.