2024/10/07

Newest at the top

2024-10-07 14:35:15 +0200 <Leonard26> Say I have these values for example [0.00,0.05,0.10,0.15,0.20,0.25,0.30,0.35,0.40,0.45,0.50]
2024-10-07 14:35:14 +0200 <Leonard26> and on until the last value when it stops. How could this be achieved? =L
2024-10-07 14:35:14 +0200 <Leonard26> I have read what foldr does, I'm not sure it is what I was looking for. I have a list of values that I want to give a variable to in order. So when the function gets called the first time the first value is set for the variable, when the function gets called for the second time the second value is set, the third call sets the third value and so on
2024-10-07 14:29:56 +0200malte(~malte@mal.tc) malte
2024-10-07 14:29:52 +0200 <diod> ok, ty
2024-10-07 14:29:32 +0200CiaoSen(~Jura@2a05:5800:2e4:9e00:ca4b:d6ff:fec1:99da) CiaoSen
2024-10-07 14:29:10 +0200 <tdammers> also, you can have dependencies between functions too
2024-10-07 14:28:41 +0200 <tdammers> it's not technically needed, but it's still useful as a code organization strategy
2024-10-07 14:28:18 +0200 <diod> I was thinking functions are independent so hierarchy wouldn't be needed
2024-10-07 14:27:57 +0200morb(~morb@pool-108-41-100-120.nycmny.fios.verizon.net) (Ping timeout: 252 seconds)
2024-10-07 14:27:53 +0200 <diod> ah ok, interesting
2024-10-07 14:27:17 +0200 <tdammers> diod: just because they're not classes doesn't mean you can't have organizational hierarchies. Haskell has a decent module system, and it is commonly used for this exact purpose. Libraries and packages work pretty much like in any other language that has them.
2024-10-07 14:26:23 +0200 <tdammers> hc: pentests and external audits if there's enough of an incentive, and the client is paying for them. reviews (both of the design and the code), always. I'll also do some informal self-pen-testing usually, taking my code and approaching it with a hacker mindset, trying to break it.
2024-10-07 14:26:09 +0200 <diod> in object oriented and others classes/libraries are organized in hierarchy, what happens in haskell?
2024-10-07 14:25:50 +0200malte(~malte@mal.tc) (Ping timeout: 252 seconds)
2024-10-07 14:25:23 +0200diod(~diod@142.188.102.4) sonny
2024-10-07 14:25:03 +0200 <Leonard26> (y)
2024-10-07 14:24:15 +0200 <lambdabot> (Applicative f, Num a, Enum a) => a -> (a -> f b) -> f ()
2024-10-07 14:24:14 +0200 <Lears> :t \n -> for_ [0..n]
2024-10-07 14:23:29 +0200 <Leonard26> Thank you, I will check it out now
2024-10-07 14:23:29 +0200morb(~morb@pool-108-41-100-120.nycmny.fios.verizon.net)
2024-10-07 14:22:49 +0200alexherbo2(~alexherbo@2a02-8440-3313-f515-191c-fe44-fc95-fb26.rev.sfr.net) alexherbo2
2024-10-07 14:19:53 +0200 <__monty__> So check out `foldr`.
2024-10-07 14:19:43 +0200 <__monty__> The pattern is usually expressed as a fold, left/right/monoidal.
2024-10-07 14:19:13 +0200 <__monty__> Leonard26: Recursive functions sometimes have an accumulator argument. Which is usually used as the result when a stop condition is reached.
2024-10-07 14:17:16 +0200 <Leonard26> Hello! How are you today? :] I was wondering if there was a way to have a variable that increases over time whenever a function gets called in Haskell? Sort of like a for loop in JavaScript
2024-10-07 14:15:22 +0200Leonard26(~Leonard26@49.236.8.9)
2024-10-07 14:13:00 +0200ash3en(~Thunderbi@89.246.174.164) (Ping timeout: 252 seconds)
2024-10-07 14:12:15 +0200merijn(~merijn@77.242.116.146) (Ping timeout: 252 seconds)
2024-10-07 14:11:49 +0200comerijn(~merijn@77.242.116.146) merijn
2024-10-07 14:08:34 +0200ash3en(~Thunderbi@89.246.174.164) ash3en
2024-10-07 14:07:19 +0200ystael(~ystael@user/ystael) ystael
2024-10-07 14:06:48 +0200merijn(~merijn@77.242.116.146) merijn
2024-10-07 14:05:18 +0200merijn(~merijn@77.242.116.146) (Ping timeout: 252 seconds)
2024-10-07 14:02:50 +0200 <hc> s/step/measure/
2024-10-07 14:02:44 +0200 <hc> So may I ask, if you code commercial software in haskell, you do pentests and internal reviews of the code and otherwise rely on the type system? Or is there a step that I missed?
2024-10-07 14:02:02 +0200 <hc> Yeah; my feeling is that they're eliminating a bit the deficiencies of languages with type systems that are less expressive than haskell's, rust's or similar languages'
2024-10-07 14:01:26 +0200 <tdammers> yeah, stuff like that. it's not perfect, but static code analysis tools aren't either
2024-10-07 14:01:00 +0200 <hc> Yeah, and there's a special "static text only" string type for SQL queries
2024-10-07 14:00:29 +0200 <tdammers> e.g., you can prevent and flag incorrect HTML encoding errors (which pave the way for SQLi vulnerabilities) in Haskell by using separate HTML and plaintext types, and forcing all HTML construction from plaintext to go through a small handful of "blessed" conversion functions
2024-10-07 14:00:17 +0200 <hc> Always good to get a 2nd opinion
2024-10-07 14:00:16 +0200dlock23(~dlock23@78.red-81-40-75.staticip.rima-tde.net)
2024-10-07 14:00:11 +0200 <hc> Okay, yeah, I have a similar view on this and you're basically confirming it, thanks :-)
2024-10-07 13:59:39 +0200 <tdammers> but anyway, I guess my point is that for many of the things that would require an external tool in, say, Python or PHP, you can get similar results in Haskell by leveraging the type system
2024-10-07 13:59:28 +0200 <hc> But that's not really "standard" haskell anymore %}
2024-10-07 13:59:18 +0200 <hc> Could be, and there's ivory and tower for niche applications
2024-10-07 13:58:46 +0200 <tdammers> I'm not aware of any, but I'm sure some companies out there that use Haskell (or Rust) for Very Serious Applications will have some kind of in-house solution for that
2024-10-07 13:58:07 +0200 <hc> okok, because yeah, like you said, is there even an analysis tool out there that supports haskell? Or rust for that matter?
2024-10-07 13:58:01 +0200merijn(~merijn@77.242.116.146) merijn
2024-10-07 13:57:39 +0200merijn(~merijn@77.242.116.146) (Ping timeout: 276 seconds)