Logs: freenode/#haskell
| 2021-03-23 03:17:19 | <heck-to-the-gnom> | Could someone explain the haskell logo to me? I can make out the h,a,s, and sort of the k, maaaybe an e, but the two Ls? |
| 2021-03-23 03:17:43 | × | v01d4lph4 quits (~v01d4lph4@223.233.89.82) (Ping timeout: 265 seconds) |
| 2021-03-23 03:18:04 | <Axman6> | it's a combination of a lambda and the >>= operator |
| 2021-03-23 03:18:13 | <infinisil> | I don't think it's meant to say haskell |
| 2021-03-23 03:18:47 | <heck-to-the-gnom> | huh, I must be reaching for straws with the h,a,s,k,e,l,l stuff then |
| 2021-03-23 03:18:51 | <dmwit> | guest323: https://gist.github.com/dmwit/dbeea223d0de082906b3d50d2c28d790 |
| 2021-03-23 03:19:31 | × | xff0x_ quits (~xff0x@2001:1a81:5377:7c00:cfc9:4ce8:81dd:681d) (Ping timeout: 272 seconds) |
| 2021-03-23 03:19:53 | <guest323> | it's interesting, that h,a,s,k,e,l,l could be a,s,k,h,e,l,l |
| 2021-03-23 03:20:12 | → | xff0x_ joins (~xff0x@2001:1a81:5377:7c00:1d9b:fbcc:ac5f:34bc) |
| 2021-03-23 03:20:31 | <dmwit> | guest323: From there you can go `f n = f (pred n) = f (pred (pred n))` and then undo the definition of `g` to get `f (pred (pred n)) = g f (pred n)`. But it's pretty convoluted, and a simpler explanation of the equation you wrote is that you made a small mistake when expanding the definition of fix. |
| 2021-03-23 03:21:57 | → | Stanley00 joins (~stanley00@unaffiliated/stanley00) |
| 2021-03-23 03:23:12 | × | Wuzzy quits (~Wuzzy@p57a2ecf2.dip0.t-ipconnect.de) (Quit: Wuzzy) |
| 2021-03-23 03:23:12 | × | tanner__ quits (uid491848@gateway/web/irccloud.com/x-rtafqkufgdjftxay) (Quit: Connection closed for inactivity) |
| 2021-03-23 03:23:35 | <dmwit> | (Or, well, there's other ways to get there, too, of course. I'd be interested to see what reasoning you used. I'm much more excited about checking a *proof* than checking a potentially-provable *equality*.) |
| 2021-03-23 03:25:15 | <guest323> | dmwit: I just stuck in that call fixed-point in callCC create a loop, https://paste.ubuntu.com/p/mMsXX7dcVt/ |
| 2021-03-23 03:26:48 | <guest323> | dmwit: f n = fix g n = g (fix g) n = fix g (pred n) = f (pred n) why you wouldn't change fix g to f, so f n= fix g n = g f n |
| 2021-03-23 03:27:37 | <guest323> | f n = f (pred n) = g f (pred n) |
| 2021-03-23 03:27:37 | <dmwit> | Yep, that's allowed and correct. |
| 2021-03-23 03:27:56 | <qih> | I originally install 'Stack' using Snaps, then installed a GHCi using Stack. Installing the Haskell-Language-Server has pulled in Cabal and another version of the GHCi it seems, is this normal? Or am I mis-reading 2 x GHCis? |
| 2021-03-23 03:28:12 | <dmwit> | -Yep +Yes |
| 2021-03-23 03:29:24 | <dmwit> | qih: I don't know for sure, but it wouldn't surprise me at all. Stack likes to be in control of your GHC installs, and will happily install multiple if you ask for things from resolvers that have different GHC versions in them. |
| 2021-03-23 03:29:40 | <guest323> | dmwit: https://www.vex.net/~trebla/haskell/cont-monad.xhtml |
| 2021-03-23 03:30:11 | <qih> | Oh right. It seems to work fine is I use 'stack ghci' with no errors, so I will run with that. |
| 2021-03-23 03:30:19 | <qih> | s/is/if |
| 2021-03-23 03:30:21 | <guest323> | dmwit: Setjmp, why it jump back |
| 2021-03-23 03:31:29 | × | alx741 quits (~alx741@186.178.108.164) (Quit: alx741) |
| 2021-03-23 03:32:42 | → | v01d4lph4 joins (~v01d4lph4@223.233.89.82) |
| 2021-03-23 03:33:16 | <dmwit> | mu |
| 2021-03-23 03:33:51 | × | stree quits (~stree@68.36.8.116) (Ping timeout: 256 seconds) |
| 2021-03-23 03:34:28 | → | forgottenone joins (~forgotten@176.42.23.95) |
| 2021-03-23 03:34:47 | <dmwit> | It doesn't jump back. setjmp causes the name `l` to refer to all the code after it, so if you invoke `l`, you invoke all the code after the setjmp. |
| 2021-03-23 03:35:24 | <dmwit> | It is always going forward. But going forward may run the same code again. |
| 2021-03-23 03:35:31 | <guest323> | dmwit: how that would be possible? |
| 2021-03-23 03:35:41 | <guest323> | dmwit: capture all the code after it |
| 2021-03-23 03:35:45 | <dmwit> | Well... you have the source code right there. ^_^ |
| 2021-03-23 03:36:34 | <guest323> | dmwit: I don't understand it, setjmp is just a callCC code, and the next line `modify (+1)` is not related to callCC at all |
| 2021-03-23 03:36:42 | <dmwit> | (I do not think I can write English text that is as clear, concise, and unambiguous as the Haskell code is.) |
| 2021-03-23 03:36:56 | <dmwit> | Oh, but the next line *is* related to callCC. |
| 2021-03-23 03:37:08 | <guest323> | dmwit: what? |
| 2021-03-23 03:37:15 | <guest323> | dmwit: why do you think it's related? |
| 2021-03-23 03:37:23 | <dmwit> | Because callCC gives you access to the current continuation at the moment it's called. And at the moment setjmp is invoked, modify (+1) is inside the current continuation. |
| 2021-03-23 03:38:23 | <dmwit> | Specifically: the current continuation is `modify (+1) >> get >>= \s -> if s == 5 then return s else l`. |
| 2021-03-23 03:38:24 | <guest323> | dmwit: callCC return a Cont r a, but modify (+1) is not the continution which apply on callCC |
| 2021-03-23 03:38:47 | <dmwit> | modify (+1) is not the continuation. But it is part of the continuation (see above). |
| 2021-03-23 03:40:34 | <dmwit> | Precision: the current continuation is `\l -> modify (+1) >> get >>= \s -> if s == 5 then return s else l`. |
| 2021-03-23 03:41:21 | <guest323> | dmwit: what fixed-point is doing here? |
| 2021-03-23 03:41:36 | <dmwit> | It is shoving the whole modify chain into the `else` branch. |
| 2021-03-23 03:42:01 | <dmwit> | modify;get;if s == 5 then return s else (modify;get;if s == 5 then return s else (...)) |
| 2021-03-23 03:42:34 | <guest323> | dmwit: look at the code, I still don't understand why callCC capture the code after it as continuation |
| 2021-03-23 03:42:50 | <guest323> | the code after it, they're not passing to it |
| 2021-03-23 03:42:52 | <dmwit> | Me neither. But perhaps some day I will internalize MonadCont. |
| 2021-03-23 03:42:53 | <guest323> | or apply on it |
| 2021-03-23 03:43:15 | <dmwit> | The code after it *is* being passed to it, by the (>>=) operation for ContT. |
| 2021-03-23 03:43:57 | <guest323> | I know the intuition, but I just don't undertand why and how |
| 2021-03-23 03:44:15 | <dmwit> | m >>= k = ContT $ \ c -> runContT m (\ x -> runContT (k x) c) |
| 2021-03-23 03:44:19 | <guest323> | dmwit: I dream to use functions to express this |
| 2021-03-23 03:44:37 | <dmwit> | In this line, `k` is the code after the `setjmp`. It is being passed as an argument to `m`. |
| 2021-03-23 03:44:37 | <guest323> | so it would be general in all the languages |
| 2021-03-23 03:44:55 | <dmwit> | That dream should be achievable. |
| 2021-03-23 03:45:23 | <guest323> | dmwit: but it can't be done without understanding |
| 2021-03-23 03:45:31 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 2021-03-23 03:45:33 | <dmwit> | Possibly. |
| 2021-03-23 03:46:18 | × | theDon quits (~td@94.134.91.6) (Ping timeout: 245 seconds) |
| 2021-03-23 03:46:26 | <guest323> | first, implement fix in other languages without lazy-eval strategy is possibal? |
| 2021-03-23 03:46:28 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 2021-03-23 03:46:43 | → | stree joins (~stree@68.36.8.116) |
| 2021-03-23 03:47:10 | × | mrchampion quits (~mrchampio@38.18.109.23) (Remote host closed the connection) |
| 2021-03-23 03:47:26 | <guest323> | callCC can be written by function |
| 2021-03-23 03:48:05 | <guest323> | do notation and >>= can be defined by function |
| 2021-03-23 03:48:13 | → | theDon joins (~td@muedsl-82-207-238-243.citykom.de) |
| 2021-03-23 03:48:52 | <guest323> | data types and functions just are just wrapped and unwrapped |
| 2021-03-23 03:49:50 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 264 seconds) |
| 2021-03-23 03:50:54 | × | jol_ quits (jol@jol.dev) (Remote host closed the connection) |
| 2021-03-23 03:50:57 | <dmwit> | Hm. fix may be tricky in some languages. Usually fix' :: ((a -> b) -> (a -> b)) -> (a -> b) -- the specialization of fix to function type -- is relatively easy. |
| 2021-03-23 03:51:38 | <dmwit> | You can often get something *like* fix by using fix' on a `() -> a` function type instead of the flat `a` value type. |
| 2021-03-23 03:52:10 | <dmwit> | (This trick -- using `() -> a` as a substitute for a lazy `a` -- is pretty generally useful.) |
| 2021-03-23 03:53:43 | <shachaf> | For a non-strict a, at least. |
| 2021-03-23 03:55:08 | dmwit | nods |
| 2021-03-23 03:56:21 | × | molehillish quits (~molehilli@2600:8800:8d06:1800:c1f2:e355:53f0:4ab8) (Remote host closed the connection) |
| 2021-03-23 03:56:52 | × | theDon quits (~td@muedsl-82-207-238-243.citykom.de) (Ping timeout: 265 seconds) |
| 2021-03-23 03:57:02 | → | molehillish joins (~molehilli@2600:8800:8d06:1800:c1f2:e355:53f0:4ab8) |
| 2021-03-23 03:57:54 | × | jluttine_ quits (~jluttine@85-23-95-149.bb.dnainternet.fi) (Ping timeout: 246 seconds) |
| 2021-03-23 03:58:31 | × | kiweun quits (~kiweun@cpe98524a8cef7c-cm98524a8cef7a.cpe.net.cable.rogers.com) (Remote host closed the connection) |
| 2021-03-23 03:58:33 | → | theDon joins (~td@muedsl-82-207-238-243.citykom.de) |
| 2021-03-23 03:59:21 | × | DataComputist quits (~lumeng@50.43.26.251) (Ping timeout: 264 seconds) |
| 2021-03-23 03:59:27 | → | FinnElija joins (~finn_elij@gateway/tor-sasl/finnelija/x-67402716) |
| 2021-03-23 03:59:27 | finn_elija | is now known as Guest27356 |
| 2021-03-23 03:59:27 | FinnElija | is now known as finn_elija |
| 2021-03-23 04:00:28 | → | Rudd0 joins (~Rudd0@185.189.115.103) |
| 2021-03-23 04:01:13 | × | molehillish quits (~molehilli@2600:8800:8d06:1800:c1f2:e355:53f0:4ab8) (Ping timeout: 244 seconds) |
| 2021-03-23 04:03:09 | → | plutoniix joins (~q@184.82.202.5) |
| 2021-03-23 04:03:16 | → | ddellacosta joins (~ddellacos@83.143.246.107) |
| 2021-03-23 04:03:18 | × | Guest27356 quits (~finn_elij@gateway/tor-sasl/finnelija/x-67402716) (Ping timeout: 268 seconds) |
| 2021-03-23 04:03:18 | × | ddellacosta quits (~ddellacos@83.143.246.107) (Remote host closed the connection) |
| 2021-03-23 04:04:56 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 2021-03-23 04:04:57 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 2021-03-23 04:05:20 | → | Tario joins (~Tario@201.192.165.173) |
| 2021-03-23 04:06:30 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-109-157.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 2021-03-23 04:09:33 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 2021-03-23 04:09:39 | × | qih quits (~dietpi@219-89-183-60-fibre.sparkbb.co.nz) (Read error: Connection reset by peer) |
All times are in UTC.