Logs: freenode/#haskell
| 2020-11-25 18:19:22 | <PacoV> | Thanks all! |
| 2020-11-25 18:19:24 | × | PacoV quits (~pcoves@16.194.31.93.rev.sfr.net) (Quit: leaving) |
| 2020-11-25 18:19:34 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 2020-11-25 18:20:47 | × | geowiesnot quits (~user@87-89-181-157.abo.bbox.fr) (Ping timeout: 256 seconds) |
| 2020-11-25 18:20:54 | <[exa]> | hyperisco: yeah I had to afk... So basically we want something that combines 2 prisms into a traversal? (or another prism-traversal?) |
| 2020-11-25 18:21:00 | <hyperisco> | > let (^>) = liftA2 (.) in (_1 ^> _2 .~ 3) ("hello","sailor!") |
| 2020-11-25 18:21:02 | <lambdabot> | error: |
| 2020-11-25 18:21:03 | <lambdabot> | • Couldn't match type ‘[Char]’ with ‘([Char], b)’ |
| 2020-11-25 18:21:03 | <lambdabot> | arising from a functional dependency between: |
| 2020-11-25 18:21:30 | <hyperisco> | well I don't know how things work with this sort of optics |
| 2020-11-25 18:21:51 | × | alp quits (~alp@2a01:e0a:58b:4920:1ce3:597b:e8f0:d72c) (Ping timeout: 272 seconds) |
| 2020-11-25 18:22:28 | <hyperisco> | I question whether it makes sense as a traversal, I don't see how |
| 2020-11-25 18:22:34 | × | ddellacosta quits (dd@gateway/vpn/mullvad/ddellacosta) (Quit: WeeChat 2.8) |
| 2020-11-25 18:22:59 | <hyperisco> | but anyways, the result of that was (3, 3) |
| 2020-11-25 18:23:25 | <monochrom> | Do you have to use lenses and prisms? |
| 2020-11-25 18:23:57 | <hyperisco> | why wouldn't I |
| 2020-11-25 18:24:08 | <monochrom> | just checking |
| 2020-11-25 18:24:26 | <hyperisco> | I could choose not to use optics at all but I am trying to get some benefit from them |
| 2020-11-25 18:24:45 | <dolio> | I didn't read super closely, but it seemed to me that the problem with your example is that it relied on very specific knowledge of what your optics do that does not apply to all optics of the same type. |
| 2020-11-25 18:24:47 | <solonarv> | > ("hello", "sailor") & (_1 <> _2) .~ 3 |
| 2020-11-25 18:24:49 | <lambdabot> | error: |
| 2020-11-25 18:24:49 | <lambdabot> | • No instance for (Num [Char]) arising from the literal ‘3’ |
| 2020-11-25 18:24:49 | <lambdabot> | • In the second argument of ‘(.~)’, namely ‘3’ |
| 2020-11-25 18:25:06 | <solonarv> | huh, that got closer then I expected |
| 2020-11-25 18:25:14 | <solonarv> | > ("hello", "sailor") & (_1 <> _2) .~ "huh" |
| 2020-11-25 18:25:17 | <lambdabot> | ("huhhello","sailorhuh") |
| 2020-11-25 18:25:37 | <solonarv> | well that's definitely not right. |
| 2020-11-25 18:25:53 | <dolio> | So, like, just because the example would make sense doesn't mean that there must be a function to combine two optics in this way in general. |
| 2020-11-25 18:26:39 | <hyperisco> | not sure what you mean by "must"… I mean "ought" in that it seems obvious from a pragmatic point of view |
| 2020-11-25 18:26:47 | Neuromancer | is now known as BugzOOO |
| 2020-11-25 18:28:03 | <dolio> | The examples that don't make sense might prevent there from being such a function, unless you can narrow the types involved down to only the ones that do make sense. |
| 2020-11-25 18:28:41 | <hyperisco> | I haven't checked against the laws |
| 2020-11-25 18:29:06 | <hyperisco> | they seem rather immaterial to me |
| 2020-11-25 18:29:38 | × | LKoen quits (~LKoen@169.244.88.92.rev.sfr.net) (Read error: Connection reset by peer) |
| 2020-11-25 18:30:10 | → | LKoen joins (~LKoen@169.244.88.92.rev.sfr.net) |
| 2020-11-25 18:30:45 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds) |
| 2020-11-25 18:30:59 | <solonarv> | it's definitely going to be unsound because it'll produce nonsense when you give it overlapping optics |
| 2020-11-25 18:31:16 | <solonarv> | but that doesn't mean such a function can't exist, of course |
| 2020-11-25 18:32:09 | × | Er quits (5fa448e7@95.164.72.231) (Ping timeout: 245 seconds) |
| 2020-11-25 18:33:07 | × | Franciman quits (~francesco@host-82-54-193-143.retail.telecomitalia.it) (Read error: Connection reset by peer) |
| 2020-11-25 18:33:25 | → | Franciman joins (~francesco@host-82-54-193-143.retail.telecomitalia.it) |
| 2020-11-25 18:33:56 | <hyperisco> | I would guess it probably is lawful |
| 2020-11-25 18:34:20 | <hyperisco> | but I am uncomfortable talking about laws on type synonyms |
| 2020-11-25 18:34:23 | × | Iceland_jack quits (~user@31.124.48.169) (Ping timeout: 256 seconds) |
| 2020-11-25 18:35:36 | → | slack1256 joins (~slack1256@190.162.160.23) |
| 2020-11-25 18:35:39 | → | Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas) |
| 2020-11-25 18:36:12 | → | francesco_ joins (~francesco@host-82-54-193-143.retail.telecomitalia.it) |
| 2020-11-25 18:36:15 | × | Franciman quits (~francesco@host-82-54-193-143.retail.telecomitalia.it) (Read error: Connection reset by peer) |
| 2020-11-25 18:37:24 | × | cosimone quits (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) (Remote host closed the connection) |
| 2020-11-25 18:37:46 | → | cosimone joins (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) |
| 2020-11-25 18:37:50 | → | adm joins (~adm@43.229.88.197) |
| 2020-11-25 18:38:53 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 2020-11-25 18:38:58 | <slack1256> | Apart from shell scripting, what is the way to determine which package exports certain module? |
| 2020-11-25 18:39:08 | francesco_ | is now known as Franciman |
| 2020-11-25 18:39:17 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2020-11-25 18:39:29 | <dminuoso> | slack1256: hoogle? |
| 2020-11-25 18:39:49 | <dminuoso> | It's not ideal because hoogle by default only looks at some stackage resolver |
| 2020-11-25 18:39:56 | <dminuoso> | And it varies between package versions |
| 2020-11-25 18:40:11 | <jle`> | stackage maybe (stoogle), if it's on stackage |
| 2020-11-25 18:40:11 | <slack1256> | dminuoso: You're golden, thanks. |
| 2020-11-25 18:40:20 | × | justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) () |
| 2020-11-25 18:41:09 | × | grumble quits (~Thunderbi@freenode/staff/grumble) (Quit: CHANGE MY MIND: Excel is a functional programming language) |
| 2020-11-25 18:41:56 | × | adm quits (~adm@43.229.88.197) (Ping timeout: 240 seconds) |
| 2020-11-25 18:42:06 | <koz_> | stoogle? |
| 2020-11-25 18:42:07 | × | justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 260 seconds) |
| 2020-11-25 18:42:14 | <solonarv> | suppose I have 'jt = thatFunction _Just _Just' and I run 'toListOf jt (Just 3 & jt %~ succ)', I'll get [5,5]; this isn't the same as 'succ <$> (toListOf jt (Just 3'))', which is [4,4] |
| 2020-11-25 18:42:24 | <jle`> | stoogle is what i call stackage hoogle :) |
| 2020-11-25 18:42:52 | <solonarv> | the lens laws aren't formulated in terms of toListOf but still this should clearly show that 'jt' isn't a well-behaved (i.e. lawful) optic |
| 2020-11-25 18:43:28 | → | grumble joins (~Thunderbi@freenode/staff/grumble) |
| 2020-11-25 18:43:42 | <jle`> | what is thatFunction ? |
| 2020-11-25 18:44:01 | × | chaosmasttter quits (~chaosmast@p200300c4a7107e01f51a90bd3c8201d7.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
| 2020-11-25 18:44:05 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 265 seconds) |
| 2020-11-25 18:44:22 | × | LKoen quits (~LKoen@169.244.88.92.rev.sfr.net) (Read error: Connection reset by peer) |
| 2020-11-25 18:45:08 | → | LKoen joins (~LKoen@169.244.88.92.rev.sfr.net) |
| 2020-11-25 18:45:37 | <monochrom> | slack1256: "ghc-pkg find-module" can do it for what you have installed. |
| 2020-11-25 18:45:47 | → | p0a joins (~user@unaffiliated/p0a) |
| 2020-11-25 18:46:12 | <p0a> | Hello given a list of numbers such as [1,2] I'd like to generate [[1,2], [-1,2], [1,-2], [-1,-2]], all possible sign permutations |
| 2020-11-25 18:46:51 | <p0a> | I had some sort of zipWith idea in mind, and I vaguelly recall that the monadic implementation of [] is not unique, and I need the other one, not the standard one |
| 2020-11-25 18:46:59 | <slack1256> | monochrom: Magic. |
| 2020-11-25 18:47:03 | <slack1256> | Thanks monochrom. |
| 2020-11-25 18:47:04 | <monochrom> | If you add --package-db=$HOME/.cabal/store/ghc-<version>/package.db , it looks there. |
| 2020-11-25 18:47:13 | → | bergey` joins (~user@107.181.19.30) |
| 2020-11-25 18:47:24 | <jle`> | > mapM (\x -> [x,-x]) [1,2] |
| 2020-11-25 18:47:26 | <lambdabot> | [[1,2],[1,-2],[-1,2],[-1,-2]] |
| 2020-11-25 18:47:38 | <jle`> | not sure if that's helpful though :) |
| 2020-11-25 18:47:55 | <p0a> | nice! thank youl jle` that will do |
| 2020-11-25 18:48:12 | <jle`> | fwiw the Monad instance of List is unique-ish, but the Applicative is where you have other options |
| 2020-11-25 18:48:25 | <jle`> | > traverse (\x -> [x,-x]) [1,2] |
| 2020-11-25 18:48:27 | <lambdabot> | [[1,2],[1,-2],[-1,2],[-1,-2]] |
| 2020-11-25 18:48:27 | × | dhouthoo quits (~dhouthoo@ptr-eitgbj2w0uu6delkbrh.18120a2.ip6.access.telenet.be) (Quit: WeeChat 2.9) |
| 2020-11-25 18:48:31 | <jle`> | > traverse (\x -> ZipList [x,-x]) [1,2] |
| 2020-11-25 18:48:34 | <lambdabot> | ZipList {getZipList = [[1,2],[-1,-2]]} |
| 2020-11-25 18:48:43 | <p0a> | ah thank you.I think ZipList is the one I had on mind |
| 2020-11-25 18:48:55 | → | Iceland_jack joins (~user@31.124.48.169) |
| 2020-11-25 18:48:55 | × | Tario quits (~Tario@200.119.185.161) (Read error: Connection reset by peer) |
| 2020-11-25 18:50:02 | × | bergey quits (~user@pool-74-108-99-127.nycmny.fios.verizon.net) (Ping timeout: 256 seconds) |
| 2020-11-25 18:50:15 | <jle`> | trying to think of a more readable way to do it but i'm drawing a blank |
| 2020-11-25 18:50:56 | <p0a> | jle`: Well, what's the pointfree version of your lambda? :P |
| 2020-11-25 18:50:59 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection) |
| 2020-11-25 18:51:03 | <p0a> | That will make it more readable... :) |
All times are in UTC.