Logs: freenode/#haskell
| 2020-09-26 17:00:42 | → | mu_ joins (~mu@unaffiliated/mu) |
| 2020-09-26 17:00:49 | <ski> | fluturel : hm, perhaps i should also mention that normally it's not a good idea to use `!!' on lists, unless they're fairly short. the point is that random-access in (singly) linked lists is not instant, it has to traverse the list from the start to the place in question |
| 2020-09-26 17:01:17 | <ski> | so, generally, one'd work with lists in other ways .. or switching to another data-structure, if one wants more efficient random-access |
| 2020-09-26 17:01:37 | <ski> | but since you're just learning the basics, it's okay to use `!!', for now |
| 2020-09-26 17:01:40 | → | oisdk joins (~oisdk@2001:bb6:3329:d100:4c4c:f42f:20c9:6844) |
| 2020-09-26 17:02:12 | × | TooDifficult quits (~TooDiffic@106.206.110.145) (Ping timeout: 272 seconds) |
| 2020-09-26 17:02:43 | <c_wraith> | I can think of approximately one idiom where !! stays relevant, and even it is sketchy |
| 2020-09-26 17:02:47 | <fluturel> | yeah, i heard that haskell uses linked lists and figured that !! is bad for obvious reasons, but as of now, i have no other clue how to do this little exercise i challenged myself with |
| 2020-09-26 17:03:05 | <c_wraith> | but when you're starting out, as ski says. don't worry about it. |
| 2020-09-26 17:04:15 | → | jedws joins (~jedws@121.209.139.222) |
| 2020-09-26 17:04:15 | × | mu_ quits (~mu@unaffiliated/mu) (Read error: Connection reset by peer) |
| 2020-09-26 17:04:33 | → | mu_ joins (~mu@unaffiliated/mu) |
| 2020-09-26 17:05:39 | <ski> | (hm, for `Maybe' values, `fromMaybe' could possibly also be nice to use. depending on how you structure your code) |
| 2020-09-26 17:06:12 | → | v_m_v joins (~vm_v@2a02:aa12:3200:6480:f507:71a:9334:3099) |
| 2020-09-26 17:06:20 | × | mmohammadi9812 quits (~mmohammad@188.210.108.97) (Ping timeout: 256 seconds) |
| 2020-09-26 17:06:24 | × | Saten-san quits (~Saten-san@ip-213-49-124-100.dsl.scarlet.be) (Quit: WeeChat 2.8) |
| 2020-09-26 17:08:22 | <c_wraith> | ski: did you see the person asking for style advice last night who ended up refactoring a big Maybe value into being generated by a do block? I suggested it, and was happy it ended up working out so cleanly. |
| 2020-09-26 17:09:10 | × | jedws quits (~jedws@121.209.139.222) (Ping timeout: 272 seconds) |
| 2020-09-26 17:10:44 | × | keteskyl quits (~kelsey@2600:6c64:7b7f:fa42:2cda:1ff8:55be:a617) (Quit: WeeChat 2.8) |
| 2020-09-26 17:10:49 | → | svipal joins (5baf3116@91-175-49-22.subs.proxad.net) |
| 2020-09-26 17:11:23 | <Boarders> | does anyone know how with hakyll what delimiters I use for inline latex? |
| 2020-09-26 17:11:25 | <svipal> | yo |
| 2020-09-26 17:11:37 | <Boarders> | for display mode I use $$ [equations] $$ |
| 2020-09-26 17:12:02 | → | cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) |
| 2020-09-26 17:13:02 | → | Jeanne-Kamikaze joins (~Jeanne-Ka@static-198-54-131-92.cust.tzulo.com) |
| 2020-09-26 17:13:02 | × | stef204 quits (~stef204@unaffiliated/stef-204/x-384198) (Quit: WeeChat 2.9) |
| 2020-09-26 17:13:25 | <ski> | c_wraith : hm, i didn't see it. any paste link which might still be valid ? |
| 2020-09-26 17:14:09 | <c_wraith> | it's just out of my scrollback on this computer. I'd have to go to the other one and check my browser history :) |
| 2020-09-26 17:14:10 | × | mu_ quits (~mu@unaffiliated/mu) (Read error: Connection reset by peer) |
| 2020-09-26 17:14:10 | <ski> | (or approx. how many hours ago was it ?) |
| 2020-09-26 17:14:12 | → | dhil joins (~dhil@11.29.39.217.dyn.plus.net) |
| 2020-09-26 17:14:29 | <c_wraith> | so it was a bit over 10 hours ago |
| 2020-09-26 17:14:33 | → | mu_ joins (~mu@unaffiliated/mu) |
| 2020-09-26 17:15:54 | <svipal> | for some reason rtmidi ignores me changing the flags |
| 2020-09-26 17:16:01 | <svipal> | in my stack.yaml |
| 2020-09-26 17:16:07 | <svipal> | is it because it has external c bits |
| 2020-09-26 17:17:17 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-09-26 17:17:33 | → | kelsey joins (~kelsey@2600:6c64:7b7f:fa42:2cda:1ff8:55be:a617) |
| 2020-09-26 17:17:37 | <ski> | c_wraith : hm, seems to be <https://paste.tomsmeding.com/7AifjNEN>,<https://paste.tomsmeding.com/dfCZuFjh>,<https://paste.tomsmeding.com/MO0geafX> ? |
| 2020-09-26 17:17:57 | kelsey | is now known as Guest19180 |
| 2020-09-26 17:18:09 | <c_wraith> | yeah, those. The function in the third one is the rewrite |
| 2020-09-26 17:18:13 | × | turion quits (~turion@ip5f5af77e.dynamic.kabel-deutschland.de) (Quit: Leaving.) |
| 2020-09-26 17:18:41 | × | adam_wespiser quits (~adam_wesp@209.6.42.110) (Remote host closed the connection) |
| 2020-09-26 17:19:18 | → | adam_wespiser joins (~adam_wesp@209.6.42.110) |
| 2020-09-26 17:19:56 | × | Guest19180 quits (~kelsey@2600:6c64:7b7f:fa42:2cda:1ff8:55be:a617) (Client Quit) |
| 2020-09-26 17:20:20 | → | kelsey1 joins (~kelsey@2600:6c64:7b7f:fa42:2cda:1ff8:55be:a617) |
| 2020-09-26 17:21:48 | kelsey1 | is now known as keteskyl |
| 2020-09-26 17:22:06 | <ski> | c_wraith : ah, yes. that does look quite nice :) |
| 2020-09-26 17:22:22 | <c_wraith> | It's not often you get to do that, but I really enjoy when it works out. |
| 2020-09-26 17:22:36 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 2020-09-26 17:23:01 | <ski> | and the OP hopefully understood the use of `do' for `Maybe' here, and was pleased |
| 2020-09-26 17:23:15 | × | keteskyl quits (~kelsey@2600:6c64:7b7f:fa42:2cda:1ff8:55be:a617) (Client Quit) |
| 2020-09-26 17:23:30 | <c_wraith> | I mean, I suggested using a do block, but they did the rewrite themselves. Seemed plenty comfortable doing so. |
| 2020-09-26 17:23:34 | → | kelsey1 joins (~kelsey@2600:6c64:7b7f:fa42:2cda:1ff8:55be:a617) |
| 2020-09-26 17:24:08 | × | adam_wespiser quits (~adam_wesp@209.6.42.110) (Ping timeout: 260 seconds) |
| 2020-09-26 17:24:09 | × | mu_ quits (~mu@unaffiliated/mu) (Read error: Connection reset by peer) |
| 2020-09-26 17:24:33 | → | mu_ joins (~mu@unaffiliated/mu) |
| 2020-09-26 17:24:47 | × | kelsey1 quits (~kelsey@2600:6c64:7b7f:fa42:2cda:1ff8:55be:a617) (Client Quit) |
| 2020-09-26 17:25:27 | → | thir joins (~thir@p200300f27f0fc60094e773283d7bf825.dip0.t-ipconnect.de) |
| 2020-09-26 17:25:39 | ski | nods and smiles |
| 2020-09-26 17:26:09 | → | adam_wespiser joins (~adam_wesp@209.6.42.110) |
| 2020-09-26 17:31:28 | <ski> | hm, i wonder what type of board game this is, whether there can be more than one empty position |
| 2020-09-26 17:31:41 | <ski> | .. perhaps it's the "fifteen game" |
| 2020-09-26 17:31:47 | × | chaosmasttter quits (~chaosmast@p200300c4a7105f0120adba39e14d4586.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 2020-09-26 17:32:10 | → | Igloo joins (~igloo@81.2.99.210) |
| 2020-09-26 17:32:23 | <ski> | (`applyOffset' could possibly also have use of having the result in a `Maybe') |
| 2020-09-26 17:33:22 | × | adam_wespiser quits (~adam_wesp@209.6.42.110) (Ping timeout: 256 seconds) |
| 2020-09-26 17:34:28 | × | mu_ quits (~mu@unaffiliated/mu) (Read error: Connection reset by peer) |
| 2020-09-26 17:34:34 | → | mu__ joins (~mu@unaffiliated/mu) |
| 2020-09-26 17:35:10 | × | hiptobecubic quits (~john@unaffiliated/hiptobecubic) (Remote host closed the connection) |
| 2020-09-26 17:36:49 | → | ystael joins (~ystael@209.6.50.55) |
| 2020-09-26 17:37:37 | × | jb55 quits (~jb55@gateway/tor-sasl/jb55) (Remote host closed the connection) |
| 2020-09-26 17:39:14 | → | Turmfalke joins (~user@unaffiliated/siracusa) |
| 2020-09-26 17:43:57 | hackage | Frames-streamly 0.1.0.0 - A streamly layer for Frames I/O https://hackage.haskell.org/package/Frames-streamly-0.1.0.0 (adamCS) |
| 2020-09-26 17:44:04 | × | mu__ quits (~mu@unaffiliated/mu) (Read error: Connection reset by peer) |
| 2020-09-26 17:44:34 | → | mu_ joins (~mu@unaffiliated/mu) |
| 2020-09-26 17:48:26 | × | z0 quits (~z0@bl15-165-108.dsl.telepac.pt) (Quit: Lost terminal) |
| 2020-09-26 17:49:06 | × | oisdk quits (~oisdk@2001:bb6:3329:d100:4c4c:f42f:20c9:6844) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-09-26 17:49:14 | → | mmohammadi9812 joins (~mmohammad@188.210.108.97) |
| 2020-09-26 17:53:52 | <nineonine> | hey everyone |
| 2020-09-26 17:54:04 | <nineonine> | I have a function for calculating binomial coefficient |
| 2020-09-26 17:54:04 | × | mu_ quits (~mu@unaffiliated/mu) (Read error: Connection reset by peer) |
| 2020-09-26 17:54:15 | <nineonine> | binomCoef :: Double -> Double -> Double |
| 2020-09-26 17:54:15 | <nineonine> | binomCoef n k |
| 2020-09-26 17:54:15 | <nineonine> | | n < 2 = 0 |
| 2020-09-26 17:54:17 | <nineonine> | | otherwise = fact n / ((fact (n-k)) * (fact k)) |
| 2020-09-26 17:54:19 | <nineonine> | where fact m = product [1..m] |
| 2020-09-26 17:54:31 | <nineonine> | so when I play with it in ghci it works fine |
| 2020-09-26 17:54:39 | → | Achylles joins (~Achylles@200-161-190-140.dsl.telesp.net.br) |
| 2020-09-26 17:54:41 | → | mu_ joins (~mu@unaffiliated/mu) |
| 2020-09-26 17:54:52 | <nineonine> | so binomCoef 21 2 => 210.0 |
| 2020-09-26 17:55:11 | <nineonine> | but when it is used deep in my program it returns different result |
| 2020-09-26 17:55:29 | <nineonine> | it returns -17.46593177669282 for exact same arguments |
| 2020-09-26 17:55:32 | <nineonine> | I am puzzled |
| 2020-09-26 17:55:46 | × | vicfred quits (~vicfred@unaffiliated/vicfred) (Quit: Leaving) |
| 2020-09-26 17:55:46 | <nineonine> | so the question is |
| 2020-09-26 17:55:49 | <nineonine> | why? |
| 2020-09-26 17:56:58 | <nineonine> | note, that the first guard in the function is specific to the problem which I am trying to solve so please ignore it |
| 2020-09-26 17:57:26 | <nineonine> | the actual calculation is in second GRHS |
| 2020-09-26 17:57:44 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
All times are in UTC.