Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,804,049 events total
2021-08-11 11:34:32 <merijn> Lambdabot refuses to run IO
2021-08-11 11:34:34 <merijn> % print True
2021-08-11 11:34:34 <yahb> merijn: True
2021-08-11 11:34:38 × Cajun quits (~Cajun@user/cajun) (Quit: Client closed)
2021-08-11 11:35:26 <Guest46> that's very intriguing two different approaches. i suppose i'd always need a sandbox because of memory leaks
2021-08-11 11:35:53 <merijn> And possible bugs :p
2021-08-11 11:36:03 <Guest46> 'possible' is optimistic haha
2021-08-11 11:36:09 <Guest46> at least for me
2021-08-11 11:36:16 <merijn> lambdabot certainly had issues in the past
2021-08-11 11:36:41 <merijn> But it's also been around for a *long* ass time and most obvious (and obscure) exploits have been tried already :p
2021-08-11 11:37:02 <Guest46> i don't really know what i'm doing so i guess i'll just run my code in as strict a sandbox that runs the code without internet
2021-08-11 11:37:03 <merijn> For sure lambdabot was already around when I started somewhere around 2007-2009, I think
2021-08-11 11:37:19 <merijn> Guest46: In general the best approach is "don't run untrusted code" :p
2021-08-11 11:37:25 <Guest46> ahh
2021-08-11 11:37:30 <Guest46> well the idea is an educational haskell site
2021-08-11 11:37:34 <Guest46> it is pretty much part of the premise
2021-08-11 11:39:22 <Guest46> i also think it would be pretty fun to figure out how to do it, thanks i'll look into mueval :) have a nice day
2021-08-11 11:39:28 × markpythonicbitc quits (~markpytho@2601:647:5a00:35:9c61:394:eb0f:e1ed) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-08-11 11:39:37 <merijn> Guest46: RIP your sanity, then ;)
2021-08-11 11:40:00 <merijn> Guest46: Well, one thing to ask yourself is whether you need/want to, support using IO for one thing
2021-08-11 11:40:08 norias joins (~jaredm@c-98-219-195-163.hsd1.pa.comcast.net)
2021-08-11 11:40:51 <Guest46> i'll err on the side of caution and avoid running arbitrary IO until I have to
2021-08-11 11:41:53 × oxide quits (~lambda@user/oxide) (Ping timeout: 248 seconds)
2021-08-11 11:42:24 futty joins (~futty@c83-252-75-55.bredband.tele2.se)
2021-08-11 11:43:03 × Pickchea quits (~private@user/pickchea) (Ping timeout: 268 seconds)
2021-08-11 11:44:46 favonia joins (~favonia@user/favonia)
2021-08-11 11:45:01 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2021-08-11 11:45:32 Guest8443 joins (~Guest84@2406:3003:2006:447e:71a7:e07d:4b0e:e66e)
2021-08-11 11:47:51 lep is now known as lep-
2021-08-11 11:48:26 <futty> The use of the words "variant" and "invariant" is of importance in defining/designing recursion in my Haskell course and I have an understanding of them. But I cant quite define what they are, can anyone help me out?
2021-08-11 11:48:46 oxide joins (~lambda@user/oxide)
2021-08-11 11:49:25 <Guest46> do you have a specific example that you are confused about?
2021-08-11 11:49:34 <Guest46> that may help narrow down any confusions
2021-08-11 11:49:50 <merijn> futty: An "invariant" doesn't, well, vary. i.e. it's a property that is true for all possible executions
2021-08-11 11:50:58 × chomwitt quits (~chomwitt@2a02:587:dc02:6400:12c3:7bff:fe6d:d374) (Ping timeout: 240 seconds)
2021-08-11 11:51:02 <merijn> futty: I'm not sure I see "variant" very often in Haskell, tbh
2021-08-11 11:51:13 <merijn> futty: Other than it's normal English usage
2021-08-11 11:51:20 × MidAutumnHotaru quits (~MidAutumn@user/midautumnmoon) (Quit: Leaving for a break - theLounge)
2021-08-11 11:51:23 <merijn> But yeah, context would be useful
2021-08-11 11:53:17 MidAutumnHotaru joins (~MidAutumn@user/midautumnmoon)
2021-08-11 11:53:54 <futty> myReplicate :: Integer -> a -> [a]
2021-08-11 11:53:54 <futty> --variant: n
2021-08-11 11:53:55 <futty> myReplicate 0 toRep = []
2021-08-11 11:53:55 <futty> myReplicate n toRep = toRep : myReplicate (n-1) toRep
2021-08-11 11:54:31 <futty> I have a better understanding of a variant, it is literally varying and eventually pattern matching aganst a base case. That ensures function termination.
2021-08-11 11:55:13 <futty> I cant really understand invariant, it is for example found in the algorithm book when describing a sorting algorithm.
2021-08-11 11:56:21 <unrooted> Can I still somehow continue 'Stack install' even if I get 'warning: - Wdeprecations'?
2021-08-11 11:56:34 <futty> https://imgur.com/PeJvwvc
2021-08-11 11:56:35 × Vajb quits (~Vajb@2001:999:252:4e3c:27f9:d93:655e:583) (Read error: Connection reset by peer)
2021-08-11 11:56:50 kor1 joins (~kor1@user/kor1)
2021-08-11 11:56:53 × Guest46 quits (~Guest46@2a01:4b00:8099:2b00:a808:2632:c145:d901) (Quit: Client closed)
2021-08-11 11:56:58 <futty> The example of invariant. It is described in such formal language that I cant quite grasp what it is.
2021-08-11 11:57:10 <merijn> futty: A loop invariant is a property that is true for every iteration of the loop
2021-08-11 11:57:29 <merijn> futty: A property whose truth doesn't change, regardless of which iteration we're in
2021-08-11 11:57:40 <futty> If I say this:
2021-08-11 11:58:04 Vajb joins (~Vajb@hag-jnsbng11-58c3ab-85.dhcp.inet.fi)
2021-08-11 11:58:18 <futty> A variant ensures termination in a recursive function and an invariant ensures the correctness? of the algorithm in a function, would that be a correct description?
2021-08-11 11:59:30 <merijn> futty: An invariant doesn't ensure anything, it just is
2021-08-11 11:59:45 <merijn> Proving that a property is invariant my simplify other proofs
2021-08-11 12:00:11 <futty> alright, thank you guys
2021-08-11 12:00:14 × Vajb quits (~Vajb@hag-jnsbng11-58c3ab-85.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-08-11 12:00:27 Vajb joins (~Vajb@hag-jnsbng11-58c3ab-85.dhcp.inet.fi)
2021-08-11 12:01:18 Pickchea joins (~private@user/pickchea)
2021-08-11 12:01:58 × ubert quits (~Thunderbi@91.141.49.166.wireless.dyn.drei.com) (Quit: ubert)
2021-08-11 12:02:16 × spirit_ quits (~spirit@122.164.113.81) (Remote host closed the connection)
2021-08-11 12:02:22 ubert joins (~Thunderbi@91.141.49.166.wireless.dyn.drei.com)
2021-08-11 12:02:41 jneira joins (~jneira@212.8.115.226)
2021-08-11 12:05:13 × Guest8443 quits (~Guest84@2406:3003:2006:447e:71a7:e07d:4b0e:e66e) (Quit: Client closed)
2021-08-11 12:05:35 burnsidesLlama joins (~burnsides@dhcp168-023.wadham.ox.ac.uk)
2021-08-11 12:06:29 × Pickchea quits (~private@user/pickchea) (Ping timeout: 268 seconds)
2021-08-11 12:07:18 markpythonicbitc joins (~markpytho@50.228.44.6)
2021-08-11 12:08:20 × curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 268 seconds)
2021-08-11 12:09:16 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-08-11 12:09:17 tomd99 joins (~a@p200300ef97023872a00237f9722b67dc.dip0.t-ipconnect.de)
2021-08-11 12:10:23 <tomd99> Is a lambda function more strict than a normal function?
2021-08-11 12:10:29 <tomd99> > x = id True
2021-08-11 12:10:31 <tomd99> > y = (\a -> a) True
2021-08-11 12:10:31 <lambdabot> <hint>:1:3: error: parse error on input ‘=’
2021-08-11 12:10:32 <lambdabot> <hint>:1:3: error: parse error on input ‘=’
2021-08-11 12:10:33 <tomd99> > :sprint x y
2021-08-11 12:10:34 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
2021-08-11 12:10:35 <tomd99> x = _
2021-08-11 12:10:37 <tomd99> y = True
2021-08-11 12:13:08 <lortabac> tomd99: "normal" function declarations are just syntactic sugar for lambdas
2021-08-11 12:13:10 Guest71 joins (~Guest71@46.97.169.79)
2021-08-11 12:13:46 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 258 seconds)
2021-08-11 12:15:07 <lortabac> tomd99: you can try `id' = \x -> x; z = id' True` and then :sprint z
2021-08-11 12:15:11 × mc47 quits (~mc47@xmonad/TheMC47) (Read error: Connection reset by peer)
2021-08-11 12:15:50 viluon joins (uid453725@id-453725.brockwell.irccloud.com)
2021-08-11 12:17:01 <tomd99> lortabac: So naming a function adds additional indirection?
2021-08-11 12:17:56 <hpc> it's actually top-level definitions in ghci that are odd
2021-08-11 12:18:51 <hpc> when you do something like "a = True", a starts fully evaluated
2021-08-11 12:18:52 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
2021-08-11 12:19:08 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 272 seconds)
2021-08-11 12:19:20 <hpc> and you need that additional layer of id to get back to what you would normally see in a program (minus optimizations)
2021-08-11 12:20:34 tlaxkit joins (~hexchat@170.253.40.255)
2021-08-11 12:20:58 <hpc> how far it goes with that evaluation seems to stop at free variables?
2021-08-11 12:21:50 _73 joins (~user@pool-96-233-64-53.bstnma.fios.verizon.net)
2021-08-11 12:22:00 <hpc> y = (\z x -> x z) True (\x -> x)
2021-08-11 12:22:04 <hpc> y = True

All times are in UTC.