Newest at the top
2024-12-21 20:00:48 +0100 | <monochrom> | "f (g x y)" is not that hard to read and doesn't need "f $ g x y". |
2024-12-21 20:00:47 +0100 | <orangeflu> | I used to program a lot in lisp, i love parenthesis |
2024-12-21 20:00:28 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 20:00:20 +0100 | <EvanR> | someone trained to distrust haskell and doesn't know haskell sees a gratuitous use of $ and says haskell has too many operators. Someone less dumb who doesn't know haskell might see a gratuitous $ and ask, why didn't you just use parentheses there |
2024-12-21 20:00:18 +0100 | <monochrom> | Call me conservative and reactionary, but IMO today's programmers are too religious in eliminating parentheses. |
2024-12-21 19:59:46 +0100 | <mauke> | too hot |
2024-12-21 19:59:15 +0100 | <monochrom> | Hot take: $ only makes sense in the law (<*>) = liftA2 ($) |
2024-12-21 19:59:04 +0100 | <orangeflu> | i am affirming i want money, nothing to do with grouping or precedence |
2024-12-21 19:58:39 +0100 | <probie> | i$use$it$everywhere |
2024-12-21 19:58:35 +0100 | <mauke> | parentheses are usually harder to read |
2024-12-21 19:58:26 +0100 | <EvanR> | I like parentheses better, especially when it's easy to read |
2024-12-21 19:58:09 +0100 | <mauke> | $ only makes sense in non-complicated situations |
2024-12-21 19:58:01 +0100 | <EvanR> | ok well then that's also my reason |
2024-12-21 19:57:42 +0100 | <orangeflu> | Does it need to be complicated? I just like how it looks better than with paranthesis |
2024-12-21 19:56:57 +0100 | <EvanR> | it's not a complicated enough expression to require bringing another level of precedence to get the grouping across |
2024-12-21 19:56:13 +0100 | <orangeflu> | why |
2024-12-21 19:55:52 +0100 | <EvanR> | the $ there is really gratuitous |
2024-12-21 19:55:30 +0100 | <orangeflu> | matchingKeys map x = Map.keys $ Map.filter (==x) map |
2024-12-21 19:53:26 +0100 | <EvanR> | now you don't have to worry about it being too slow |
2024-12-21 19:53:18 +0100 | <EvanR> | even better |
2024-12-21 19:52:55 +0100 | <iqubic> | My map only has at most 10 key value pairs and all the values are distinct. |
2024-12-21 19:52:34 +0100 | <EvanR> | probie showed a possible incantation to use it |
2024-12-21 19:52:19 +0100 | <iqubic> | A bidirectional map would be overkill. |
2024-12-21 19:52:17 +0100 | <EvanR> | yeah Data.Map has a filter function |
2024-12-21 19:51:27 +0100 | <geekosaur> | there are bedirectional maps, but I don't know if that fits your need |
2024-12-21 19:51:14 +0100 | <lambdabot> | Data.Map.Utils flipM :: (Ord key, Ord val) => Map key val -> Map val [key] |
2024-12-21 19:51:13 +0100 | <ski> | @hoogle Map k v -> Map v [k] |
2024-12-21 19:50:49 +0100 | <iqubic> | I was just wondering if there was a helper function that did this for me, but I guess not. What I have is clean enough for my purposes. |
2024-12-21 19:49:56 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |
2024-12-21 19:49:51 +0100 | <ski> | iqubic : i think you need to iterate through all associations in the map (because they're indexed by key, not by value). if you could do with `Ord v', there might be some bimap data structure, or a `(Ord k,Ord v) => Map k v -> Map v [k]' (or `NonEmpty' instead of `[]', perhaps) |
2024-12-21 19:49:28 +0100 | <lambdabot> | Eq a => M.Map k a -> a -> [k] |
2024-12-21 19:49:26 +0100 | <probie> | :t \m x -> M.keys $ M.filter (== x) $ m |
2024-12-21 19:45:04 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 19:45:03 +0100 | rachelambda8 | (~rachelamb@cust-95-80-25-71.csbnet.se) |
2024-12-21 19:43:44 +0100 | rachelambda8 | (~rachelamb@cust-95-80-25-71.csbnet.se) (Quit: β reduced) |
2024-12-21 19:43:14 +0100 | Smiles | (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2024-12-21 19:41:05 +0100 | sprotte24 | (~sprotte24@p200300d16f1a2c0064c6ee858fd5dcfe.dip0.t-ipconnect.de) |
2024-12-21 19:37:46 +0100 | <iqubic> | "matchingKeys map x = [value | (key, value) <- M.toList map, value == x]" |
2024-12-21 19:37:43 +0100 | <iqubic> | Is there a better way to write this function: "matchingKeys :: (Eq v) => Map k v -> v -> [k]" |
2024-12-21 19:37:27 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 19:32:54 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 19:28:13 +0100 | Square | (~Square@user/square) Square |
2024-12-21 19:27:58 +0100 | Square | (~Square@user/square) (Client Quit) |
2024-12-21 19:26:31 +0100 | Square | (~Square@user/square) Square |
2024-12-21 19:22:38 +0100 | Lord_of_Life_ | Lord_of_Life |
2024-12-21 19:22:05 +0100 | <haskellbridge> | <thirdofmay18081814goya> what's the right data structure to capture both "A" and "f(e)" |
2024-12-21 19:22:00 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-12-21 19:21:51 +0100 | <haskellbridge> | <thirdofmay18081814goya> "A :: Page" contains a list of elements "[ElemType]" such that "e :: ElemType" determines a new page "f(e) :: Page" |
2024-12-21 19:21:24 +0100 | rachelambda8 | (~rachelamb@cust-95-80-25-71.csbnet.se) |
2024-12-21 19:20:54 +0100 | weary-traveler | (~user@user/user363627) (Remote host closed the connection) |