Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-08 01:28:50 _ashbreeze_ joins (~mark@72-161-252-32.dyn.centurytel.net)
2020-11-08 01:29:19 Lord_of_Life joins (~Lord@46.217.216.108)
2020-11-08 01:30:59 × elliott_ quits (~elliott_@pool-108-51-141-12.washdc.fios.verizon.net) (Ping timeout: 256 seconds)
2020-11-08 01:31:13 jedws joins (~jedws@101.184.150.81)
2020-11-08 01:31:25 × s00pcan quits (~chris@075-133-056-178.res.spectrum.com) (Ping timeout: 264 seconds)
2020-11-08 01:32:47 s00pcan joins (~chris@107.181.165.217)
2020-11-08 01:35:48 × christo quits (~chris@81.96.113.213) (Remote host closed the connection)
2020-11-08 01:36:05 × machinedgod quits (~machinedg@207.253.244.210) (Ping timeout: 240 seconds)
2020-11-08 01:37:00 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-11-08 01:41:32 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
2020-11-08 01:42:29 <jcowan> davean: So you can't just define the * method as of type Thing -> Thing -> Thing?
2020-11-08 01:43:22 machinedgod joins (~machinedg@207.253.244.210)
2020-11-08 01:43:23 <koz_> If I wanna do web scraping (or rather, tear apart HTML for pieces), what would you suggest I use?
2020-11-08 01:43:55 <koz_> jcowan: Earlier, you said 'Thing' was a type class, not a type.
2020-11-08 01:43:57 <koz_> Which is it?
2020-11-08 01:44:44 <MarcelineVQ> koz_: tagsoup or taggy prob
2020-11-08 01:45:23 <davean> jcowan: Sure, you can do it as Thing -> Thing -> Thing - but only if Thing is a type, as a type class its a *property*
2020-11-08 01:45:24 <koz_> MarcelineVQ: Thanks!
2020-11-08 01:45:34 jcowan nods
2020-11-08 01:45:43 <jcowan> Eventually this will sink into my brain, I hope, but it hasn't happened yet.
2020-11-08 01:45:48 <davean> jcowan: so you have to do it as "(Thing a, Thing b, Thing c) => a -> b -> c"
2020-11-08 01:45:57 <davean> but then you'd have to be able to return *any* c
2020-11-08 01:46:02 <davean> but you can't return any c
2020-11-08 01:46:14 <davean> you have to return the right c given a and b
2020-11-08 01:46:30 <jcowan> I know that typeclasses are *for* ad hoc polymorphism, but not how they actually work.
2020-11-08 01:46:34 <davean> if you COULD return any c, that would work - thats valid for some type classes
2020-11-08 01:46:46 <jcowan> As for example?
2020-11-08 01:47:03 <davean> well, for example we can make a IntergerIshMultuplication class
2020-11-08 01:47:36 <davean> and if it has fromInteger and toInteger available we can multiple them together (as Integers) and convert them back out to an c of that class
2020-11-08 01:48:00 <davean> Integeral a => IntegerMultiplication a
2020-11-08 01:48:18 <davean> (IntegerMultiplication a, IntegerMultiplication b, IntegerMultiplication c) => a -> b -> c
2020-11-08 01:48:39 <davean> integerMultiplicate a b = fromInteger $ toInteger a * toInteger b
2020-11-08 01:48:44 <davean> good idea? Probably not.
2020-11-08 01:48:48 <davean> but it serves as an example.
2020-11-08 01:49:36 Tsu joins (~Tsu@176.78.119.52)
2020-11-08 01:49:55 Tsu parts (~Tsu@176.78.119.52) ()
2020-11-08 01:50:18 inkbottle joins (~inkbottle@aaubervilliers-654-1-105-24.w86-212.abo.wanadoo.fr)
2020-11-08 01:51:27 × cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Quit: Goodbye)
2020-11-08 01:51:49 × zebrag quits (~inkbottle@aaubervilliers-654-1-156-243.w86-212.abo.wanadoo.fr) (Ping timeout: 264 seconds)
2020-11-08 01:53:06 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2020-11-08 01:55:00 thir joins (~thir@p200300f27f0b7e00f4e9381c2bf90854.dip0.t-ipconnect.de)
2020-11-08 01:56:46 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 258 seconds)
2020-11-08 01:59:08 × thir quits (~thir@p200300f27f0b7e00f4e9381c2bf90854.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
2020-11-08 02:01:04 <koz_> What's the recommended library to use if you want an HTTP _client_, for pulling HTML off a website?
2020-11-08 02:02:46 <davean> koz_: I certainly won't recomend it, but a lot of people like wreq
2020-11-08 02:02:50 <koz_> dave
2020-11-08 02:02:59 <koz_> davean: What would _you_ recommend then?
2020-11-08 02:03:23 <davean> Nothing in Haskell. Like its hard to even hook DNS to avoid rebind attacks.
2020-11-08 02:03:38 <koz_> So like, you suggest rolling your own?
2020-11-08 02:03:50 <davean> All I see is deficiencies and the ability to do specific types of HTTP client tasks with them.
2020-11-08 02:03:51 <koz_> Or like, borrowing curl or something?
2020-11-08 02:03:56 <davean> I'd suggest considering what youre needs are
2020-11-08 02:04:01 <davean> O
2020-11-08 02:04:12 <koz_> My needs are 'I need to pull HTML off a website, which has HTTPS'.
2020-11-08 02:04:27 <davean> I'm guessing I'd recomend wreq for your task, but there is *not* HTTP client I think in Haskell good enough to actually recomend without understanding your problem
2020-11-08 02:04:27 <koz_> Streaming would be nice, but isn't strictly required.
2020-11-08 02:04:30 <MarcelineVQ> I like req, which is different from wreq
2020-11-08 02:05:13 <davean> koz_: That doesn't answer things like "are DNS rebinding attacks a problem for you?"
2020-11-08 02:05:22 <koz_> davean: What are DNS rebinding attacks?
2020-11-08 02:05:31 <koz_> I've never heard of them.
2020-11-08 02:05:47 × Codaraxis quits (~Codaraxis@ip68-5-90-227.oc.oc.cox.net) (Remote host closed the connection)
2020-11-08 02:05:49 <MarcelineVQ> http-conduit is backed by conduit, re: streaming
2020-11-08 02:06:01 × puffnfresh quits (~puffnfres@180-150-38-83.b49626.bne.nbn.aussiebb.net) (Ping timeout: 246 seconds)
2020-11-08 02:06:12 <davean> koz_: They're a common time-of-check-to-time-of-use based attack against HTTP clients
2020-11-08 02:06:16 Codaraxis joins (~Codaraxis@ip68-5-90-227.oc.oc.cox.net)
2020-11-08 02:06:31 <davean> koz_: they work by returning different IPs for a DNS request based on the count of requests from the IP requesting resolution
2020-11-08 02:06:50 <davean> koz_: for example, causing you to request one of AWS's internal IPs and thus charge your account.
2020-11-08 02:06:59 <davean> instead of what it looked like when you checked it
2020-11-08 02:07:28 <davean> Its a very common threat against HTTP clients, and hence why I picked it as an example of Haskell HTTP client deficiencies
2020-11-08 02:07:44 <jcowan> davean: I'll study your example when I am less addled.
2020-11-08 02:07:52 <koz_> The thing is, all I know is that I'll need to scrape data off of pages, on the web, at fixed addresses.
2020-11-08 02:08:02 <koz_> It's basically 'I need data to feed to my scraper'.
2020-11-08 02:08:30 <davean> koz_: right, and if one of those happens to return a redirect, that ends up charging you money, are you happy?
2020-11-08 02:08:51 <davean> If you trust the upstream *also* that changes things for example
2020-11-08 02:08:57 <koz_> I trust the upstream in this case.
2020-11-08 02:08:59 <davean> if you think the upstream is hostile, thats an entirely diferent problem.
2020-11-08 02:09:08 <koz_> The upstream is definitely not hostile.
2020-11-08 02:09:45 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-11-08 02:10:05 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Read error: Connection reset by peer)
2020-11-08 02:11:24 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
2020-11-08 02:11:36 wei2912 joins (~wei2912@unaffiliated/wei2912)
2020-11-08 02:11:36 <koz_> And I _guess_ that I wouldn't be happy given your example (the redirect charging me money), however, I consider that highly unlikely.
2020-11-08 02:11:45 <koz_> (as in 'hell would freeze over first')
2020-11-08 02:14:39 blissful is now known as coomsayer
2020-11-08 02:15:00 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:d012:b0d5:8436:4dad) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-11-08 02:15:09 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 272 seconds)
2020-11-08 02:15:18 coomsayer is now known as blissful
2020-11-08 02:19:00 × Majiir quits (~Majiir@pool-96-237-149-35.bstnma.fios.verizon.net) (Ping timeout: 256 seconds)
2020-11-08 02:20:42 olligobber joins (~olligobbe@unaffiliated/olligobber)
2020-11-08 02:20:54 Majiir joins (~Majiir@pool-96-237-149-35.bstnma.fios.verizon.net)
2020-11-08 02:24:02 christo joins (~chris@81.96.113.213)
2020-11-08 02:24:06 × christo quits (~chris@81.96.113.213) (Remote host closed the connection)
2020-11-08 02:27:30 opticblast joins (~june@075-128-229-153.res.spectrum.com)
2020-11-08 02:29:05 Sheilong joins (uid293653@gateway/web/irccloud.com/x-wmifpqpkrhoujhbk)
2020-11-08 02:29:18 christo joins (~chris@81.96.113.213)
2020-11-08 02:31:18 × m0rphism quits (~m0rphism@HSI-KBW-095-208-098-207.hsi5.kabel-badenwuerttemberg.de) (Ping timeout: 260 seconds)
2020-11-08 02:31:22 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-11-08 02:33:41 × christo quits (~chris@81.96.113.213) (Ping timeout: 265 seconds)
2020-11-08 02:35:12 × sh9 quits (~sh9@softbank060116136158.bbtec.net) (Quit: WeeChat 2.8)
2020-11-08 02:37:56 <opticblast> Is there a good way to split a bytestream `n` bytes from its end?

All times are in UTC.