Newest at the top
2025-01-15 19:57:48 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds) |
2025-01-15 19:57:28 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) wootehfoot |
2025-01-15 19:56:36 +0100 | biberu | (~biberu@user/biberu) biberu |
2025-01-15 19:55:54 +0100 | telser | (~quassel@user/telser) telser |
2025-01-15 19:55:16 +0100 | euandreh | (~Thunderbi@189.6.105.228) euandreh |
2025-01-15 19:53:39 +0100 | alp | (~alp@2001:861:8ca0:4940:ce40:7d58:7e03:52f5) (Ping timeout: 252 seconds) |
2025-01-15 19:49:04 +0100 | alp | (~alp@2001:861:8ca0:4940:ce40:7d58:7e03:52f5) |
2025-01-15 19:48:50 +0100 | fun-safe-math | (~fun-safe-@2601:1c2:1b7f:801f:57f8:e679:8a1b:f20a) fun-safe-math |
2025-01-15 19:47:35 +0100 | fun-safe-math | (~fun-safe-@2601:1c2:1b7f:801f:9be8:50a:7d0a:fa49) (Quit: No Ping reply in 180 seconds.) |
2025-01-15 19:43:23 +0100 | alp | (~alp@2001:861:8ca0:4940:1e61:879a:b0ec:434f) (Ping timeout: 252 seconds) |
2025-01-15 19:42:47 +0100 | Guest12 | (~Guest12@94.7.192.138) (Remote host closed the connection) |
2025-01-15 19:41:53 +0100 | Lord_of_Life_ | Lord_of_Life |
2025-01-15 19:40:40 +0100 | <EvanR> | if the list definitely is non-empty then you can use head. Or maybe NonEmpty if there's a way to prove it to GHC |
2025-01-15 19:40:35 +0100 | akegalj | (~akegalj@142-231.dsl.iskon.hr) |
2025-01-15 19:39:27 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 244 seconds) |
2025-01-15 19:39:26 +0100 | <ash3en> | thanks! |
2025-01-15 19:38:56 +0100 | Lord_of_Life_ | (~Lord@user/lord-of-life/x-2819915) Lord_of_Life |
2025-01-15 19:38:53 +0100 | <EvanR> | if the list might be empty, then surely there's something else you want to do. In which case pattern match |
2025-01-15 19:38:06 +0100 | <EvanR> | if you thought the list was non-empty, and it's empty, you want to make up an answer and never know about it? xD |
2025-01-15 19:37:42 +0100 | <tomsmeding> | what is "the status quo" for "the first element of an empty list"? |
2025-01-15 19:37:30 +0100 | <ash3en> | probably keep the status quo |
2025-01-15 19:37:26 +0100 | <tomsmeding> | first decide that, then see how you can best express that behaviour |
2025-01-15 19:37:14 +0100 | <tomsmeding> | ash3en: what do you want to happen if the list is empty? |
2025-01-15 19:36:56 +0100 | <EvanR> | async library makes recovering a failed thread easy |
2025-01-15 19:36:50 +0100 | <ash3en> | ok, so then the other question is what to use instead of head. pattern match, uncons or non empty? |
2025-01-15 19:36:37 +0100 | <tomsmeding> | you can technically catch the exception inside IO |
2025-01-15 19:36:24 +0100 | <EvanR> | if it's the main thread everything crashes |
2025-01-15 19:36:16 +0100 | <EvanR> | the thread crashes |
2025-01-15 19:36:10 +0100 | <tomsmeding> | yes |
2025-01-15 19:36:06 +0100 | <tomsmeding> | usually, though (but not _quite_ always), it's clearer to pattern-match on the list |
2025-01-15 19:36:06 +0100 | <ash3en> | will the whole program crash on a failed tail? |
2025-01-15 19:35:54 +0100 | <EvanR> | drop 1 [] won't crash immediately, so you might not know or the crash might be somewhere else and confusing |
2025-01-15 19:35:33 +0100 | <EvanR> | which is good to know |
2025-01-15 19:35:22 +0100 | <EvanR> | if it is definitely non-empty, the tail works and will crash when you assumption is wrong |
2025-01-15 19:35:20 +0100 | <int-e> | but maybe you *have* to fail on an empty list and then `tail` is your friend |
2025-01-15 19:35:14 +0100 | <lambdabot> | *Exception: Prelude.tail: empty list |
2025-01-15 19:35:13 +0100 | <tomsmeding> | > tail [] |
2025-01-15 19:35:02 +0100 | <lambdabot> | [] |
2025-01-15 19:35:00 +0100 | <int-e> | > drop 1 [] |
2025-01-15 19:34:50 +0100 | <EvanR> | tail only works in situations where the input list is non-empty |
2025-01-15 19:34:30 +0100 | <EvanR> | I don't know about BETTER, but it has a different behavior that can be more convenient sometimes |
2025-01-15 19:33:52 +0100 | raym | (~ray@user/raym) (Ping timeout: 252 seconds) |
2025-01-15 19:32:46 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich |
2025-01-15 19:32:17 +0100 | <ash3en> | is 'drop 1' really better than 'tail'? |
2025-01-15 19:26:14 +0100 | jakesyl_____ | (sid56879@id-56879.hampstead.irccloud.com) |
2025-01-15 19:24:59 +0100 | akegalj | (~akegalj@142-231.dsl.iskon.hr) (Ping timeout: 244 seconds) |
2025-01-15 19:24:44 +0100 | jakesyl_____ | (sid56879@id-56879.hampstead.irccloud.com) (Ping timeout: 262 seconds) |
2025-01-15 19:22:22 +0100 | 068AAY72X | (~statusbot@ec2-34-198-122-184.compute-1.amazonaws.com) (Remote host closed the connection) |
2025-01-15 19:22:22 +0100 | statusbot | (~statusbot@ec2-34-198-122-184.compute-1.amazonaws.com) statusbot |
2025-01-15 19:22:22 +0100 | statusbot | 068AAY72X |