Newest at the top
2024-10-27 21:27:45 +0100 | JeremyB99 | (~JeremyB99@2607:ac80:407:7:6370:a1eb:36ff:1f8b) (Read error: Connection reset by peer) |
2024-10-27 21:27:27 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-10-27 21:26:08 +0100 | mreh | (~matthew@host86-128-2-51.range86-128.btcentralplus.com) (Quit: Lost terminal) |
2024-10-27 21:25:09 +0100 | lxsameer | (~lxsameer@Serene/lxsameer) (Ping timeout: 260 seconds) |
2024-10-27 21:24:51 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-10-27 21:23:56 +0100 | JeremyB99 | (~JeremyB99@2607:ac80:407:7:6370:a1eb:36ff:1f8b) |
2024-10-27 21:21:47 +0100 | JeremyB99 | (~JeremyB99@dhcp-251-135.resnet.purdue.edu) (Read error: Connection reset by peer) |
2024-10-27 21:19:02 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-10-27 21:18:37 +0100 | swistak | (~swistak@185.21.216.141) |
2024-10-27 21:18:19 +0100 | swistak- | (~swistak@185.21.216.141) (Ping timeout: 260 seconds) |
2024-10-27 21:14:37 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-10-27 21:13:05 +0100 | <tomsmeding> | I guess there's still the possibility of writing insertion sort, but that's not necessarily easier than the proper linear solution |
2024-10-27 21:12:53 +0100 | ljdarj1 | ljdarj |
2024-10-27 21:12:53 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 245 seconds) |
2024-10-27 21:12:37 +0100 | <tomsmeding> | ah :) |
2024-10-27 21:12:18 +0100 | <monochrom> | Oh haha this was more fun. The question already defined "sort xs = unwrap (foldMap sing xs)". So the door was closed. |
2024-10-27 21:10:04 +0100 | ljdarj1 | (~Thunderbi@user/ljdarj) ljdarj |
2024-10-27 21:06:01 +0100 | <monochrom> | I forgot. Let me check the marking scheme I wrote. |
2024-10-27 21:05:50 +0100 | <Rembane> | Just gotta have the right sorting function! |
2024-10-27 21:05:26 +0100 | <int-e> | (because of how sort is implemented) |
2024-10-27 21:05:26 +0100 | <tomsmeding> | cute :) |
2024-10-27 21:05:15 +0100 | <tomsmeding> | yes |
2024-10-27 21:05:12 +0100 | <int-e> | tomsmeding: the irony there is... if a and b are sorted, that'll be O(n) |
2024-10-27 21:05:04 +0100 | <tomsmeding> | I guess that's actually linear with Haskell's sort function |
2024-10-27 21:04:49 +0100 | <tomsmeding> | (such as: \a b -> sort (a ++ b)) |
2024-10-27 21:04:05 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-10-27 21:02:59 +0100 | <tomsmeding> | monochrom: would you accept (<>) implementations that are superlinear? |
2024-10-27 21:02:06 +0100 | <lxsameer> | tomsmeding: thank you |
2024-10-27 21:01:26 +0100 | <monochrom> | :) |
2024-10-27 21:01:16 +0100 | <tomsmeding> | thinking about this makes the reader realise why monochrom posted this as a response to stuf fabout "merging" |
2024-10-27 21:01:15 +0100 | morb | (~morb@pool-108-41-100-120.nycmny.fios.verizon.net) (Ping timeout: 246 seconds) |
2024-10-27 21:01:13 +0100 | <monochrom> | Alternatively (pun!), the specification "foldMap sing sorts the input" tells you everything you need to know. |
2024-10-27 21:00:41 +0100 | <tomsmeding> | (or something in between, but that would be a weird association order indeed) |
2024-10-27 21:00:27 +0100 | <tomsmeding> | and depending on the association order that foldMap chooses, the resulting sorting algorithm is either O(n^2) or O(n log n)? :p |
2024-10-27 20:59:45 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-10-27 20:58:44 +0100 | <tomsmeding> | pure |
2024-10-27 20:58:42 +0100 | <monochrom> | singleton. \x -> SortedList [x] |
2024-10-27 20:58:41 +0100 | <tomsmeding> | oh |
2024-10-27 20:58:34 +0100 | <tomsmeding> | mempty? |
2024-10-27 20:58:23 +0100 | <Rembane> | monochrom: Lovely! What does sing mean in this context? |
2024-10-27 20:57:54 +0100 | <Rembane> | tomsmeding: bro-algebra! |
2024-10-27 20:57:51 +0100 | <monochrom> | I legit put this question on the exam: I have a newtype wrapper SortedList over list, and we will ensure that the wrapped list must be sorted. Delightfully, the appropriate (<>) is still associative! Code up (<>) and sing so that foldMap sing sorts the input. |
2024-10-27 20:57:14 +0100 | <zzz> | yeah i just wanted to point out the possibility for misconception |
2024-10-27 20:56:40 +0100 | <tomsmeding> | almost as bad as "lift" |
2024-10-27 20:56:29 +0100 | <Rembane> | Merge is a delightfully overloaded term |
2024-10-27 20:55:32 +0100 | <tomsmeding> | I guess even Monad, from a suitably abstract point of view, but that's likely not the point of view taken when lxsameer asked that question :p |
2024-10-27 20:54:37 +0100 | <tomsmeding> | I mean, if we only have "things that can be merged", then IMO Semigroup, Alternative, MonadPlus are all relevant suggestions |
2024-10-27 20:53:39 +0100 | morb | (~morb@pool-108-41-100-120.nycmny.fios.verizon.net) |
2024-10-27 20:52:30 +0100 | <zzz> | "things that can be merged" has different meaning than Semigroup |
2024-10-27 20:52:28 +0100 | <monochrom> | Alternative would be functors that can be merged, as opposed to things that can be merged. >:) |