Logs: freenode/#haskell
| 2020-10-05 19:48:57 | → | GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) |
| 2020-10-05 19:48:57 | × | GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host) |
| 2020-10-05 19:48:57 | → | GyroW joins (~GyroW@unaffiliated/gyrow) |
| 2020-10-05 19:49:18 | <int-e> | ski: Would it be useful? I probably thought it wouldn't be because you keep hopping from one IChan value to the next all the time. |
| 2020-10-05 19:49:32 | <tomsmeding> | monochrom: it does seem to work for type families indeed |
| 2020-10-05 19:50:41 | <monochrom> | ha, yahb just replaces newline by semicolon |
| 2020-10-05 19:50:52 | <tomsmeding> | "works" |
| 2020-10-05 19:51:04 | <ski> | int-e : i guess i'd be more useful, with an `uncons :: IChan a -> Maybe (a,IChan a)' |
| 2020-10-05 19:51:28 | hackage | wai-feature-flags 0.1.0.1 - Feature flag support for WAI applications. https://hackage.haskell.org/package/wai-feature-flags-0.1.0.1 (JasperWoudenberg) |
| 2020-10-05 19:51:49 | <Super_Feeling> | can someone explain what this means: "y :: Int \n y = y + 1" |
| 2020-10-05 19:51:52 | × | oisdk quits (~oisdk@2001:bb6:3329:d100:189f:9172:61d6:2b9e) (Quit: oisdk) |
| 2020-10-05 19:51:55 | → | helaoban joins (~carloholl@2603:3024:1704:300::8401) |
| 2020-10-05 19:52:01 | <ski> | (or `isEmpty :: IChan a -> Bool',`readHead :: IChan a -> a',`readTail :: IChan a -> IChan a', if you prefer) |
| 2020-10-05 19:52:07 | <Super_Feeling> | I know y is an Int, but the second line |
| 2020-10-05 19:52:10 | <tomsmeding> | Super_Feeling: it's a bottom! |
| 2020-10-05 19:52:11 | → | Franciman joins (~francesco@host-212-171-42-250.retail.telecomitalia.it) |
| 2020-10-05 19:52:14 | <ski> | Super_Feeling : `y' is defined to be itself, plus one |
| 2020-10-05 19:52:28 | <Super_Feeling> | yeah but what is y then? a function, on which i can pass a value? |
| 2020-10-05 19:52:32 | → | thir joins (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) |
| 2020-10-05 19:52:35 | <Super_Feeling> | and get the value + 1? |
| 2020-10-05 19:52:36 | <tomsmeding> | it's an integer |
| 2020-10-05 19:52:40 | → | oisdk joins (~oisdk@2001:bb6:3329:d100:189f:9172:61d6:2b9e) |
| 2020-10-05 19:52:40 | <ski> | Super_Feeling : so, `y = y + 1 = (y + 1) + 1 = ((y + 1) + 1) + 1 = ...' |
| 2020-10-05 19:52:47 | → | mirrorbird joins (~psutcliff@2a00:801:2d5:9d73:ff00:6553:d451:a276) |
| 2020-10-05 19:52:48 | <tomsmeding> | but if you try to evaluate it, you'll infinite-loop |
| 2020-10-05 19:52:49 | <Super_Feeling> | so infinite recursion |
| 2020-10-05 19:53:00 | <Super_Feeling> | got it, this is mind boggling |
| 2020-10-05 19:53:01 | <monochrom> | Ah, the user guide wording includes "type synonyms" so this is not good |
| 2020-10-05 19:53:12 | <ski> | yes, there's no finite integer `y' satisfying the equation `y = y + 1' |
| 2020-10-05 19:53:22 | <tomsmeding> | monochrom: that was indeed my point, perhaps I should've saved you the search for the right paragraph :p |
| 2020-10-05 19:53:29 | <Super_Feeling> | wow, this is a lot like those recursive definitions in math |
| 2020-10-05 19:53:36 | <tomsmeding> | ski: that's suggestive of the wrong thing |
| 2020-10-05 19:53:49 | <ski> | hm ? |
| 2020-10-05 19:53:52 | <tomsmeding> | saying "y = y * 0" will also infinite-loop, though there's certainly a solution for that one |
| 2020-10-05 19:53:58 | <dolio> | There's no infinite integer, either. :) |
| 2020-10-05 19:54:14 | <ski> | tomsmeding : yes, it wasn't an "iff" condition :) |
| 2020-10-05 19:54:19 | <tomsmeding> | fair :p |
| 2020-10-05 19:54:26 | <Super_Feeling> | it basically evaluates forever. keeps on solving for y, but y contains another "y" in the definition |
| 2020-10-05 19:54:28 | <Super_Feeling> | am i right? |
| 2020-10-05 19:54:32 | <monochrom> | Yes. |
| 2020-10-05 19:54:33 | <ski> | yes |
| 2020-10-05 19:54:34 | <tomsmeding> | > let fibo = 0 : 1 : zipWith (+) fibo (tail fibo) in take 10 fibo |
| 2020-10-05 19:54:36 | <lambdabot> | [0,1,1,2,3,5,8,13,21,34] |
| 2020-10-05 19:54:51 | <dolio> | > let y :: Integer ; y = y + 1 in y |
| 2020-10-05 19:54:53 | <monochrom> | But don't hold up your hope for "y = y * 1" either. |
| 2020-10-05 19:54:54 | <lambdabot> | *Exception: <<loop>> |
| 2020-10-05 19:55:00 | <ski> | > let ones = 1 : ones in take 10 ones |
| 2020-10-05 19:55:05 | <lambdabot> | [1,1,1,1,1,1,1,1,1,1] |
| 2020-10-05 19:55:08 | × | machinedgod quits (~machinedg@142.169.78.126) (Ping timeout: 260 seconds) |
| 2020-10-05 19:55:14 | <dolio> | GHC figured out not to take forever. |
| 2020-10-05 19:55:32 | <ski> | Super_Feeling : sometimes, such "cyclic/circular/recursive" definitions can be useful. but for `Int', they aren't |
| 2020-10-05 19:55:43 | <helaoban> | hi haskell, not sure where the right place to report this is, but there is a broken link on https://hackage.haskell.com/package/<package-name>/dependencies, at the bottom of the dependcies page for packages with flag-mediated dependencies there is supposed to be a link to cabal docs that explains how to use these flags, but it's broken. |
| 2020-10-05 19:56:03 | <ski> | helaoban : maybe #haskell-infrastructure ? |
| 2020-10-05 19:56:11 | <tomsmeding> | monochrom: where would I report this documentation inconsistency about :kind! ? |
| 2020-10-05 19:56:43 | <helaoban> | eg for https://hackage.haskell.org/package/cassava-0.5.2.0/dependencies, the link is http://www.haskell.org/cabal/users-guide/installing-packages.html#controlling-flag-assignments when it looks like it should be https://cabal.readthedocs.io/en/latest/setup-commands.html#controlling-flag-assignments |
| 2020-10-05 19:56:49 | <helaoban> | ski: cool, i'll try there |
| 2020-10-05 19:57:08 | × | thir quits (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) (Ping timeout: 244 seconds) |
| 2020-10-05 19:58:10 | <ski> | > let y :: Natural; y = 0 * y in y |
| 2020-10-05 19:58:12 | <lambdabot> | 0 |
| 2020-10-05 19:58:24 | <Super_Feeling> | ski got it. it's pretty mind boggling for me, since i am not used to such recursive definitions. thanks tho |
| 2020-10-05 19:59:13 | <ski> | Super_Feeling : note that an ordinary recursive(ly defined) function, is also a "circular definition". it's just that it happens to be done in a way that's productive |
| 2020-10-05 19:59:54 | <tomsmeding> | ski: doesn't work for me locally (loops), if Natural is from Numeric.Natural :p |
| 2020-10-05 20:00:07 | <ski> | > let factorial 0 = 1; factorial n = n * factorial (n-1) in factorial 5 |
| 2020-10-05 20:00:14 | <lambdabot> | 120 |
| 2020-10-05 20:00:20 | <Super_Feeling> | i'm not really familiar with circular definition |
| 2020-10-05 20:00:22 | <ski> | > let factorial 0 = 1; factorial n = n * factorial (n-1) in factorial 5 :: Expr |
| 2020-10-05 20:00:26 | <lambdabot> | 5 * ((5 - 1) * ((5 - 1 - 1) * ((5 - 1 - 1 - 1) * ((5 - 1 - 1 - 1 - 1) * 1)))) |
| 2020-10-05 20:00:41 | <int-e> | ski: That uncons would be in IO, I guess? |
| 2020-10-05 20:00:43 | <sep2> | https://dpaste.org/Hn8V Would I be in the right area trying to translate this over? included the def I'm trying to follow |
| 2020-10-05 20:01:03 | <monochrom> | tomsmeding: Found it: https://gitlab.haskell.org/ghc/ghc/-/issues/13795 |
| 2020-10-05 20:01:20 | <tomsmeding> | oh now you did my work again! |
| 2020-10-05 20:01:30 | <ski> | Super_Feeling : that definition of `factorial' is "cyclic/circular/recursive" (the definition is given as a "recurrence relation", to use some math terminology). the thing being defined (the "definiendum"), `factorial' is mentioned to the right of the `='s (what it's being defined as, the "definiens") |
| 2020-10-05 20:01:45 | × | nbloomf quits (~nbloomf@2600:1700:83e0:1f40:8115:8d3a:8e30:e79f) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-10-05 20:02:01 | <ski> | int-e : for `MIChan', yes, but not for `IChan' |
| 2020-10-05 20:02:05 | <monochrom> | I just had a hunch that it already existed. |
| 2020-10-05 20:02:08 | <int-e> | ski: Because this particular IChan is coneptually an endless stream... there's no end |
| 2020-10-05 20:02:25 | <ski> | ah, right. so no `Maybe' then |
| 2020-10-05 20:02:26 | <int-e> | ski: Oh you mean for comparisons. Sorry, I'm slow. |
| 2020-10-05 20:02:55 | <ski> | (i read the implementation, but then forgot again that they can't end) |
| 2020-10-05 20:03:35 | <int-e> | ski: It's not the most useful channel in existence. I just wanted to use those IVars for *something*. |
| 2020-10-05 20:04:06 | <int-e> | (I guess you can put your own end-of-stream markers on the channel though.) |
| 2020-10-05 20:04:12 | <ski> | tomsmeding : hm, try `y = y * 0' |
| 2020-10-05 20:04:33 | <tomsmeding> | ah that does work |
| 2020-10-05 20:05:56 | <ski> | int-e : i should probably try to use `IVar' for keeping track of shared nodes in a graph, and see where the pain points are .. |
| 2020-10-05 20:06:19 | → | machinedgod joins (~machinedg@142.169.78.196) |
| 2020-10-05 20:06:27 | <ski> | tomsmeding : i guess they probably changed the parameter to do induction/recursion on, at some point |
| 2020-10-05 20:07:12 | ski | was thinking, semi-recently, about which parameter is the "correct" one, to induct on, for some of the most basic arithmetic operations, .. |
| 2020-10-05 20:07:23 | × | livvy quits (~livvy@gateway/tor-sasl/livvy) (Ping timeout: 240 seconds) |
| 2020-10-05 20:07:46 | → | nbloomf joins (~nbloomf@2600:1700:83e0:1f40:507:9614:9e50:551c) |
| 2020-10-05 20:08:01 | × | L29Ah quits (~L29Ah@unaffiliated/l29ah) (Ping timeout: 258 seconds) |
| 2020-10-05 20:08:37 | × | jespada quits (~jespada@90.254.246.48) (Ping timeout: 264 seconds) |
| 2020-10-05 20:09:00 | × | geekosaur quits (42d52102@66.213.33.2) (Remote host closed the connection) |
| 2020-10-05 20:09:03 | <tomsmeding> | eh, define "correct" |
| 2020-10-05 20:09:33 | <tomsmeding> | I mean. you can even alternately recurse on both parameters to find the one that's zero fastest |
| 2020-10-05 20:09:38 | <tomsmeding> | s/\./, |
| 2020-10-05 20:10:04 | <ski> | yea, part of the exercise was to search for some reasonable meaning of "correct" :) |
| 2020-10-05 20:10:59 | → | rprije joins (~rprije@203.214.95.251) |
| 2020-10-05 20:11:03 | <tomsmeding> | I think for commutative operations, the arguments ought to be equivalent for all senses that you consider relevant |
| 2020-10-05 20:11:12 | <monochrom> | Almost sounded like you have solved the "parallel or" problem. :) (Don't worry, it doesn't solve that problem.) |
| 2020-10-05 20:11:22 | <ski> | let's take addition. you can an accumulative definition `Z + n = n; S m + n = m + S n'. or you could have the "direct" version `Z + n = n; S m + n = S (m + n)' |
All times are in UTC.