Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-05 13:54:25 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:f550:dcf6:fda8:5a8e) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-03-05 13:56:47 kunsttyv joins (~kunsttyv@195.93.234.11)
2021-03-05 13:57:09 <tomjaguarpaw> Does anyone have a recommendation for lens tutorial that I can give to experienced programmers with only a small amount of functional programming knowledge?
2021-03-05 13:59:23 × lokesh1197 quits (dfb0619e@223.176.97.158) (Ping timeout: 240 seconds)
2021-03-05 13:59:33 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
2021-03-05 13:59:42 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Read error: Connection reset by peer)
2021-03-05 14:00:04 <swarmcollective> tomjaguarpaw: I do not know of one directly, but Chiroptical did a video series going over the "Optics by Example" by Chris Penner ... Here's a list to the series: https://www.youtube.com/playlist?list=PLW_sOzxD_4gSyP92J-K4AwfR9Fvi6WCuV
2021-03-05 14:00:22 hahalps joins (34e59cb0@52.229.156.176)
2021-03-05 14:00:24 <swarmcollective> (With permission and participation from the author)
2021-03-05 14:00:41 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
2021-03-05 14:00:44 <SIben> tomjaguarpaw: I don't know if I can recommend that, but we have been building up to lenses in our Haskell seminar: https://nextjournal.com/uib-types/haskell-sessions/
2021-03-05 14:00:55 <SIben> I think it is digestible?
2021-03-05 14:00:59 <__monty__> Maybe the docs for one of the simpler lens libraries, like microlens or lens-simple?
2021-03-05 14:02:29 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-03-05 14:05:30 hyperisco joins (~hyperisco@d192-186-117-226.static.comm.cgocable.net)
2021-03-05 14:05:41 × hahalps quits (34e59cb0@52.229.156.176) (Quit: Connection closed)
2021-03-05 14:06:13 Tops21 joins (~Tobias@dyndsl-095-033-026-043.ewe-ip-backbone.de)
2021-03-05 14:08:07 <merijn> tomjaguarpaw: "none of them"? *ducks*
2021-03-05 14:09:33 × Tops2 quits (~Tobias@dyndsl-095-033-026-043.ewe-ip-backbone.de) (Ping timeout: 264 seconds)
2021-03-05 14:09:42 andreas303 joins (~andreas@gateway/tor-sasl/andreas303)
2021-03-05 14:11:06 <tomjaguarpaw> I'm trying to find one based on the optics abstract interface rather than van-Laarhoven lenses
2021-03-05 14:11:21 <tomjaguarpaw> I will have a look around. Maybe I will write one :D
2021-03-05 14:12:08 carlomagno joins (~cararell@148.87.23.13)
2021-03-05 14:13:14 <tomjaguarpaw> I guess the problem with VL based libraries is that the implementation leaks everywhere so every tutorial has to address the implementation from very early on
2021-03-05 14:13:24 <[exa]> tomjaguarpaw: I kindof suspect that non-functional programmers won't get much excitement from the goodies there, like "traverse is a traversal lol!"
2021-03-05 14:13:38 <swarmcollective> tomjaguarpaw: For those like me lacking sufficient understanding, what would you say the key differences are?
2021-03-05 14:13:53 <tomjaguarpaw> swarmcollective: Do you mean between optics and lens?
2021-03-05 14:13:57 × agander quits (~agander@193.46.28.55) (Ping timeout: 246 seconds)
2021-03-05 14:14:16 <tomjaguarpaw> [exa]: They don't need to have excitement, they just have to be able to understand what I wrote :D
2021-03-05 14:14:39 <[exa]> tomjaguarpaw: anyway if you don't want to overwhelm them by functors, it's best to go for many useful examples first, lenses are much more intuitive from that side
2021-03-05 14:14:52 <swarmcollective> Referring to your statement: "optics abstract interface rather than van-Laarhoven lenses", which I guess means "between optics and lens". :)
2021-03-05 14:15:47 <tomjaguarpaw> swarmcollective: In optics a lens is an abstract type rather than a function '(a -> f b) -> s -> f t' so the error messages are much better
2021-03-05 14:16:04 × mrchampion quits (~mrchampio@38.18.109.23) (Ping timeout: 260 seconds)
2021-03-05 14:16:25 <tomjaguarpaw> The abstract type is a bit less flexible, but a lot more easy to use, in my opinion
2021-03-05 14:16:37 <swarmcollective> tomjaguarpaw: thank you. Optics are on my to-do / to-learn list for this year.
2021-03-05 14:18:24 <tomjaguarpaw> Cool. I recommend starting with optics rather than lens. There's a nice introduction (but not tutorial) at https://hackage.haskell.org/package/optics-0.4/docs/Optics.html
2021-03-05 14:19:38 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 245 seconds)
2021-03-05 14:21:47 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-03-05 14:23:27 <swarmcollective> tomjaguarpaw: I've had the Subtype Hierarchy image from that page bookmarked for some time. :) Thanks for the link to the page itself! It is a good resource.
2021-03-05 14:24:38 gitgood joins (~gitgood@82-132-218-13.dab.02.net)
2021-03-05 14:24:52 × kunsttyv quits (~kunsttyv@195.93.234.11) (Read error: Connection reset by peer)
2021-03-05 14:26:10 × nemesit|znc_ quits (~nemesit@myriadvisuals.com) (Quit: ZNC 1.6.3+deb1ubuntu0.2 - http://znc.in)
2021-03-05 14:26:24 nemesit|znc joins (~nemesit@myriadvisuals.com)
2021-03-05 14:30:02 kunsttyv joins (~kunsttyv@ti0005q162-5102.bb.online.no)
2021-03-05 14:30:54 mrchampion joins (~mrchampio@38.18.109.23)
2021-03-05 14:32:03 <merijn> [exa]: tbh, I don't get much excitement from that and I *am* a functional programmer ;)
2021-03-05 14:32:28 <merijn> I think I have like 5 lines of (micro)lens code and that's mostly view/set on existing APIs :p
2021-03-05 14:32:53 × mouseghost quits (~draco@wikipedia/desperek) (Quit: mew wew)
2021-03-05 14:33:23 Sgeo joins (~Sgeo@ool-18b98aa4.dyn.optonline.net)
2021-03-05 14:36:54 bitmapper joins (uid464869@gateway/web/irccloud.com/x-anorpmpasvncoxvb)
2021-03-05 14:41:31 × geekosaur quits (82650c7a@130.101.12.122) (Quit: Connection closed)
2021-03-05 14:43:59 × gitgood quits (~gitgood@82-132-218-13.dab.02.net) (Read error: Connection reset by peer)
2021-03-05 14:47:45 ADG1089__ joins (~aditya@106.214.235.119)
2021-03-05 14:47:46 zebrag joins (~inkbottle@aaubervilliers-654-1-112-176.w86-198.abo.wanadoo.fr)
2021-03-05 14:47:58 jakalx joins (~jakalx@base.jakalx.net)
2021-03-05 14:48:09 rayyyy joins (~nanoz@gateway/tor-sasl/nanoz)
2021-03-05 14:48:14 gitgood joins (~gitgood@82-132-218-13.dab.02.net)
2021-03-05 14:51:44 <ADG1089__> I am trying to find \{x\mid x\in\Pi_iX_i, x\le L\} given that AB=\{ab\mid a\in A,b\in B\} . Currently I am using recusive function that runs in 33 sec for L=10^12 and X1, X2, ... X543 for |Xi| = 2. I tried to profile it and it spends 35% time in GC
2021-03-05 14:52:05 <merijn> ADG1089__: Code? :p
2021-03-05 14:54:43 bahamas joins (~lucian@unaffiliated/bahamas)
2021-03-05 14:55:44 <ADG1089__> https://paste.tomsmeding.com/58Gtzt5r
2021-03-05 14:58:13 <[exa]> ADG1089__: are you sure that you can filter it by factorizations when your integers are not a finite field?
2021-03-05 14:58:42 <[exa]> (or are they?)
2021-03-05 14:59:39 <[exa]> btw I guess this is euler problem 516 right?
2021-03-05 14:59:41 × ixlun quits (~user@213.205.241.12) (Ping timeout: 256 seconds)
2021-03-05 14:59:49 × bahamas quits (~lucian@unaffiliated/bahamas) (Ping timeout: 260 seconds)
2021-03-05 15:00:48 <ADG1089__> yeah
2021-03-05 15:01:04 <[exa]> (in that case the 2^32 is probably not needed directly in the code, but whatevs)
2021-03-05 15:02:00 <ADG1089__> i am guessing i can start by making fold strict
2021-03-05 15:03:38 <[exa]> I'm guessing that this might be more of a math task than a programming task
2021-03-05 15:04:21 <ADG1089__> yeah let me try binary search and prefix sums
2021-03-05 15:04:29 <ADG1089__> @t foldl1'
2021-03-05 15:04:29 <lambdabot> Maybe you meant: tell thank you thanks thesaurus thx tic-tac-toe ticker time todo todo-add todo-delete type v @ ? .
2021-03-05 15:05:03 <swarmcollective> :t foldl1'
2021-03-05 15:05:04 <lambdabot> (a -> a -> a) -> [a] -> a
2021-03-05 15:06:49 <[exa]> ADG1089__: what about using the multiplicative formula for φ(n) (first one on wiki) and just summing that up straight up?
2021-03-05 15:06:50 Pickchea joins (~private@unaffiliated/pickchea)
2021-03-05 15:07:23 × hiroaki_ quits (~hiroaki@2a02:8108:8c40:2bb8:73f8:36f6:d6d6:24a) (Ping timeout: 260 seconds)
2021-03-05 15:11:26 Deide joins (~Deide@217.155.19.23)
2021-03-05 15:15:01 <ADG1089__> [exa]: I'm not sure how infinite field creates a problem? I am actually doing phi inverse of elements in hamming
2021-03-05 15:15:27 nineonine joins (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639)
2021-03-05 15:15:43 pavonia joins (~user@unaffiliated/siracusa)
2021-03-05 15:16:24 ixlun joins (~user@213.205.241.12)
2021-03-05 15:16:49 <[exa]> ADG1089__: I thought you were actually computing over integers modulo something, where the multiplications would kindof always overflow to become <10^12
2021-03-05 15:17:00 <[exa]> which is not valid, sorry :]
2021-03-05 15:17:16 × nineonine quits (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639) (Remote host closed the connection)
2021-03-05 15:17:36 × totoro2021 quits (~t@unaffiliated/totoro2021) (Ping timeout: 240 seconds)
2021-03-05 15:18:12 nineonine joins (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639)
2021-03-05 15:18:23 × Benzi-Junior quits (~BenziJuni@88-149-67-143.du.xdsl.is) (Ping timeout: 256 seconds)
2021-03-05 15:18:56 Jd007 joins (~Jd007@162.156.11.151)
2021-03-05 15:19:04 totoro2021 joins (~t@unaffiliated/totoro2021)
2021-03-05 15:20:10 hiroaki_ joins (~hiroaki@2a02:8108:8c40:2bb8:303:be6a:2a48:3133)
2021-03-05 15:20:13 × jrqc quits (~rofl@96.78.87.197) (Ping timeout: 260 seconds)
2021-03-05 15:20:14 nbloomf joins (~nbloomf@2600:1700:ad14:3020:952:f273:f81f:c354)
2021-03-05 15:20:40 ozataman joins (~ozataman@pool-100-37-221-69.phlapa.fios.verizon.net)
2021-03-05 15:21:39 ClaudiusMaximus joins (~claude@191.123.199.146.dyn.plus.net)
2021-03-05 15:21:39 × ClaudiusMaximus quits (~claude@191.123.199.146.dyn.plus.net) (Changing host)
2021-03-05 15:21:39 ClaudiusMaximus joins (~claude@unaffiliated/claudiusmaximus)
2021-03-05 15:22:08 × ozataman quits (~ozataman@pool-100-37-221-69.phlapa.fios.verizon.net) (Client Quit)
2021-03-05 15:22:24 × zebrag quits (~inkbottle@aaubervilliers-654-1-112-176.w86-198.abo.wanadoo.fr) (Quit: Konversation terminated!)

All times are in UTC.