2024/12/21

Newest at the top

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 +0100merijn(~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 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-12-21 19:45:03 +0100rachelambda8(~rachelamb@cust-95-80-25-71.csbnet.se)
2024-12-21 19:43:44 +0100rachelambda8(~rachelamb@cust-95-80-25-71.csbnet.se) (Quit: β reduced)
2024-12-21 19:43:14 +0100Smiles(uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2024-12-21 19:41:05 +0100sprotte24(~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 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2024-12-21 19:32:54 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-12-21 19:28:13 +0100Square(~Square@user/square) Square
2024-12-21 19:27:58 +0100Square(~Square@user/square) (Client Quit)
2024-12-21 19:26:31 +0100Square(~Square@user/square) Square
2024-12-21 19:22:38 +0100Lord_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 +0100merijn(~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 +0100rachelambda8(~rachelamb@cust-95-80-25-71.csbnet.se)
2024-12-21 19:20:54 +0100weary-traveler(~user@user/user363627) (Remote host closed the connection)
2024-12-21 19:19:41 +0100Lord_of_Life_(~Lord@user/lord-of-life/x-2819915) Lord_of_Life
2024-12-21 19:19:29 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 248 seconds)
2024-12-21 19:17:28 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-12-21 19:09:47 +0100Guest78(~Guest78@37.228.252.73)
2024-12-21 19:06:57 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)