Newest at the top
2025-02-09 07:06:39 +0100 | weary-traveler | (~user@user/user363627) (Remote host closed the connection) |
2025-02-09 07:01:49 +0100 | chiselfuse | (~chiselfus@user/chiselfuse) chiselfuse |
2025-02-09 07:01:12 +0100 | chiselfuse | (~chiselfus@user/chiselfuse) (Remote host closed the connection) |
2025-02-09 06:58:18 +0100 | <ski> | (if there's parse-error, that will raise the error while the action is executed, as opposed to when the result is forced) |
2025-02-09 06:57:23 +0100 | <ski> | better to use that, rather than `getLine' & `read' |
2025-02-09 06:56:45 +0100 | <lambdabot> | Read a => IO a |
2025-02-09 06:56:45 +0100 | <ski> | @type readLn -- tri |
2025-02-09 06:49:14 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 268 seconds) |
2025-02-09 06:47:55 +0100 | <tri> | ah! thank you. It's been a long time since I last used Haskell :) |
2025-02-09 06:46:09 +0100 | <monochrom> | Conversely, I see people writing in C "return(x+y)" all the time. :) |
2025-02-09 06:45:36 +0100 | <int-e> | tri: keep in mind that in Haskell `return` is a function, not syntax. |
2025-02-09 06:44:38 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-02-09 06:44:29 +0100 | <int-e> | s/or/of/ |
2025-02-09 06:44:21 +0100 | <int-e> | (the type will then be taken from the type signature or `readList`) |
2025-02-09 06:44:14 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 244 seconds) |
2025-02-09 06:43:44 +0100 | <int-e> | you can drop the @[Int], but you still need parentheses |
2025-02-09 06:43:18 +0100 | <int-e> | the "expression of type ‘m0 a0’" I mean |
2025-02-09 06:43:01 +0100 | <int-e> | that's the m0 a0, more or less |
2025-02-09 06:42:48 +0100 | <lambdabot> | (Monad m, Read a) => m (String -> a) |
2025-02-09 06:42:47 +0100 | <int-e> | :t return read |
2025-02-09 06:42:36 +0100 | <c_wraith> | return (...) |
2025-02-09 06:42:32 +0100 | <c_wraith> | Add parens |
2025-02-09 06:42:20 +0100 | <tri> | how could I fix this please? I don't understand the error message, especially m0 and a0 |
2025-02-09 06:42:09 +0100 | <tri> | to a visible type argument ‘[Int] |
2025-02-09 06:42:09 +0100 | <tri> | Cannot apply expression of type ‘m0 a0’ |
2025-02-09 06:41:06 +0100 | <tri> | https://paste.tomsmeding.com/XPlMpEUw |
2025-02-09 06:35:00 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 264 seconds) |
2025-02-09 06:34:52 +0100 | weary-traveler | (~user@user/user363627) user363627 |
2025-02-09 06:28:07 +0100 | weary-traveler | (~user@user/user363627) (Quit: Konversation terminated!) |
2025-02-09 06:27:17 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) lisbeths |
2025-02-09 06:19:02 +0100 | Loshki | (~Loshki@c-98-42-126-198.hsd1.ca.comcast.net) (Leaving) |
2025-02-09 06:18:58 +0100 | Loshki | (~Loshki@c-98-42-126-198.hsd1.ca.comcast.net) |
2025-02-09 06:14:10 +0100 | jle` | (~jle`@2603:8001:3b00:11:8cd8:7ce2:93ee:a30) jle` |
2025-02-09 06:07:41 +0100 | jle` | (~jle`@syn-023-240-067-073.res.spectrum.com) (Quit: WeeChat 4.5.1) |
2025-02-09 06:06:27 +0100 | <tri> | hmm ok |
2025-02-09 06:01:09 +0100 | <monochrom> | Now to probe the boundary of your understanding, "g xs ys = sum (zipWith f xs ys)" can still be simplified with (.), but only as: g xs = sum . zipWith f xs |
2025-02-09 06:01:02 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
2025-02-09 05:57:46 +0100 | <tri> | so that's why zip was failing because it is a 2-input function |
2025-02-09 05:57:26 +0100 | <tri> | oh the (.) is actually a function, which takes two 1-input functions |
2025-02-09 05:56:34 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-02-09 05:55:19 +0100 | aforemny | (~aforemny@2001:9e8:6cc0:9f00:f26a:4821:630d:3b0c) (Ping timeout: 260 seconds) |
2025-02-09 05:54:10 +0100 | aforemny_ | (~aforemny@2001:9e8:6cdf:f800:9bf4:7ea7:4c6a:c80f) aforemny |
2025-02-09 05:51:33 +0100 | encyde | (~ensyde@2601:5c6:c200:6dc0::16fe) |
2025-02-09 05:47:30 +0100 | <tri> | btw I've just come back to Haskell after a long break, and still seeing you here helping people out. Thank you |
2025-02-09 05:47:13 +0100 | yegorc | (~yegorc@user/yegorc) (Quit: Leaving) |
2025-02-09 05:45:48 +0100 | <tri> | yea that works, I'm just trying to make it work using function composition. I forgot what concept force me to use 1 input function to compose, I have to look it up |
2025-02-09 05:44:02 +0100 | <monochrom> | Do you accept: getTotalDistance xs ys = sum (zipWith (\(left, right) -> abs $ left -right) xs ys) |
2025-02-09 05:43:45 +0100 | <tri> | seems like I can only compose 1 input function... |
2025-02-09 05:39:51 +0100 | dtman34 | (~dtman34@c-75-72-179-251.hsd1.mn.comcast.net) dtman34 |
2025-02-09 05:36:48 +0100 | <tri> | it has something to do with 2 parameters passing into zip, but I can't really explain |