Logs: freenode/#haskell
| 2020-11-22 14:57:05 | × | halbGefressen quits (~christian@2a02:810d:f40:2a9c:40b2:2308:84bd:8b9b) (Quit: halbGefressen) |
| 2020-11-22 14:57:16 | → | geowiesnot joins (~user@87-89-181-157.abo.bbox.fr) |
| 2020-11-22 14:59:21 | × | dcoutts_ quits (~duncan@33.14.75.194.dyn.plus.net) (Ping timeout: 256 seconds) |
| 2020-11-22 15:00:07 | × | boxscape quits (54a35f37@gateway/web/cgi-irc/kiwiirc.com/ip.84.163.95.55) (Quit: Connection closed) |
| 2020-11-22 15:00:34 | × | toorevitimirp quits (~tooreviti@117.182.183.18) (Ping timeout: 246 seconds) |
| 2020-11-22 15:00:37 | → | boxscape joins (54a35f37@gateway/web/cgi-irc/kiwiirc.com/ip.84.163.95.55) |
| 2020-11-22 15:01:09 | <ski> | Feuermagier : well, one approach is to `zip' with indices, and then filter |
| 2020-11-22 15:01:27 | → | supercoven joins (~Supercove@dsl-hkibng31-54fafd-230.dhcp.inet.fi) |
| 2020-11-22 15:02:16 | <Feuermagier> | ski, interesting; maybe elemIndex zipped with thew lists. |
| 2020-11-22 15:03:52 | → | mputz joins (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de) |
| 2020-11-22 15:05:06 | <Feuermagier> | * Couldn't match expected type `[[Int]] -> Int -> Maybe (Int, Int)' |
| 2020-11-22 15:05:06 | <Feuermagier> | with actual type `Maybe a0' |
| 2020-11-22 15:05:16 | <Feuermagier> | ^why does this happen? |
| 2020-11-22 15:05:20 | <ski> | missing arguments ? |
| 2020-11-22 15:05:44 | <Feuermagier> | isn't my return Maybe (Int,Int)? |
| 2020-11-22 15:06:00 | <Feuermagier> | shouldn't i be able to just return nothing? |
| 2020-11-22 15:07:08 | → | erisco joins (~erisco@d24-57-249-233.home.cgocable.net) |
| 2020-11-22 15:07:47 | <ski> | show code ? |
| 2020-11-22 15:08:01 | <Feuermagier> | findIndex :: [[Int]] -> Int -> Maybe (Int,Int) |
| 2020-11-22 15:08:01 | <Feuermagier> | findIndex = Nothing |
| 2020-11-22 15:08:18 | <ski> | findIndex xss x = Nothing |
| 2020-11-22 15:08:45 | <Feuermagier> | *oh* |
| 2020-11-22 15:08:47 | <Feuermagier> | thx |
| 2020-11-22 15:09:04 | <ski> | (missing arguments, as i thought) |
| 2020-11-22 15:10:10 | → | Tario joins (~Tario@37.218.241.6) |
| 2020-11-22 15:11:01 | × | gagbo quits (~gagbo@unaffiliated/gagbo) (Ping timeout: 264 seconds) |
| 2020-11-22 15:11:19 | → | texasmynsted joins (~texasmyns@212.102.45.121) |
| 2020-11-22 15:12:07 | × | Tario quits (~Tario@37.218.241.6) (Read error: Connection reset by peer) |
| 2020-11-22 15:13:32 | × | bitmapper quits (uid464869@gateway/web/irccloud.com/x-pcjsdqzlpwhjwdiy) (Quit: Connection closed for inactivity) |
| 2020-11-22 15:15:12 | × | xff0x quits (~fox@2001:1a81:53fc:6700:524e:d3cd:834f:b429) (Ping timeout: 260 seconds) |
| 2020-11-22 15:15:55 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-11-22 15:16:00 | → | xff0x joins (~fox@2001:1a81:53fc:6700:7028:2716:1053:ff98) |
| 2020-11-22 15:16:56 | → | Entertainment joins (~entertain@104.246.132.210) |
| 2020-11-22 15:18:03 | × | mputz quits (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de) (Ping timeout: 256 seconds) |
| 2020-11-22 15:18:43 | → | Fractalis joins (~Fractalis@2601:987:280:8d40:eda9:f9e1:2072:cea7) |
| 2020-11-22 15:18:57 | → | mnrmnaughmnrgle joins (~mnrmnaugh@unaffiliated/mnrmnaugh) |
| 2020-11-22 15:18:58 | × | invaser quits (~Thunderbi@31.148.23.125) (Ping timeout: 260 seconds) |
| 2020-11-22 15:20:40 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 256 seconds) |
| 2020-11-22 15:23:35 | × | hekkaidekapus quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Quit: hekkaidekapus) |
| 2020-11-22 15:23:57 | → | Haskellovic joins (58d9b4d1@aftr-88-217-180-209.dynamic.mnet-online.de) |
| 2020-11-22 15:24:37 | <Haskellovic> | twoThirdsAverageWinners :: [(String, Int)] -> [String] |
| 2020-11-22 15:24:39 | <Haskellovic> | - snd (head xs)) = helper (tail xs) average ([] : fst (head xs)) (toPositiv (average - snd (head xs))) |
| 2020-11-22 15:25:27 | <Haskellovic> | Can someone tell me why the helper function expects this |
| 2020-11-22 15:25:36 | → | hekkaidekapus joins (~tchouri@gateway/tor-sasl/hekkaidekapus) |
| 2020-11-22 15:25:37 | <Haskellovic> | [([[String]], Int)] |
| 2020-11-22 15:25:41 | <Haskellovic> | for gs |
| 2020-11-22 15:26:13 | <Haskellovic> | when i want [(String, Int) |
| 2020-11-22 15:26:20 | <Haskellovic> | when i want [(String, Int)] |
| 2020-11-22 15:27:38 | × | boxscape quits (54a35f37@gateway/web/cgi-irc/kiwiirc.com/ip.84.163.95.55) (Ping timeout: 260 seconds) |
| 2020-11-22 15:30:09 | → | urodna joins (~urodna@unaffiliated/urodna) |
| 2020-11-22 15:30:41 | <Feuermagier> | how can I "unpack" a maybe? |
| 2020-11-22 15:30:57 | × | carlomagno quits (~cararell@148.87.23.4) (Remote host closed the connection) |
| 2020-11-22 15:31:23 | jess | is now known as j |
| 2020-11-22 15:31:54 | <geekosaur> | usually with pattern matching |
| 2020-11-22 15:34:06 | × | cads quits (~cads@ip-64-72-99-232.lasvegas.net) (Ping timeout: 265 seconds) |
| 2020-11-22 15:34:17 | mnrmnaughmnrgle | is now known as find |
| 2020-11-22 15:35:10 | <Feuermagier> | fromJust is what i needed. thx anyway! |
| 2020-11-22 15:35:46 | <geekosaur> | fromJust is rarely what you want |
| 2020-11-22 15:36:07 | <geekosaur> | at least if what you want includes your program not crashing |
| 2020-11-22 15:36:13 | <Feuermagier> | geekosaur, I already checked nothing earlier. It will not occur. |
| 2020-11-22 15:38:06 | → | phaul joins (~phaul@ruby/staff/phaul) |
| 2020-11-22 15:38:17 | find | is now known as awk |
| 2020-11-22 15:39:26 | <hekkaidekapus> | > maybe 0 (+ 1) <$> [Just 1, Nothing] -- Feuermagier |
| 2020-11-22 15:39:29 | <lambdabot> | [2,0] |
| 2020-11-22 15:40:43 | <Feuermagier> | hekkaidekapus, what? |
| 2020-11-22 15:41:09 | <hekkaidekapus> | > fromMaybe 0 <$> [Just 1, Nothing] |
| 2020-11-22 15:41:11 | <lambdabot> | [1,0] |
| 2020-11-22 15:41:14 | → | Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas) |
| 2020-11-22 15:41:31 | <Feuermagier> | I still have no idea what that does :D |
| 2020-11-22 15:41:38 | <Feuermagier> | what does <$> do? |
| 2020-11-22 15:41:45 | <merijn> | <$> is just fmap as operator |
| 2020-11-22 15:41:54 | <merijn> | and fmap for lists is just map |
| 2020-11-22 15:41:55 | × | tabemann quits (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) (Remote host closed the connection) |
| 2020-11-22 15:41:58 | → | kav_ joins (~kari@dsl-hkibng42-56733f-225.dhcp.inet.fi) |
| 2020-11-22 15:41:58 | × | kav_ quits (~kari@dsl-hkibng42-56733f-225.dhcp.inet.fi) (Client Quit) |
| 2020-11-22 15:42:09 | → | machinedgod joins (~machinedg@24.105.81.50) |
| 2020-11-22 15:42:58 | <hekkaidekapus> | > map (+ 1) [5 .. 9] |
| 2020-11-22 15:43:00 | <lambdabot> | [6,7,8,9,10] |
| 2020-11-22 15:43:04 | <hekkaidekapus> | > fmap (+ 1) [5 .. 9] |
| 2020-11-22 15:43:06 | <lambdabot> | [6,7,8,9,10] |
| 2020-11-22 15:43:11 | × | Haskellovic quits (58d9b4d1@aftr-88-217-180-209.dynamic.mnet-online.de) (Remote host closed the connection) |
| 2020-11-22 15:43:16 | <hekkaidekapus> | > (+ 1) <$> [5 .. 9] |
| 2020-11-22 15:43:19 | <lambdabot> | [6,7,8,9,10] |
| 2020-11-22 15:43:28 | <hekkaidekapus> | > (+ 1) `map` [5 .. 9] |
| 2020-11-22 15:43:31 | <lambdabot> | [6,7,8,9,10] |
| 2020-11-22 15:43:35 | <hekkaidekapus> | > (+ 1) `fmap` [5 .. 9] |
| 2020-11-22 15:43:37 | <lambdabot> | [6,7,8,9,10] |
| 2020-11-22 15:44:13 | → | tabemann joins (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) |
| 2020-11-22 15:44:16 | × | awk quits (~mnrmnaugh@unaffiliated/mnrmnaugh) (Quit: Leaving) |
| 2020-11-22 15:44:20 | → | cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) |
| 2020-11-22 15:44:22 | × | whatisRT quits (~whatisRT@2002:5b41:6a33:0:1094:8ebf:d3e9:e277) (Ping timeout: 260 seconds) |
| 2020-11-22 15:45:00 | → | awk joins (~mnrmnaugh@unaffiliated/mnrmnaugh) |
| 2020-11-22 15:47:00 | <Feuermagier> | I want to call a function with different arguments (1 to 10 for example). if it returns aomething else than an empty list, I want to short circuit return that. if it only returns an empty lists, I return that as well. |
| 2020-11-22 15:47:16 | <Feuermagier> | I'm sure there's a really elegant way to do this |
| 2020-11-22 15:48:01 | <hekkaidekapus> | Feuermagier: Show us what you wrote so far. |
| 2020-11-22 15:48:14 | <hekkaidekapus> | @where paste -- Feuermagier |
| 2020-11-22 15:48:14 | <lambdabot> | Help us help you: please paste full code, input and/or output at eg https://paste.tomsmeding.com |
| 2020-11-22 15:48:53 | <Feuermagier> | hekkaidekapus, sec, i'll need to formulate a simple example. |
| 2020-11-22 15:49:07 | <hekkaidekapus> | Take your time. |
| 2020-11-22 15:50:00 | → | czwartyeon joins (~czwartyeo@77-45-55-99.sta.asta-net.com.pl) |
All times are in UTC.