Home liberachat/#haskell: Logs Calendar

Logs on 2023-04-23 (liberachat/#haskell)

00:00:45 × ryantrinkle quits (~ryantrink@140.174.253.180) (Ping timeout: 240 seconds)
00:01:53 ryantrinkle joins (~ryantrink@140.174.253.180)
00:01:58 × califax quits (~califax@user/califx) (Remote host closed the connection)
00:04:06 califax joins (~califax@user/califx)
00:06:11 × madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Ping timeout: 264 seconds)
00:07:19 × heraldo quits (~heraldo@user/heraldo) (Quit: heraldo)
00:08:12 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
00:09:37 × masterbuilder quits (~masterbui@user/masterbuilder) (Quit: leaving)
00:09:49 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 276 seconds)
00:09:49 Lord_of_Life_ is now known as Lord_of_Life
00:10:34 masterbuilder joins (~masterbui@user/masterbuilder)
00:20:40 × waleee quits (~waleee@2001:9b0:21c:4000:5bf9:6515:c030:57b7) (Ping timeout: 252 seconds)
00:28:09 madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net)
00:31:33 × opticblast quits (~Thunderbi@172.58.85.88) (Ping timeout: 255 seconds)
00:42:30 × jero98772 quits (~jero98772@2800:484:1d84:9000::2) (Ping timeout: 265 seconds)
00:44:03 × Tuplanolla quits (~Tuplanoll@91-159-68-236.elisa-laajakaista.fi) (Quit: Leaving.)
00:49:09 merijn joins (~merijn@145.90.225.7)
00:53:35 azimut joins (~azimut@gateway/tor-sasl/azimut)
00:53:48 jero98772 joins (~jero98772@2800:484:1d84:9000::2)
01:10:52 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
01:16:59 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
01:22:37 × merijn quits (~merijn@145.90.225.7) (Ping timeout: 265 seconds)
01:26:36 slack1256 joins (~slack1256@186.11.20.9)
01:30:32 dontdieych joins (~alarm@132.226.169.184)
01:32:27 <dontdieych> Q for sqlite-simple 'execute_' function, it does not support multiple 'CREATE TABLE ...' statements that seperated by ';' string?
01:34:18 <dontdieych> execute_ conn "CREATE TABLE a ... ; CREATE TABLE b ... ;"
01:36:21 <dontdieych> I have sql file that working good with 'sqlite3 test.db < test.sql' but does not working with 'execute_ conn " ... " '. no error message.
01:40:24 tosyl joins (~user@103.206.114.87)
01:45:52 <slack1256> dontdieych: I don't recall exactly how the 'execute_' function was implemented. But you can side-steep the problem using `traverse` as `traverse_ (execute_ conn) [stmt1, stmt2, stmt3]` where the statement are each a single SQL statement.
01:49:12 <slack1256> I am doing a game using Yampa, but I am new to game development. Is it OK to redraw the whole screen each update? Does it affect if the game is 3D or 2D? Do GPUs help with this use case?
01:49:29 <slack1256> Sorry, I will ask that on #haskell-offtopic.
01:51:49 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
01:59:05 <sm> slack1256: try #haskell-game:matrix.org
01:59:22 <slack1256> sm: Thanks!
02:03:32 × accord quits (uid568320@id-568320.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
02:04:43 <dontdieych> slack1256: thanks. :D
02:07:16 slac63304 joins (~slack1256@186.11.108.135)
02:10:04 × slack1256 quits (~slack1256@186.11.20.9) (Ping timeout: 276 seconds)
02:12:47 × jero98772 quits (~jero98772@2800:484:1d84:9000::2) (Ping timeout: 264 seconds)
02:13:07 × Guest26 quits (~Guest26@85.249.45.137) (Quit: Connection closed)
02:15:01 opticblast joins (~Thunderbi@172.58.85.88)
02:15:17 × finsternis quits (~X@23.226.237.192) (Read error: Connection reset by peer)
02:19:25 × madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Ping timeout: 240 seconds)
02:24:25 × ubert quits (~Thunderbi@p548c8f0b.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
02:25:42 ubert joins (~Thunderbi@p548c93d4.dip0.t-ipconnect.de)
02:39:45 × slac63304 quits (~slack1256@186.11.108.135) (Ping timeout: 240 seconds)
02:40:16 bratwurst joins (~dfadsva@2604:3d09:207f:f650::708a)
02:40:41 × terrorjack quits (~terrorjac@2a01:4f8:c17:87f8::) (Quit: The Lounge - https://thelounge.chat)
02:41:41 terrorjack joins (~terrorjac@2a01:4f8:c17:87f8::)
02:46:13 × dontdieych quits (~alarm@132.226.169.184) (Quit: WeeChat 3.8)
02:49:15 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 255 seconds)
02:56:00 × bratwurst quits (~dfadsva@2604:3d09:207f:f650::708a) (Ping timeout: 248 seconds)
02:59:08 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds)
03:00:25 × td_ quits (~td@i5387093E.versanet.de) (Ping timeout: 240 seconds)
03:01:23 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
03:02:08 jero98772 joins (~jero98772@2800:484:1d84:9000::3)
03:02:32 td_ joins (~td@i5387093F.versanet.de)
03:07:20 Inst_ is now known as Inst
03:07:32 <Inst> What's the exact difference between an eDSL/DSL and a framework?
03:13:34 <Inst> the stack exchange definition is that eDSL / DSL has the ability to create a custom syntax, whereas a framework is trapped in its parent language's syntax
03:15:25 nate1 joins (~nate@98.45.169.16)
03:16:17 dontdieych joins (~alarm@132.226.169.184)
03:18:00 <c_wraith> an eDSL is specifically embedded in the host language. So that might be a distinction from DSL, but not eDSL
03:19:15 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
03:19:55 × jero98772 quits (~jero98772@2800:484:1d84:9000::3) (Remote host closed the connection)
03:24:39 × dontdieych quits (~alarm@132.226.169.184) (Quit: WeeChat 3.8)
03:24:56 dontdieych joins (~alarm@132.226.169.184)
03:27:45 × xff0x quits (~xff0x@ai098135.d.east.v6connect.net) (Ping timeout: 240 seconds)
03:27:46 × dontdieych quits (~alarm@132.226.169.184) (Client Quit)
03:28:04 dontdieych joins (~alarm@132.226.169.184)
03:29:35 Guest86 joins (~Guest86@85.249.45.137)
03:29:40 <Guest86> @pl bitXor a b = boolXor (toBool a) (toBool b)
03:29:40 <lambdabot> bitXor = (. toBool) . boolXor . toBool
03:29:49 xff0x joins (~xff0x@178.255.149.135)
03:30:16 <Guest86> i dont understand those dots
03:30:25 <Guest86> particularly the one in brackets
03:30:48 <Guest86> why does it apply function to first arg
03:31:00 <Guest86> how does this work
03:32:57 <sm> (E)DSLs feel like you are given a language, you are free to (and required to) express many things.
03:32:57 <sm> Frameworks provide more structure/guide rails, less freedom and (if they are a good fit) probably less work.
03:34:11 <Guest86> i am a noob
03:34:12 <Guest86> we didn't even do lambda calculus at school
03:34:12 <Guest86> can anybody please explain?
03:36:45 × xff0x quits (~xff0x@178.255.149.135) (Ping timeout: 240 seconds)
03:37:59 <sm> hi Guest86. The dots here mean "function application". The bot has compressed this code to "point free" style, which is very compact but hard for a beginner to read. Sometimes reading the dot as "after" helps.
03:39:02 xff0x joins (~xff0x@2405:6580:b080:900:696f:4e84:b735:2ed6)
03:39:07 <sm> I don't understand this particular code either, it's not human readable
03:41:37 × use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Remote host closed the connection)
03:41:56 use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf)
03:43:56 <Guest86> sm I know what point free means, thank you. I have heard that point free is sometimes considered cleaner and easier to read, so maybe it is. I think dot in brackets is a common trick and if you know it, then pointfree is far more readable
03:44:07 <probie> Guest86: ((. toBool) . boolXor . toBool) a b => ((. toBool) . boolXor) (toBool a) b => (. toBool) (boolXor (toBool a)) b => (boolXor (toBool a) . toBool) b => boolXor (toBool a) (toBool b)
03:45:28 <sm> yes, sometimes it is
03:46:03 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
03:46:09 <probie> `(# x) y` becomes `(y # x)` where `#` is some arbitrary function made up of symbols, or one in alphanumeric characters surrounded by backticks
03:46:50 <Guest86> but why?
03:47:05 <Guest86> it is just blowing my mind
03:49:22 <probie> See https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-300003.5 As a "right section" it's just defined that way
03:49:46 <Guest86> sm i found that to make the code cleaner you often need to give lambdabot a function body without the function name
03:50:32 <sm> "(call the function expression that follows, on the result of calling toBool on the next (*ie second*) argument) after calling boolXor after calling toBool on the next (*ie first*) argument"
03:50:57 jero98772 joins (~jero98772@2800:484:1d84:9000::3)
03:51:15 <Guest86> does application read parameters right to left?
03:51:45 <sm> B . A applies A, then applies B
03:52:41 <Guest86> @pl (a `rem` 2) (b `rem` 2) + (xor (a `div` 2) (b `div` 2)) * 2
03:52:41 <lambdabot> (a `rem` 2) (b `rem` 2) + xor (a `div` 2) (b `div` 2) * 2
03:53:13 <Guest86> @pl bitXor (a `rem` 2) (b `rem` 2) + (xor (a `div` 2) (b `div` 2)) * 2
03:53:13 <lambdabot> bitXor (a `rem` 2) (b `rem` 2) + xor (a `div` 2) (b `div` 2) * 2
03:53:57 <sm> so does B $ A <arg>.
03:53:57 <sm> You can write it in the other direction with &: <arg> & A & B
03:54:04 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 276 seconds)
03:54:15 <Guest86> yes, thank you @sm
03:55:40 <ski> bitXor a b = boolXor (toBool a) (toBool b)
03:56:14 <ski> = (boolXor (toBool a)) (toBool b)
03:56:25 <ski> = (boolXor (toBool a) . toBool) b
03:56:39 <ski> bitXor a = boolXor (toBool a) . toBool
03:57:05 <ski> = (. toBool) (boolXor (toBool a))
03:57:20 <ski> = ((. toBool) . boolXor . toBool) a
03:57:36 <ski> bitXor = (. toBool) . boolXor . toBool
03:58:17 <ski> that's how you derive this pointless definition of `bitXor'
03:59:23 <ski> this uses the definition of `(.)', that `f (g x)' is equal to `(f . g) x', and also uses "function extensionality", that if `f x = g x' (for all `x'), then `f = g'
04:01:14 <ski> also uses that `x # y' means the same as `(# y) x' (as well as `(x #) y', and `(#) x y'), for any infix operator `#' (`.' in the above example with `bitXor'). and that `f x y' means `(f x) y' (function application syntax in Haskell is "left associative")
04:01:34 <ski> Guest86 ^
04:02:17 <ski> for your second example, i think you need to say somethine like fooBar a b = (a `rem` 2) (b `rem` 2) + (xor (a `div` 2) (b `div` 2)) * 2
04:02:37 <ski> (but i think lambdabot's pointless answer is probably going to be rather unreadable)
04:03:17 <sm> another english translation: The three functions separated by . are called on after the other, right to left. But the first one, by being a section with the operator . on the left, gets itself called by, instead of calling, the rest.
04:09:36 × tosyl quits (~user@103.206.114.87) (Ping timeout: 248 seconds)
04:12:02 tosyl joins (~user@103.206.114.124)
04:14:14 × msavoritias quits (cb716af6b3@irc.cheogram.com) (Ping timeout: 252 seconds)
04:17:00 slack1256 joins (~slack1256@186.11.108.135)
04:17:27 <Guest86> @pl (head $ tail list) `xor` (head list) : (xorEncodeWorker $ tail list)
04:17:27 <lambdabot> head (tail list) `xor` head list : xorEncodeWorker (tail list)
04:18:15 <Guest86> xorEncodeWorker list = head (tail list) `xor` head list : xorEncodeWorker (tail list)
04:18:21 <Guest86> @pl xorEncodeWorker list = head (tail list) `xor` head list : xorEncodeWorker (tail list)
04:18:21 <lambdabot> xorEncodeWorker = fix (ap ((:) . ap (xor . head . tail) head) . (. tail))
04:18:25 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 240 seconds)
04:18:48 <Guest86> does function `fis` exist or i need to define it myself?
04:18:53 × alexherbo2 quits (~alexherbo@2a02-842a-8180-4601-21ff-3860-e26e-dd6f.rev.sfr.net) (Ping timeout: 260 seconds)
04:18:54 <Guest86> does function `fix` exist or i need to define it myself?
04:20:49 × jero98772 quits (~jero98772@2800:484:1d84:9000::3) (Remote host closed the connection)
04:21:04 <slack1256> It is on Data.Function .
04:21:22 <slack1256> Guest86: ^
04:23:57 <ski> @index fix
04:23:57 <lambdabot> Data.Function, Control.Monad.Fix
04:26:49 <Guest86> guys
04:26:49 <Guest86> this definition gives me an infinite type error
04:26:50 <Guest86> `xorDecodeWorker res [] = res`
04:26:50 <Guest86> how can i return a parameter then?
04:30:42 <ski> @let xorDecodeWorker res [] = res
04:30:44 <lambdabot> Defined.
04:30:50 <ski> not type error here
04:31:14 <ski> > xorDecodeWorker [2,3,5,7] []
04:31:16 <lambdabot> [2,3,5,7]
04:31:39 <ski> > xorDecodeWorker [1,3,4,7] [0,1,1,2]
04:31:41 <lambdabot> *Exception: /tmp/mueval8-0.hs:177:1-28: Non-exhaustive patterns in function ...
04:31:59 <ski> .. but it doesn't handle the case when the second list is non-empty
04:32:21 <Guest86> i have another line of this function but compiler gave me the error there
04:32:30 <Guest86> *on the line that i sent you
04:32:37 <Guest86> not on another one
04:32:38 <ski> Guest86 : i suspect there's some other defining equations for `xorDecodeWorker' that you didn't show us
04:32:43 <ski> no
04:32:59 <Guest86> yes there are
04:33:07 <ski> the implementation may have *discovered* the error on that defining equation. but that doesn't mean that the error is *located* there
04:33:21 <Guest86> `xorDecodeWorker res list = xorDecodeWorker (res : [(last res) `xor` (head list)]) (tail list)`
04:33:35 <ski> in fact, most likely, the error is located *nowhere*, but arises as an *inconsistency* between two (or more) locations in your source
04:33:59 <Guest86> @let xorDecodeWorker res list = xorDecodeWorker (res : [(last res) `xor` (head list)]) (tail list)
04:34:00 <ski> perhaps you means `++' rather than `:' ?
04:34:00 <lambdabot> /sandbox/tmp/.L.hs:179:29: error:
04:34:01 <lambdabot> • Occurs check: cannot construct the infinite type: a ~ [a]
04:34:01 <lambdabot> • In the expression: (last res) `xor` (head list)
04:34:23 <Guest86> oh lol
04:34:29 <Guest86> ski yes i do :)
04:34:32 <Guest86> thank you!
04:34:35 × phma quits (phma@2001:5b0:211f:5218:9152:3e57:9d1f:30e6) (Read error: Connection reset by peer)
04:34:36 <ski> nw :)
04:35:01 <ski> also .. repeatedly adding stuff to the end of a list is (needlessly) inefficient
04:35:53 <ski> in your case, it may be better to *not* use an accumulator
04:35:54 <Guest86> how else do i loop through a list?
04:36:11 <ski> alternatively .. add stuff to the front of the list, and reverse the list, *once*, in the end
04:36:16 <ski> that'd be moer efficient
04:36:49 <Guest86> how will it be more efficient
04:36:54 <Guest86> i dont understand it
04:38:03 <ski> if you do `((as ++ bs) ++ cs) ++ ds', then this has to first traverse `as' to compute `as ++ bs'. this traversal basically copies `as', putting `bs' at the end. then, it needs to traverse `as ++ bs', which, effectively, traverses `as' again, and also `bs'. then (effectively) `as' is traversed a third time, and `bs' a second time (and `cs' the first time)
04:38:45 <ski> while if you do `as ++ (bs ++ (cs ++ ds))', then the lists `as',`bs',`cs' will only be traversed once. linear time, instead of the former, which is quadratic
04:39:09 <ski> the former is "left-associated use of `++'", while the latter is "right-associated use of `++'"
04:40:12 <ski> when you replace the accumulator `res' with `res ++ stuff' as the new accumulator, then that gives rise to shapes like `((as ++ bs) ++ cs) ++ ds'. if you instead did `stuff ++ res', then it would become like `as ++ (bs ++ (cs ++ ds))' instead
04:40:22 × rf quits (~rf@2605:59c8:1604:2210:5f25:9811:549b:cf83) (Remote host closed the connection)
04:40:40 <Guest86> is using a colon (:) to add elements to the front of a lits efficient?
04:40:43 <ski> but since you get the list in the opposite order, you need to `reverse' it (once) at the end
04:40:46 <ski> yes
04:40:57 <ski> `[x] ++ xs' is the same as `x : xs'
04:41:22 <Guest86> thank you!
04:41:29 <Guest86> @pl xorDecodeWorker ((head res) `xor` (head list) : res) (tail list)
04:41:29 <lambdabot> xorDecodeWorker (head res `xor` head list : res) (tail list)
04:41:59 <ski> don't forget to add the `reverse' (in the base case, or in the caller (the wrapper) of the worker)
04:42:34 <Guest86> thank you so much!!!
04:42:36 <ski> .. but also note that in this case, i think not accumulating at all would be nicer (and just as efficient, if not more, in some use cases)
04:43:38 <Guest86> i am rewriting the python algorithm to haskell and the algorithm encodes & decodes with accumulation
04:44:06 <ski> yea .. but it's good to learn how to spot when to not accumulate, and how to do that, as well
04:44:27 <Guest86> and i dont know how to do that
04:44:44 <Guest86> can you please tech me?
04:44:53 <Guest86> s/tech/teach/
04:45:18 <ski> well, let's take a different example
04:46:11 <ski> let's say we want `runningSum [2,3,5,7] = [2,2 + 3,2 + 3 + 5,2 + 3 + 5 + 7] = [2,5,10,17]'
04:47:20 <ski> oh, i guess i should call this `runningSums', since it computes a list of all running sums
04:47:40 <ski> if you're thinking iteratively, you might think you need to keep track of two things (apart from the current list you're looking at), namely (a) the current running sum; and (b) the list of the previous running sums
04:47:47 <ski> Guest86 : does this sound reasonable to you ?
04:47:56 <Guest86> yes
04:48:05 <ski> so, we might start with something like
04:48:35 <ski> runningSums = runningSumsAcc 0 []
04:48:37 <ski> where
04:48:54 <ski> runningSumsAcc accSum accSums list = ...
04:49:01 <ski> makes sense ?
04:49:40 <ski> (we could say `runningSums list = runningSumsAcc 0 [] list' as the first defining equation, if we wanted to. but the above is shorter, and avoids naming that list)
04:51:11 <Guest86> or
04:51:11 <Guest86> runningSums numlist result counter = runningSums numlist (sum (numlist!!0..counter) : result) (counter+1)
04:51:36 <ski> yea .. but using `!!' on lists is inefficientn
04:51:41 <Guest86> @let runningSums numlist result counter = runningSums numlist (sum (numlist!!0..counter) : result) (counter+1)
04:51:41 <lambdabot> Parse failed: Parse error: ..
04:51:47 <Guest86> what
04:51:56 <ski> > [0 .. 7]
04:51:57 <lambdabot> [0,1,2,3,4,5,6,7]
04:52:11 <Guest86> so haskell does not have slices?
04:52:36 <Guest86> then i will go with your example
04:52:42 phma joins (phma@2001:5b0:2143:c788:d2b8:a200:d590:bdcb)
04:52:47 <ski> > [[2,3,5,7,11,13,17,19] !! i | i <- [3 .. 5]]
04:52:49 <lambdabot> [7,11,13]
04:53:40 <ski> > (take (5-3+1) . drop 3) [2,3,5,7,11,13,17,19]
04:53:42 <lambdabot> [7,11,13]
04:54:13 <ski> .. anyway
04:54:40 <ski> we need one case for the empty list, and one for non-empty lists
04:55:15 <ski> since we intend to add stuff to the front of the `accSums' list (since that's more efficient), it'll end up in the wrong order, and so we need to `reverse' it in the end (base case)
04:55:19 <ski> that gives us
04:55:40 <ski> runningSumsAcc accSum accSums [ ] = reverse accSums
04:56:30 <ski> in the non-empty case, we have some list `x:xs', so we need to add `x' to the accumulating (/running) sum, `accSum', and also add the (new) sum in front of `accSums'
04:57:03 <ski> runningSumsAcc accSum accSums (x:xs) = runningSumsAcc accSum' (accSum' : accSums) xs
04:57:07 <ski> where
04:57:13 <ski> accSums' = accSum + x
04:57:20 <ski> Guest86 : makes sense ?
04:57:23 <Inst> c_wraith: it turns out that in mainstream programming, framework mania was a thing
04:57:36 <Guest86> ski yes it does
04:57:46 <Inst> then you add it to, was it Gabriella Gonzalez or perhaps Alexis King who proposed it, that the future of programming is a bunch of eDSLs
04:58:06 <Inst> and Gabriella Gonzalez brought up that Haskell (along with the rest of the FP languages is excellent for implementing eDSLs)
04:58:14 <ski> Inst : iiuc, "frameworks" often involve you plugging your code "into" some loop or other that the framework provides, so the framework runs outside your code (rather than the other way around)
04:58:32 <Inst> ski: it's the solution to my peeve of Haskell's IO code being a bit too verbose for my tastes
04:58:40 <Inst> just get a framework, what's the problem
04:58:48 ski doesn't really follow
04:59:10 <Inst> i mean that complaining about having too much IO code, or having difficulties managing separation of pure vs impure code
04:59:15 <ski> Guest86 : ok. now consider if we try to make a "direct recursive solution", instead, practicing "recursive thinking", rather than "iterative thinking"
04:59:18 <Inst> the solution for that is just to get a framework
04:59:31 <ski> mhm
04:59:35 <Guest86> yes
04:59:38 <Guest86> but how
04:59:47 <ski> Guest86 : so, we go back to `runninSums list'
05:00:24 <ski> we have two cases, as usual (not always the right thing to do, when doing recursion on lists, but most commonly is), empty vs. non-empty
05:00:31 <Inst> leaving, but leaving this here, which is relevant to my interests, but perhaps not yours: https://www.youtube.com/watch?v=O-z8hDXIQSg . Interestingly enough, they actually attempted Rust, starting with a Python project, couldn't grok it, then ran to Haskell instead and their project worked.
05:00:31 <ski> so, we have a code template looking like
05:00:42 <ski> runningSums [ ] = ...
05:00:53 <ski> runningSums (x:xs) = ..x..xs..
05:01:32 <ski> (where the dots indicate code we have't written yet, that's yet to be filled in. the variable names in there indicate (suggest) that we may use those variables to fill in those "holes")
05:02:36 jmilan joins (~jmilan@195.242.182.249)
05:03:52 <ski> Guest86 : now, the main thing, with recursive solutions, is "wishful thinking". we imagine that the function will work correctly, for *smaller* inputs (in out case, that means shorter lists). so we need to (a) divide the problem to solve up into smaller subproblem(s) (of the same kind); (b) trust that those subproblems will yield the correct answers; (c) put together those answers with our inputs (and
05:03:58 <ski> previous local variables, if any), to compute the desired answer to the *current* problem
05:04:04 <ski> it's good here to consider a particular case/example
05:04:17 <ski> runningSums [2,3,5,7]
05:04:21 <ski> this is the same as
05:04:26 <ski> runningSums (2:[3,5,7])
05:04:46 <ski> so `x' will become `2', and `xs' will become `[3,5,7]', in our template code above
05:04:52 <ski> Guest86 : making sense, so far ?
05:06:03 <Guest86> ye
05:06:06 <ski> ok
05:06:06 <Guest86> s
05:06:18 × slack1256 quits (~slack1256@186.11.108.135) (Remote host closed the connection)
05:06:35 <ski> so, `xs' here (`[3,5,7]') is a "smaller" input than our "current" input, `[2,3,5,7]'
05:07:00 <ski> so, `runningSums [3,5,7]' would therefore be a *subproblem* of the current problem (example) `runningSums [2,3,5,7]'
05:07:18 × jmilan quits (~jmilan@195.242.182.249) (Ping timeout: 260 seconds)
05:07:30 <ski> so, it's therefore relevant to ask if we could use the result from that subproblem, to get the desired result of the current problem
05:07:37 <ski> well, we know that we *want* to get results
05:07:38 <Guest86> so like this?
05:07:39 <Guest86> runningSums' (x:[]) res = ((head res) + (x)):res
05:07:40 <Guest86> runningSums' (x:xs) res = runningSums' xs (((head res) + x):res)
05:07:50 <ski> runningSum [2,3,5,7] = [2,5,10,17]
05:07:52 <ski> as well as
05:08:11 <ski> runningSum [3,5,7] = [3,8,15]
05:09:08 <ski> hm, looks like you're still thinking in terms of an extra accumulator argument
05:09:18 <Guest86> excuse me but can we use pattern matching to get init and last of the list?
05:09:24 <ski> while i'm talking about making ado, *without* any extra argument
05:09:31 <ski> not really
05:09:41 <ski> @src init
05:09:41 <lambdabot> init [x] = []
05:09:41 <lambdabot> init (x:xs) = x : init xs
05:09:41 <lambdabot> init [] = error "Prelude.init: empty list"
05:09:45 <ski> @src last
05:09:45 <lambdabot> last [x] = x
05:09:45 <lambdabot> last (_:xs) = last xs
05:09:45 <lambdabot> last [] = error "Prelude.last: empty list"
05:10:02 <ski> these are defined by pattern-matching, and (necessarily) must traverse the whole list
05:10:24 <ski> you can access the head directly, and also the tail
05:10:42 <ski> because lists are single linked lists, linked from the start towards the end
05:11:43 <ski> something like your runningSums' probably would work, btw .. but it's still using accumulators, which isn't was i was attempting to go for, here
05:12:03 <ski> Guest86 : should i continue ?
05:12:42 <ski> (oh, and `x:[]' can of course be written more shortly as `[x]', as those `init' and `last' definitions do it)
05:13:35 <ski> (your runningSums' also has code duplication, repeated code .. generally, it's a nice idea to try to avoid that ("DRY","Don't Repeat Yourself"))
05:15:17 <ski> (`init' and `last' are also examples of not using the pattern of empty-vs-nonempty when traversing lists, but rather, in this case, singleton-vs-longer (empty case can be checked once, at the start))
05:17:08 trev joins (~trev@user/trev)
05:17:35 <ski> (another somewhat common case is to look at two adjacent elements of the input list at the same time, like `foo (x0:x1:xs) = ..x0..x1..(foo (x1:xs))..', which can also be written `foo (x0:xs@(x1:_)) = ..x0..x1..(foo xs)..' .. `l@(h:t)' is a pattern that names the list `l', while simultaneously naming the head and tail `h' and `t')
05:17:40 ski looks at Guest86
05:18:39 ski goes for a cuppa tea
05:24:45 JSkilton joins (~JSkilton@149.19.169.187)
05:32:53 t0ngub1n joins (~t0ngub1n@85.249.45.137)
05:36:27 msavoritias joins (cb716af6b3@irc.cheogram.com)
05:39:03 <t0ngub1n> hey @ski! it's me, guest86 under another account
05:39:19 <t0ngub1n> sorry for being away for that lng
05:39:24 <JSkilton> Hey jigaboo lover t0ngub1n
05:39:37 <JSkilton> Mrs. Skilton gets her holes filled and satisified by Rush's Geddy Lee. Later, Geddy meets Jean Pierre Manikariza, her husband, and gets filled by his big black cock! Read all about it! https://pastebin.com/1ExdrDQA
05:40:06 <t0ngub1n> what the
05:40:26 ChanServ sets mode +o geekosaur
05:40:33 <t0ngub1n> first of all, they are not jigaboos
05:40:34 geekosaur sets mode +b *!*@149.19.169.187
05:40:34 JSkilton is kicked by geekosaur (JSkilton)
05:46:55 Feuermagier joins (~Feuermagi@user/feuermagier)
05:49:07 gnulinuxuser joins (~gnulinuxu@user/gnulinuxuser)
05:50:07 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
05:51:46 rodox64 joins (~rodox64@187.252.200.83)
05:52:16 geekosaur sets mode -o geekosaur
05:52:30 <ski> (K-lined)
05:52:49 <geekosaur> I just bet
05:52:51 <ski> t0ngub1n : okay
05:53:02 <geekosaur> I presume the pastebin link is a chrome 0day exploit
05:53:23 <geekosaur> since we've had 2 in as many weeks
05:54:03 ski was looking into it, in another channel, but the K-line preempted
05:54:11 <Sauvin> yeah, we've had a few in a few different channels.
05:54:25 rodox64 parts (~rodox64@187.252.200.83) ()
05:55:01 <ski> t0ngub1n : do tell, if you'd like me to continue
05:55:48 <t0ngub1n> yes i would
05:55:50 <t0ngub1n> thank you
05:56:08 <ski> well, okay
05:56:25 <ski> so we were looking at
05:56:31 <ski> runningSums [ ] = ...
05:56:34 <ski> runningSums (x:xs) = ..x..xs..
05:56:56 <ski> and obviously the running sums of the empty list is the empty list, so the base case is just
05:56:59 <ski> runningSums [ ] = []
05:57:20 <t0ngub1n> yes
05:57:26 takuan joins (~takuan@178-116-218-225.access.telenet.be)
05:57:30 <ski> and, considering the example `runningSums [2,3,5,7]', the second defining equation would give us
05:57:33 <ski> x = 2
05:57:38 <ski> xs = [3,5,7]
05:58:30 <ski> so that `runningSums [3,5,7]' (or `runningSums xs', in terms of the code of the second defining equation) would seem like a reasonable subproblem to investigate whether it might help to achieve the solution for our current problem
05:58:46 <t0ngub1n> and if we run runningSums xs we get xs = 5,7
05:58:49 <ski> the answer's we're looking to get for these two problems being
05:59:09 <ski> runningSums [2,3,5,7] = [2,5,10,17]
05:59:24 <ski> runningSums [3,5,7] = [3, 8,15]
05:59:49 <t0ngub1n> and we can create the third case
05:59:54 <ski> t0ngub1n : yes .. but, it's generally not that helpful to try to "trace out" the recursion further "steps down"
06:00:06 <t0ngub1n> runningSums (x:y:[])
06:00:44 <ski> instead, we should just trust that if we take `runningSumS xs' as a recursive call (with `xs = [3,5,7]' in our example), that that will do its thing, however it wants to, computing the correct desired answer, which would be `[3,8,15]'
06:01:05 <ski> there's no need for a third defining equation, here
06:02:10 <ski> so, atm, we're looking how to bridge the gap from the answer to the subproblem, being `[3,8,15]', to the desired answer to the current problem, being `[2,5,10,17]', possibly also using `x = 2' and `xs = [3,5,7]' in that bridging
06:02:19 <ski> t0ngub1n : is the question clear ?
06:02:31 <t0ngub1n> yes
06:02:33 <ski> ok
06:02:38 <t0ngub1n> working on it rn
06:02:40 <ski> well, we might notice that
06:03:49 <ski> [5,10,17] = [2 + 3,2 + 8,2 + 15]
06:04:04 <ski> which is pretty close to `[3,8,15]'
06:04:54 <ski> and if we add `x = 2' on front of that (former) list, we'll get the desired answer `[2,5,10,17]'
06:08:16 × euandreh quits (~Thunderbi@189.6.18.7) (Ping timeout: 265 seconds)
06:08:30 ski looks at t0ngub1n
06:08:57 <t0ngub1n> i dont get how we get [5,10,17]
06:09:02 <t0ngub1n> trying to figure it out
06:10:00 <ski> you try to connect `runningSums [2,3,5,7]' (current problem (example)) to `runningSums [3,5,7]' (subproblem)
06:11:13 <ski> the latter is `[3,8,15]', and the former is `[2,5,10,17]', which happens to be `[2,2 + 3,2 + 8,2 + 15]', or `2 : [2 + 3,2 + 8,2 + 15]' .. you could further massage that one, to make it contain `[3,8,15]' exactly as a part
06:11:30 jmilan joins (~jmilan@195.242.182.249)
06:11:42 <ski> (.. you could use a list comprehension, or you could use a call to the `Prelude' function `map')
06:12:31 × ryantrinkle quits (~ryantrink@140.174.253.180) (Ping timeout: 276 seconds)
06:12:38 × use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Remote host closed the connection)
06:13:19 use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf)
06:13:37 <t0ngub1n> does `map` return a list or a map?
06:13:42 <ski> a list
06:13:52 <ski> > map (^ 2) [2,3,5,7]
06:13:53 <lambdabot> [4,9,25,49]
06:14:02 <t0ngub1n> ty
06:15:12 <ski> (i guess it's called `map', since it "maps" the input function over each of the elements of the given list, collecting the results into a result list)
06:15:58 <t0ngub1n> the python3 map returns a special map type
06:16:03 <t0ngub1n> that is why i was confused
06:16:08 <t0ngub1n> python2 does not
06:16:58 <ski> .. i could go on, trying to explain how one can think, to finish the second (recursive) defining equation of `runningSums' here. but it seemed like you were maybe thinking on your own a little about how to do that, and i wouldn't like to spoil that for you, if you'd like to try for a bit
06:17:14 <ski> .. but if you want, i could go on with my explanation
06:17:54 <ski> (there's also a `Map' type in Haskell .. but you need to import the `Data.Map' module for that .. and there's no reason to do so, for this example problem)
06:19:01 <t0ngub1n> runningSums [] = []
06:19:01 <t0ngub1n> runningSums (x:y:[]) = [x, x + y]
06:19:01 <t0ngub1n> runningSums (x:xs) = x : (map (+x) $ runningSums xs)
06:19:24 <t0ngub1n> it works
06:19:47 <ski> yea, that looks okay
06:19:55 <mauke> do you need the second line?
06:19:56 <t0ngub1n> or maybe that
06:19:56 <t0ngub1n> runningSums [] = []
06:19:56 <t0ngub1n> runningSums (x:[]) = [x]
06:19:56 <t0ngub1n> runningSums (x:xs) = x : (map (+x) $ runningSums xs)
06:20:25 <ski> the `$' is unnecessary, if you wrap the recursive call in brackets .. and then the brackets around the `$' application is unnecessary
06:20:50 <mauke> consider what the third line does if xs = []
06:21:07 <t0ngub1n> it goes to a second line
06:21:20 <t0ngub1n> where xs is []
06:21:36 <mauke> my point is that the second line isn't needed
06:21:55 <ski> the middle defining equation follows from the other two, yes
06:22:23 <ski> runningSums [ ] = []
06:22:25 <t0ngub1n> oh, yes it is not needed
06:22:26 <ski> runningSums (x:xs) = x : map (+x) (runningSums xs)
06:22:45 <t0ngub1n> and if i remove the brackets around $ call then i get a type error
06:23:31 <mauke> did you also remove the $ ?
06:23:34 <ski> you should always be on the look-out for simplifying definitions like this. often this can require you to consider cases that would otherwise feel "useless" .. but they're not useless, since they can help with reducing repetition in code, while also making it more general, and more simple to understand
06:23:54 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 255 seconds)
06:23:57 <ski> t0ngub1n : "if you wrap the recursive call in brackets"
06:24:34 <t0ngub1n> still type error
06:24:43 <ski> show code ?
06:24:53 <mauke> what ski meant: if you wrap the recursive call in brackets, as in (runningSums xs), or x : (map (+x) $ (runningSums xs)) as a whole, then the $ is unnecessary
06:25:04 <t0ngub1n> ill show error
06:25:08 <mauke> i.e. you could write x : (map (+x) (runningSums xs)) instead
06:25:28 <mauke> and then the outer brackets are unnecessary, as in x : map (+x) (runningSums xs)
06:25:42 <t0ngub1n> main.hs:23:22: error:
06:25:42 <t0ngub1n> • Couldn't match expected type ‘[Int] -> [Int]’
06:25:42 <t0ngub1n> with actual type ‘[Int]’
06:25:42 <t0ngub1n> • The first argument of ($) takes one argument,
06:25:42 <t0ngub1n> but its type ‘[Int]’ has none
06:25:43 <t0ngub1n> In the expression: x : map (+ x) $ runningSums xs
06:25:45 <t0ngub1n> In an equation for ‘runningSums’:
06:25:47 <t0ngub1n> runningSums (x : xs) = x : map (+ x) (runningSums xs)
06:25:49 <t0ngub1n> |
06:25:51 <t0ngub1n> 23 | runningSums (x:xs) = x : map (+x) (runningSums xs)
06:25:59 <t0ngub1n> lol complier glitch out
06:26:03 <t0ngub1n> no $ in there
06:26:04 <ski> t0ngub1n : "<mauke> did you also remove the $ ?"
06:26:12 <t0ngub1n> yes
06:26:18 <mauke> that error message is inconsistent
06:26:22 <t0ngub1n> yes it is
06:26:30 <mauke> <t0ngub1n> In the expression: x : map (+ x) $ runningSums xs
06:26:35 <mauke> here with $
06:26:44 <mauke> <t0ngub1n> runningSums (x : xs) = x : map (+ x) (runningSums xs)
06:26:46 <mauke> here without $
06:30:00 ryantrinkle joins (~ryantrink@140.174.255.47)
06:30:30 ski still wonders how t0ngub1n's code looks like
06:39:02 <t0ngub1n> runningSums :: [Int] -> [Int]
06:39:02 <t0ngub1n> runningSums [] = []
06:39:03 <t0ngub1n> runningSums (x:xs) = x : map (+ x) (runningSums xs)
06:41:05 × Guest86 quits (~Guest86@85.249.45.137) (Quit: Client closed)
06:41:32 <t0ngub1n> @pl runningSums (x:xs) = x : map (+ x) (runningSums xs)
06:41:33 <lambdabot> runningSums = fix ((`ap` tail) . (. head) . liftM2 (.) (:) . flip ((.) . map . (+)))
06:42:01 <t0ngub1n> @unpl runningSums = fix ((`ap` tail) . (. head) . liftM2 (.) (:) . flip ((.) . map . (+)))
06:42:01 <lambdabot> runningSums = fix (\ x b0 -> (tail >>= \ x2 -> return ((\ a0 -> return (\ x3 -> ((:)) a0 (map ((+) a0) (x x3))) a0) (head b0) x2)) b0)
06:42:19 <t0ngub1n> @unpl runningSums (x:xs) = x : map (+ x) (runningSums xs)
06:42:19 <lambdabot> runningSums (x : xs) = x : map (\ a0 -> a0 + x) (runningSums xs)
06:42:44 <t0ngub1n> @help
06:42:44 <lambdabot> help <command>. Ask for help for <command>. Try 'list' for all commands
06:42:48 <t0ngub1n> @list
06:42:48 <lambdabot> What module? Try @listmodules for some ideas.
06:42:57 <t0ngub1n> @listmodules
06:42:57 <lambdabot> activity base bf check compose dice dict djinn dummy elite eval filter free fresh haddock help hoogle instances irc karma localtime metar more oeis offlineRC pl pointful poll pretty quote search
06:42:57 <lambdabot> seen slap source spell system tell ticker todo topic type undo unlambda unmtl version where
06:43:16 <t0ngub1n> @list pl
06:43:16 <lambdabot> pl provides: pointless pl pl-resume
06:43:26 <t0ngub1n> @hellp @pointless
06:43:26 <lambdabot> help <command>. Ask for help for <command>. Try 'list' for all commands
06:43:32 <t0ngub1n> @help pointless
06:43:32 <lambdabot> pointless <expr>. Play with pointfree code.
06:43:50 <t0ngub1n> @pointless fix ((`ap` tail) . (. head) . liftM2 (.) (:) . flip ((.) . map . (+)))
06:43:50 <lambdabot> fix ((`ap` tail) . (. head) . liftM2 (.) (:) . flip ((.) . map . (+)))
06:44:05 <t0ngub1n> pointless is same as pl
06:44:11 <ski> yes
06:44:27 <ski> you can also play with lambdabot in a private message window
06:44:36 × Angelz quits (Angelz@2605:6400:30:fc15:9bd1:2217:41cd:bb15) (Ping timeout: 264 seconds)
06:44:37 <t0ngub1n> irc has pm?
06:44:47 <ski> /query lambdabot
06:44:57 × terrorjack quits (~terrorjac@2a01:4f8:c17:87f8::) (Quit: The Lounge - https://thelounge.chat)
06:45:21 <ski> or, if you wish
06:45:23 <t0ngub1n> what is ctcp version
06:45:43 <ski> /msg lambdabot @help pointless
06:45:56 <ski> that's just be checking which IRC client you were using
06:45:58 <ski> try
06:45:58 terrorjack joins (~terrorjac@2a01:4f8:c17:87f8::)
06:46:05 <ski> /ctcp ski version
06:46:08 × tosyl quits (~user@103.206.114.124) (Quit: WeeChat 3.8)
06:47:00 <ski> iirc, HexChat will, for some reason, not actually open a new window with `/msg', until the person (or bot) you messaged responds .. `/query' may open a window directly (if it works in HexChat, i don't recall)
06:47:27 <ski> you may need to check your "server window" in HexChat, to see the response to the CTCP command
06:48:35 × terrorjack quits (~terrorjac@2a01:4f8:c17:87f8::) (Client Quit)
06:49:27 vglfr joins (~vglfr@37.73.137.157)
06:49:36 terrorjack joins (~terrorjac@2a01:4f8:c17:87f8::)
06:50:03 × terrorjack quits (~terrorjac@2a01:4f8:c17:87f8::) (Client Quit)
06:52:58 terrorjack joins (~terrorjac@2a01:4f8:c17:87f8::)
06:53:32 gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
06:56:18 × vglfr quits (~vglfr@37.73.137.157) (Ping timeout: 255 seconds)
06:57:02 <tomsmeding> ski: dunno about hexchat, but weechat does the same thing (not open a window on /msg), which is why I always use /query :p
06:58:33 <ski> Irssi does open on `/msg' :)
07:00:27 cheater_ joins (~Username@user/cheater)
07:01:41 gemmaro joins (~user@240f:74:d1f0:1:ba1:e787:c9e:b1dc)
07:02:10 euandreh joins (~Thunderbi@189.6.18.7)
07:02:24 × cheater quits (~Username@user/cheater) (Ping timeout: 265 seconds)
07:02:32 cheater_ is now known as cheater
07:08:03 × jmilan quits (~jmilan@195.242.182.249) (Ping timeout: 260 seconds)
07:12:36 acidjnk joins (~acidjnk@p200300d6e715c473f858042c3d1c8888.dip0.t-ipconnect.de)
07:13:37 acidjnk_new joins (~acidjnk@p200300d6e715c4737980016e154edc96.dip0.t-ipconnect.de)
07:13:49 Angelz joins (Angelz@Angelz.oddprotocol.org)
07:17:31 × acidjnk quits (~acidjnk@p200300d6e715c473f858042c3d1c8888.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
07:23:18 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 255 seconds)
07:24:57 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
07:40:57 × hugo quits (znc@verdigris.lysator.liu.se) (Ping timeout: 256 seconds)
07:44:17 CiaoSen joins (~Jura@p200300c9572790002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
07:47:47 × t0ngub1n quits (~t0ngub1n@85.249.45.137) (Remote host closed the connection)
07:51:09 hugo joins (znc@verdigris.lysator.liu.se)
07:56:09 × JScript quits (~JScript@144.48.39.182) (Ping timeout: 255 seconds)
07:57:12 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
08:05:28 <gnulinuxuser> please ban me
08:07:02 <ski> why would you ask for that ?
08:09:53 × CiaoSen quits (~Jura@p200300c9572790002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Quit: CiaoSen)
08:14:11 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
08:16:12 nate1 joins (~nate@98.45.169.16)
08:20:54 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 255 seconds)
08:23:05 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 240 seconds)
08:24:05 × tabemann__ quits (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) (Remote host closed the connection)
08:24:34 tabemann__ joins (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net)
08:25:33 <probie> ski: So that one can claim that they were banned from #haskell, I'd guess
08:28:49 <probie> s/one/they/
08:28:58 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
08:30:06 _ht joins (~Thunderbi@28-52-174-82.ftth.glasoperator.nl)
08:32:35 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
08:35:51 vglfr joins (~vglfr@37.73.137.157)
08:36:12 gmg joins (~user@user/gehmehgeh)
08:36:29 × gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.8)
08:40:06 gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
08:47:39 × jargon quits (~jargon@174-22-213-236.phnx.qwest.net) (Remote host closed the connection)
08:57:05 × gemmaro quits (~user@240f:74:d1f0:1:ba1:e787:c9e:b1dc) (Read error: Connection reset by peer)
08:57:19 gemmaro joins (~user@240f:74:d1f0:1:ba1:e787:c9e:b1dc)
08:58:35 alexherbo2 joins (~alexherbo@2a02-842a-8180-4601-acc1-abab-ab34-357a.rev.sfr.net)
08:59:12 JScript joins (~JScript@144.48.39.180)
09:00:45 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds)
09:04:06 razetime joins (~quassel@117.193.2.76)
09:05:03 razetime1 joins (~Thunderbi@117.193.2.76)
09:08:48 × razetime1 quits (~Thunderbi@117.193.2.76) (Client Quit)
09:13:15 × acidjnk_new quits (~acidjnk@p200300d6e715c4737980016e154edc96.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
09:15:00 Tuplanolla joins (~Tuplanoll@91-159-68-236.elisa-laajakaista.fi)
09:21:19 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
09:33:02 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
09:37:24 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 255 seconds)
09:41:51 × emmanuelux_ quits (~emmanuelu@user/emmanuelux) (Quit: au revoir)
09:54:42 user3 joins (~user@103.206.114.86)
09:55:02 ub joins (~Thunderbi@p200300ecdf42b778af98fce2bbb311c4.dip0.t-ipconnect.de)
09:56:18 × ubert quits (~Thunderbi@p548c93d4.dip0.t-ipconnect.de) (Ping timeout: 255 seconds)
09:56:18 ub is now known as ubert
09:56:46 user3 is now known as tosyl
09:58:43 × alexherbo2 quits (~alexherbo@2a02-842a-8180-4601-acc1-abab-ab34-357a.rev.sfr.net) (Remote host closed the connection)
09:59:38 alexherbo2 joins (~alexherbo@2a02-842a-8180-4601-acc1-abab-ab34-357a.rev.sfr.net)
10:08:37 <jade[m]> What are your guys' opinions on a language which is similar and transpiles to haskell and is then fed into ghc?
10:08:46 <jade[m]> Essentially just an alternative haskell frontend
10:11:20 <darkling> There's a long and slightly awkward history of doing that with various languages. C++ into C with cfront, for example. LFE compiles Lisp into Erlang. There's a couple of hundred languages that compile to JavaScript. So... why not? Go for it. :)
10:11:20 madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net)
10:12:27 <jade[m]> thanks!
10:13:00 <jade[m]> I guess I could also aim for core, though I doubt my ability to do so
10:13:40 <ski> Liskell compiled (thin layer) into Haskell
10:14:04 <ski> @where Liskell
10:14:04 <lambdabot> a SExp syntax for Haskell, by therp : <http://clemens.endorphin.org/liskell> (broken),<https://web.archive.org/web/20081105133119/http://clemens.endorphin.org/liskell>,<http://clemens.endorphin.org/
10:14:04 <lambdabot> ILC07-Liskell-draft.pdf>,<https://web.archive.org/web/20120609122549/http://www.liskell.org/>
10:15:21 <jade[m]> This could be a good starting point, thanks a lot
10:16:11 <jade[m]> I think this could be a good project for me, because I'm interested in designing languages, though do not feel like I have the low-level understanding to build a full compiler
10:18:00 <geekosaur> older versions of agda and idris transpiled to haskell
10:19:49 <darkling> My first language, I didn't even get as far as transpiling. I just wrote an interpreter. :)
10:19:54 <juri_> I do DSL construction, but do not compile into haskell.
10:20:23 <jade[m]> do you write full compilers or do you transpile to something else
10:20:44 <geekosaur> back in the 1990s I did a fair amount of transpiling random stuff into C, although it was generally designed for embedding. (for example, a database report generator)
10:20:52 <jade[m]> in this setting I consider things like LLVM or JVM bytecode part of a "full compiler"
10:21:21 <juri_> i have an interpreter engine. at the end, it spits out a blurb of haskell that is equivalent to the output of the interpreted language...
10:22:56 × harveypwca quits (~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67) (Quit: Leaving)
10:23:40 <jade[m]> interesting
10:23:44 ski twitches
10:26:04 <juri_> jade[m]: don't get too excited. i'm (ab)using a modelling language to model 3d objects, then (ab)using show on the resulting off-to-the-rendering-engine tree to generate the library calls to the modelling library.
10:27:14 <juri_> it's more result-inspection than useful-utility, but it's handy for writing DSL, then dropping the resulting haskell into the golden test suite.
10:28:52 <tomsmeding> geekosaur: as far as I know agda still transpiles to haskell
10:29:20 <geekosaur> I was under the impression that, while that's still an option, they also have native backends these days
10:29:45 <tomsmeding> geekosaur: https://agda.readthedocs.io/en/v2.6.3/tools/compilers.html
10:30:06 <tomsmeding> for idris I think you're completely correct, though I'm not too familiar
10:31:06 <tomsmeding> (incidentally, the haskell that agda outputs is damn ugly)
10:31:17 <probie> I think for modern idris the preferred backend generates code for chez scheme
10:32:23 <geekosaur> well, yes, it would be. ghc's typechecker can't prove dependent types directly so there's a lot of unsafeCoerce
10:32:59 × tosyl quits (~user@103.206.114.86) (Quit: WeeChat 3.8)
10:33:00 <tomsmeding> geekosaur: not just a lot, they just indiscriminately put it everywhere
10:33:05 <tomsmeding> like around every ast node
10:33:36 <tomsmeding> I believe they avoid ambiguous type errors by just putting Any everywhere too
10:33:51 <tomsmeding> it's like a dynamically typed language :p
10:34:09 <tomsmeding> in that light I guess compiling to a scheme as probie says would be a more fitting choice
10:34:32 <tomsmeding> compiler is still optimised for functional structures, but doesn't assume any kind of sensible typing
10:36:06 emmanuelux joins (~emmanuelu@user/emmanuelux)
10:44:56 ski . o O ( <https://idris2.readthedocs.io/en/latest/updates/updates.html#chez-scheme-target>,<https://idris2.readthedocs.io/en/latest/backends/chez.html> )
10:49:16 acidjnk joins (~acidjnk@p200300d6e715c47369d8c20d85ea1b87.dip0.t-ipconnect.de)
10:52:56 nate1 joins (~nate@98.45.169.16)
10:56:29 emmanuelux_ joins (~emmanuelu@user/emmanuelux)
10:57:14 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
10:57:57 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 255 seconds)
10:58:33 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
10:59:24 × emmanuelux quits (~emmanuelu@user/emmanuelux) (Ping timeout: 252 seconds)
11:01:29 × ubert quits (~Thunderbi@p200300ecdf42b778af98fce2bbb311c4.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
11:01:49 ubert joins (~Thunderbi@p548c93d4.dip0.t-ipconnect.de)
11:08:45 × drdo quits (~drdo@bl14-14-164.dsl.telepac.pt) (Ping timeout: 255 seconds)
11:10:08 × gnulinuxuser quits (~gnulinuxu@user/gnulinuxuser) (Ping timeout: 260 seconds)
11:11:00 × vglfr quits (~vglfr@37.73.137.157) (Ping timeout: 255 seconds)
11:11:41 drdo joins (~drdo@bl14-14-164.dsl.telepac.pt)
11:16:02 × ubert quits (~Thunderbi@p548c93d4.dip0.t-ipconnect.de) (Quit: ubert)
11:16:28 ubert joins (~Thunderbi@p200300ecdf42b778af98fce2bbb311c4.dip0.t-ipconnect.de)
11:18:44 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
11:20:53 accord joins (uid568320@id-568320.hampstead.irccloud.com)
11:25:04 × ubert quits (~Thunderbi@p200300ecdf42b778af98fce2bbb311c4.dip0.t-ipconnect.de) (Quit: ubert)
11:31:17 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds)
11:33:08 <eldritchcookie[m> is there any easy way of making a graphical program, more specifically i want to make a program with the functionality of GCS and maptool
11:34:54 <eldritchcookie[m> sorry that still is too unspecific, is there any graphical framwork with dockable resizable panels on which i can draw?
11:35:02 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
11:35:03 <MangoIV[m]> <tomsmeding> "geekosaur: not just a lot..." <- Afaiu it’s gotten a lot better since agda2hs https://github.com/agda/agda2hs
11:36:53 <tomsmeding> MangoIV[m]: agda2hs definitely produces much better code -- that is its entire purpose -- but it compiles only a subset of agda
11:38:10 × sudden quits (~cat@user/sudden) (Ping timeout: 276 seconds)
11:38:45 × pyook quits (~puke@user/puke) (Ping timeout: 240 seconds)
11:39:21 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 255 seconds)
11:39:44 sudden joins (~cat@user/sudden)
11:40:46 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
11:42:09 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
11:44:32 × acidjnk quits (~acidjnk@p200300d6e715c47369d8c20d85ea1b87.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
11:48:27 polyphem joins (~polyphem@ip-109-43-51-100.web.vodafone.de)
11:56:54 × krei-se quits (~krei-se@p57af2733.dip0.t-ipconnect.de) (Ping timeout: 255 seconds)
11:57:22 krei-se joins (~krei-se@31.6.30.164)
12:01:23 × travv0 quits (sid293381@user/travv0) (Quit: Connection closed for inactivity)
12:03:55 × razetime quits (~quassel@117.193.2.76) (Remote host closed the connection)
12:07:40 krei-se- joins (~krei-se@p57af2733.dip0.t-ipconnect.de)
12:08:04 × krei-se quits (~krei-se@31.6.30.164) (Ping timeout: 276 seconds)
12:08:11 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 248 seconds)
12:14:18 acidjnk joins (~acidjnk@p200300d6e715c4732184a4a065abaaf4.dip0.t-ipconnect.de)
12:14:54 × gurkenglas quits (~gurkengla@dynamic-046-114-178-101.46.114.pool.telefonica.de) (Remote host closed the connection)
12:19:56 gurkenglas joins (~gurkengla@dynamic-046-114-178-101.46.114.pool.telefonica.de)
12:29:34 × gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.8)
12:30:49 × jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 276 seconds)
12:41:50 × gemmaro quits (~user@240f:74:d1f0:1:ba1:e787:c9e:b1dc) (Remote host closed the connection)
12:47:03 × madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Ping timeout: 265 seconds)
12:48:33 gemmaro joins (~user@240f:74:d1f0:1:ba1:e787:c9e:b1dc)
12:52:43 __monty__ joins (~toonn@user/toonn)
12:52:49 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
12:53:27 coot joins (~coot@213.134.170.228)
12:54:30 pavonia joins (~user@user/siracusa)
13:03:59 × polyphem quits (~polyphem@ip-109-43-51-100.web.vodafone.de) (Ping timeout: 246 seconds)
13:05:04 × acidjnk quits (~acidjnk@p200300d6e715c4732184a4a065abaaf4.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
13:06:41 × Me-me quits (~Me-me@user/me-me) (Quit: Going offline, see ya! (www.adiirc.com))
13:27:49 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
13:32:34 × drdo quits (~drdo@bl14-14-164.dsl.telepac.pt) (Ping timeout: 276 seconds)
13:36:54 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
13:38:00 × m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 264 seconds)
13:39:39 × myme quits (~myme@2a01:799:d60:e400:f221:398f:f55f:27f9) (Ping timeout: 256 seconds)
13:40:16 myme joins (~myme@2a01:799:d60:e400:d3f8:a1c2:97a0:2fb)
13:41:18 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 255 seconds)
13:43:45 m5zs7k joins (aquares@web10.mydevil.net)
13:58:04 aeroplane joins (~user@user/aeroplane)
13:58:45 × gurkenglas quits (~gurkengla@dynamic-046-114-178-101.46.114.pool.telefonica.de) (Ping timeout: 240 seconds)
14:01:10 madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net)
14:02:28 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 276 seconds)
14:05:44 gurkenglas joins (~gurkengla@dynamic-046-114-178-101.46.114.pool.telefonica.de)
14:16:54 ritsu[m] joins (~ritsumido@2001:470:69fc:105::3:4a21)
14:18:10 jero98772 joins (~jero98772@2800:484:1d84:9000::3)
14:30:38 titibandit joins (~titibandi@user/titibandit)
14:38:29 × gmg quits (~user@user/gehmehgeh) (Remote host closed the connection)
14:38:29 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
14:38:30 × califax quits (~califax@user/califx) (Read error: Connection reset by peer)
14:38:30 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Read error: Connection reset by peer)
14:38:45 califax joins (~califax@user/califx)
14:38:55 azimut joins (~azimut@gateway/tor-sasl/azimut)
14:38:59 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
14:39:15 gmg joins (~user@user/gehmehgeh)
14:40:50 × titibandit quits (~titibandi@user/titibandit) (Ping timeout: 260 seconds)
14:43:53 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
14:44:01 <hammond> this string = "\x0304" doesn't seem to be the same as this string = "\x03" ++"04"
14:44:48 <geekosaur> correct
14:45:12 <geekosaur> remember that Haskell strings are Unicode codepoints, \x0304 is a valid codepoint
14:45:22 <geekosaur> \x03\&04 will do what you want
14:45:37 <hammond> ok
14:50:00 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
14:54:26 nate1 joins (~nate@98.45.169.16)
14:59:25 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 250 seconds)
15:07:02 <eldritchcookie[m> hello is there a library for opening a file/URL in the default program?
15:07:16 <eldritchcookie[m> ideally in a crossplatform way?
15:09:11 × jle` quits (~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 256 seconds)
15:09:23 × xff0x quits (~xff0x@2405:6580:b080:900:696f:4e84:b735:2ed6) (Ping timeout: 250 seconds)
15:11:07 jle` joins (~jle`@cpe-23-240-75-236.socal.res.rr.com)
15:11:10 xff0x joins (~xff0x@ai098135.d.east.v6connect.net)
15:12:31 gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
15:13:44 dh97 joins (~dh97@2405:201:d02b:48f3:d9ee:cb54:6fa0:b6ac)
15:14:01 tubogram447 joins (~tubogram@user/tubogram)
15:14:05 unit73e joins (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36)
15:14:51 × tubogram44 quits (~tubogram@user/tubogram) (Ping timeout: 240 seconds)
15:14:51 tubogram447 is now known as tubogram44
15:16:46 <dh97> Hey, is there any way to have multiple versions of the same library installed at the same time in Haskell? I am using ormolu for formatting in two separate repos, which use two different ormolu versions. Right now, I have to keep installing the right version every time I am running the formatter.
15:17:44 <geekosaur> cabal and stack both manage that, but for executables it's more likely to be painful because cabal/stack can't automanage those
15:18:11 <eldritchcookie[m> i use nix and it works
15:18:19 <geekosaur> that said you should be able to install while within the project and it should install the specified version into the project instead of globally (use build, not install)
15:18:21 <unit73e> hello, and also interesting. maven and pals don't support that
15:18:28 <unit73e> never even occured to me
15:18:33 <geekosaur> (ad cabal/stack run)
15:19:58 × gemmaro quits (~user@240f:74:d1f0:1:ba1:e787:c9e:b1dc) (Remote host closed the connection)
15:20:15 wootehfoot joins (~wootehfoo@user/wootehfoot)
15:20:25 <dh97> Ormolu version is currently not specified in those repos's stack files, since those are dev dependencies. I install ormolu globally and use that.
15:22:47 <unit73e> but in that case, since it's a standalone app, isn't that more of an OS problem?
15:22:49 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
15:23:08 <unit73e> though you're installing ormolu with stack?
15:24:20 <unit73e> nix can have multiple versions of the same app, but that's uncommon
15:24:41 <dh97> Yes I'm using `stack install ormolu`.
15:24:49 <dh97> I would actually like something like how Node does it. We can specify a dev dependency version and if inside that folder that version gets installed. But I'm not sure how to do that with stack.
15:25:11 <unit73e> yeah in that case geekosaur suggestion is problably the best, install it locally in your project
15:25:23 <unit73e> which is what npm does
15:26:00 <unit73e> your problem is more how the text editor you're using figures which ormolu to use?
15:29:50 <dh97> I'm not using any text editor to format. I run ormolu in the command line to format.
15:30:57 vorpuni joins (~pvorp@2a01:e0a:1cd:ea70:afe3:506e:aa0:19a1)
15:30:57 × dh97 quits (~dh97@2405:201:d02b:48f3:d9ee:cb54:6fa0:b6ac) (Read error: Connection reset by peer)
15:31:32 dh97 joins (~dh97@2405:201:d02b:48f3:d9ee:cb54:6fa0:b6ac)
15:32:14 <dh97> geekosaur can you elaborate on how I can install locally? Do I need to add ormolu to the cabal file?
15:33:02 <unit73e> ok, in that case, you could install the binary were you want, it doesn't have to be in $HOME/.local/bin, and maybe have some sort of script to put in PATH just to make things easier
15:33:14 <unit73e> or have a custom command in stack to do it for you
15:33:44 bgs joins (~bgs@212-85-160-171.dynamic.telemach.net)
15:33:55 <unit73e> in npm you can specify command very generically, you could try that
15:33:58 <unit73e> but with stack
15:34:51 <monochrom> Playing with PATH is what nix does. :)
15:34:53 <geekosaur> if this is stack I'm not entirely sure but I think that if you run the install in the project dir it installs into the project's bin and you can use stack exec to run the local one
15:35:07 <geekosaur> I'm not a stack user though
15:35:11 <monochrom> <-- did play with PATH for a little while.
15:35:36 <unit73e> nix is indeed designed for these usecases
15:35:51 <dh97> Ok makes sense. So I can put multiple versions of ormolu in different folders and use aliases to call them. That could solve my problem.
15:36:13 <unit73e> yup
15:36:59 <dh97> I don't have any experience with nix but would like to learn more. Can you recommed some resources about using haskell with nix.
15:37:09 <maerwald> lol
15:38:32 <unit73e> dh97, nix is a package manager that allows you to specify your instalation declaratively
15:38:41 <unit73e> and you can see all that
15:38:44 <unit73e> in nixos official page
15:38:46 <eldritchcookie[m> oh sure https://nixos.org/learn.html is quite a good source
15:39:16 <dh97> Thanks I'll go through it.
15:39:38 <unit73e> it's very different from other linux OS but since you already know haskell that helps a lot understanding what's going on
15:40:45 <unit73e> in fact I'm still on arch and should switch to nixos lol but I'm still in lazy mode
15:40:54 <unit73e> and I lose the "arch btw" rights
15:42:25 nate1 joins (~nate@98.45.169.16)
15:47:25 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 240 seconds)
15:49:22 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
15:51:26 × dh97 quits (~dh97@2405:201:d02b:48f3:d9ee:cb54:6fa0:b6ac) (Read error: Connection reset by peer)
15:58:43 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
15:59:29 wroathe joins (~wroathe@50.205.197.50)
15:59:29 × wroathe quits (~wroathe@50.205.197.50) (Changing host)
15:59:29 wroathe joins (~wroathe@user/wroathe)
15:59:48 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
16:00:09 ritsu[m] parts (~ritsumido@2001:470:69fc:105::3:4a21) ()
16:00:40 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Quit: Leaving)
16:07:25 × wroathe quits (~wroathe@user/wroathe) (Quit: leaving)
16:08:40 wootehfoot joins (~wootehfoo@user/wootehfoot)
16:11:23 × ddellacosta quits (~ddellacos@143.244.47.84) (Quit: WeeChat 3.8)
16:11:27 econo joins (uid147250@user/econo)
16:11:33 × perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.8)
16:12:23 ddellacosta joins (~ddellacos@143.244.47.84)
16:14:11 wroathe joins (~wroathe@50.205.197.50)
16:14:12 × wroathe quits (~wroathe@50.205.197.50) (Changing host)
16:14:12 wroathe joins (~wroathe@user/wroathe)
16:18:20 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
16:23:04 ratapaca joins (~ratapaca@98.40.240.33)
16:32:18 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 255 seconds)
16:37:53 × wroathe quits (~wroathe@user/wroathe) (Quit: leaving)
16:48:13 perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca)
16:53:42 × alexherbo2 quits (~alexherbo@2a02-842a-8180-4601-acc1-abab-ab34-357a.rev.sfr.net) (Remote host closed the connection)
16:54:54 × perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.8)
16:56:50 perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca)
17:01:15 dh97 joins (~dh97@2405:201:d02b:48f3:d9ee:cb54:6fa0:b6ac)
17:01:54 Lycurgus joins (~juan@user/Lycurgus)
17:02:09 <dh97> Storing the ormolu bins in separate folders worked. Wrote a bash function to add the correct ormolu version for that repo.
17:04:31 × accord quits (uid568320@id-568320.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
17:13:06 × Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz)
17:13:42 × ratapaca quits (~ratapaca@98.40.240.33) (Ping timeout: 255 seconds)
17:14:10 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
17:15:01 wroathe joins (~wroathe@50.205.197.50)
17:15:01 × wroathe quits (~wroathe@50.205.197.50) (Changing host)
17:15:01 wroathe joins (~wroathe@user/wroathe)
17:15:47 × wroathe quits (~wroathe@user/wroathe) (Client Quit)
17:22:27 × dh97 quits (~dh97@2405:201:d02b:48f3:d9ee:cb54:6fa0:b6ac) (Quit: Quit)
17:25:06 × dsrt^ quits (~dsrt@c-76-105-96-13.hsd1.ga.comcast.net) (Remote host closed the connection)
17:28:14 × jero98772 quits (~jero98772@2800:484:1d84:9000::3) (Ping timeout: 246 seconds)
17:30:19 × madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Quit: Lost terminal)
17:33:34 bontaq joins (~user@ool-45779b84.dyn.optonline.net)
17:34:15 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
17:36:34 × vorpuni quits (~pvorp@2a01:e0a:1cd:ea70:afe3:506e:aa0:19a1) (Read error: Connection reset by peer)
17:37:54 rf joins (~rf@2605:59c8:1604:2210:6e18:f30:3bf:df23)
17:39:56 jero98772 joins (~jero98772@2800:484:1d84:9000::3)
17:52:49 waleee joins (~waleee@2001:9b0:21c:4000:5bf9:6515:c030:57b7)
18:01:02 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
18:08:46 × coot quits (~coot@213.134.170.228) (Quit: coot)
18:17:42 alexherbo2 joins (~alexherbo@2a02-842a-8180-4601-acc1-abab-ab34-357a.rev.sfr.net)
18:25:15 × gurkenglas quits (~gurkengla@dynamic-046-114-178-101.46.114.pool.telefonica.de) (Ping timeout: 255 seconds)
18:27:41 Sgeo joins (~Sgeo@user/sgeo)
18:32:42 × shailangsa_ quits (~shailangs@host165-120-169-78.range165-120.btcentralplus.com) (Remote host closed the connection)
18:33:18 gurkenglas joins (~gurkengla@46.114.178.101)
18:34:23 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds)
18:36:01 michalz joins (~michalz@185.246.207.217)
18:38:35 × jero98772 quits (~jero98772@2800:484:1d84:9000::3) (Ping timeout: 264 seconds)
18:43:42 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 255 seconds)
18:44:00 maanitou joins (~maanitou@87-49-146-189-mobile.dk.customer.tdc.net)
18:47:38 vglfr joins (~vglfr@37.73.65.155)
18:50:14 jero98772 joins (~jero98772@2800:484:1d84:9000::3)
18:52:36 <jade[m]> https://github.com/tc39/proposal-pipeline-operator
18:52:44 <Hecate> encore ?
18:52:47 jade[m] uploaded an image: (55KiB) < https://libera.ems.host/_matrix/media/v3/download/matrix.org/xKaLFZBgvgmGrRdftVnTPbeU/image_proxy.jpg >
18:52:55 <Hecate> did it change stage?
18:53:01 <Hecate> jade[m]: hahaha
18:54:14 <jade[m]> just saw it somewhere else and it reminded me of that meme
18:54:24 <Hecate> yeah definitely
18:56:26 × vglfr quits (~vglfr@37.73.65.155) (Ping timeout: 252 seconds)
19:01:37 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
19:03:57 mc47 joins (~mc47@xmonad/TheMC47)
19:15:07 shailangsa joins (~shailangs@host165-120-169-78.range165-120.btcentralplus.com)
19:21:37 xstill_ is now known as xstill
19:24:41 <[exa]> I took a brief look at the survey the're referring to and last year a whole whopping amount of 2 respondents dared to say js missing monads
19:25:02 <[exa]> in 2030 they'll be missing the tutorials
19:31:20 <jade[m]> <[exa]> "I took a brief look at the..." <- The question is in what sense they are missing
19:31:40 acidjnk joins (~acidjnk@p54ad56b7.dip0.t-ipconnect.de)
19:31:57 <jade[m]> because you can construct monads easily, the question is whether a general monad typeclass could be compiler enforced
19:32:14 <jade[m]> which would require a whole remodel of the type system to allow for introspective type parameters
19:33:18 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
19:33:33 <tomsmeding> jade[m]: you can construct a monad, in some sense, easily, but what you don't get is the nice syntax (i.e. do-notation)
19:33:55 <tomsmeding> so you simply get overloaded methods, not even (>>=), just .bind(), not an actual "overloaded semicolon"
19:34:08 <jade[m]> that's true, but also that's not what monads are about imo
19:34:28 <tomsmeding> but they are a pain to use without the syntax
19:34:42 <tomsmeding> in a functional language you need them, so we would perhaps accept the pain
19:34:44 <jade[m]> the idea is that you have an abstraction over flatmaps
19:34:54 <tomsmeding> but in an imperative language you don't need them, so people will not accept the pain
19:34:57 <jade[m]> and do-notation is just a way to simplify that
19:35:18 <tomsmeding> with explicit .bind() you're programming with "Okay I'm using a monad now because I really need to"
19:35:30 <tomsmeding> with do-notation you're just writing statements
19:35:51 <tomsmeding> semantically all apples are apples, but syntax matters
19:35:59 <int-e> [exa]: that's the kind of reply where you want to ask the respondent what the problem is that they expect to be solved by that feature
19:36:23 <tomsmeding> not enough burritos
19:37:23 <int-e> (Don't get me wrong, monads are great... but as tomsmeding points out, a large part of this comes down to having a pleasant syntax for them.)
19:39:02 × sphynx quits (~xnyhps@2a02:2770:3:0:216:3eff:fe67:3288) (Quit: brb)
19:40:14 jmdaemon joins (~jmdaemon@user/jmdaemon)
19:40:48 <tomsmeding> int-e: there's another reason why that question would be a good one: in haskell, the monads that I use are mostly 1. the classical transformers (Reader, Except, State, WriteR), which are for state management; and 2. STM/ST/IO, which are for IO management
19:41:04 <tomsmeding> neither are useful in JS where both use cases are readily fulfilled by native mutation constructs
19:41:16 <tomsmeding> what monads are left
19:41:20 wroathe joins (~wroathe@50.205.197.50)
19:41:20 × wroathe quits (~wroathe@50.205.197.50) (Changing host)
19:41:20 wroathe joins (~wroathe@user/wroathe)
19:41:41 × wroathe quits (~wroathe@user/wroathe) (Client Quit)
19:41:48 <int-e> I use [a] a lot for fun stuff.
19:41:52 <tomsmeding> exactly how many flatmaps do you have in a JS program, how many of those are on different types, and how often do you chain more than 2 of them that calling .flatMap twice is such a bother
19:42:15 wroathe joins (~wroathe@50.205.197.50)
19:42:16 × wroathe quits (~wroathe@50.205.197.50) (Changing host)
19:42:16 wroathe joins (~wroathe@user/wroathe)
19:42:20 <tomsmeding> int-e: that's true
19:42:57 <probie> The one "monad" I use in JS introduced a special syntax so I didn't need to keep going `.then`
19:43:07 <tomsmeding> await?
19:43:11 <probie> yes
19:43:16 <tomsmeding> right
19:44:11 nate1 joins (~nate@98.45.169.16)
19:45:05 <[exa]> oh noes my naive bad evening joke spawned a discussion
19:45:32 <int-e> [exa]: It's not a bad one, is it?
19:45:36 <int-e> No need for regrets.
19:45:48 <int-e> Or cause.
19:45:50 <[exa]> not at all bad, sure, it's just a really interesting pain point
19:47:43 <[exa]> I was literally starting to wonder how much would it cost to have some simple reconfigurable syntax preprocessor that everyone can use to express their stuff neatly, possibly shutting down 90% of such language-extension discussions and compiler update havoc
19:48:05 <tomsmeding> [exa]: is that about haskell or about js
19:48:27 × jero98772 quits (~jero98772@2800:484:1d84:9000::3) (Ping timeout: 250 seconds)
19:48:41 <[exa]> good question, more like generic
19:49:09 sphynx joins (~xnyhps@2a02:2770:3:0:216:3eff:fe67:3288)
19:49:12 <[exa]> nvm, it's offtopic, sorry. :]
19:49:13 <int-e> There's M4 :-P
19:49:25 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 260 seconds)
19:49:29 <tomsmeding> with the venerable 'dnl' comment marker
19:49:31 <[exa]> b b but.. _neater_
19:49:32 <int-e> (realistically, it'll always have to be tied to a particular language.)
19:50:20 × emmanuelux_ quits (~emmanuelu@user/emmanuelux) (Read error: Connection reset by peer)
19:51:09 emmanuelux_ joins (~emmanuelu@user/emmanuelux)
19:51:17 machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net)
19:51:20 <[exa]> let's move to #-offtopic
19:51:23 <ncf> under what circumstances exactly is the <<loop>> exception thrown? i don't think i've ever seen it in real life, just learned it was a thing
19:52:07 <ncf> NonTermination i guess
19:52:46 <tomsmeding> ncf: compile 'main = let x = x in x `seq` return ()'
19:52:59 <tomsmeding> ghci loops, the executable prints <<loop>>
19:53:25 <ncf> hm maybe i don't compile non-terminating code often enough
19:53:40 <[exa]> weird, my ghci loops without consuming any CPU time
19:53:44 <[exa]> what's that magic
19:54:01 <ncf> well it's not like that builds any new thunks
19:54:15 <ncf> oh, CPU
19:55:07 <tomsmeding> cute, never noticed that before; I wonder what it's doing
19:59:54 <c_wraith> [exa]: that means that the main thread has blocked. In a case when you're searching for <<loop>>, it's blocked because it's noticed the thunk it needs the result of is currently being evaluated.
20:00:57 <c_wraith> [exa]: If a different thread was working on it, the waiting thread would be woken when the value become available. In the case where the same thread is working and waiting on it, the garbage collector is supposed to notice that and kill the thread.
20:01:15 jero98772 joins (~jero98772@2800:484:1d84:9000::3)
20:01:18 <c_wraith> ... at least in the threaded runtime, which ghci uses.
20:01:25 × aeroplane quits (~user@user/aeroplane) (Ping timeout: 240 seconds)
20:01:33 <geekosaur> …but gc never runs because it's not allocating…
20:01:42 <c_wraith> in the single-threaded runtime, it doesn't need the GC to solve it, because it knows no other thread will come along
20:02:15 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
20:02:42 <c_wraith> you can find some command line parameters to tell the GC to run when the program is idle for long enough. Those might trigger a <<loop>> after a sufficient wait.
20:03:35 <[exa]> c_wraith: oh wow nice, thanks
20:03:44 <tomsmeding> TIL
20:09:00 milia joins (~milia@user/milia)
20:10:39 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
20:12:16 titibandit joins (~titibandi@user/titibandit)
20:13:48 × _ht quits (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Quit: _ht)
20:18:51 × trev quits (~trev@user/trev) (Quit: trev)
20:27:12 × maanitou quits (~maanitou@87-49-146-189-mobile.dk.customer.tdc.net) (Ping timeout: 255 seconds)
20:28:17 <c_wraith> you know, the timeout used to trigger in ghci. it doesn't anymore. I wonder if that's intentional...
20:33:47 <c_wraith> Hmm. even calling performMajorGC isn't causing a <<loop>> in ghci now. I wonder what's going on there...
20:34:50 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
20:34:52 × biberu quits (~biberu@user/biberu) (Read error: Connection reset by peer)
20:36:39 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 255 seconds)
20:41:44 × titibandit quits (~titibandi@user/titibandit) (Remote host closed the connection)
20:44:10 a6a45081-2b83 joins (~aditya@2600:1700:8fd0:3660::48)
20:48:08 biberu joins (~biberu@user/biberu)
20:49:22 × czy quits (~user@host-140-25.ilcub310.champaign.il.us.clients.pavlovmedia.net) (Remote host closed the connection)
20:49:39 <c_wraith> hah, ok. Finally got it to <<loop>>. Just had to 1) forkIO the action to block. 2) not keep that ThreadId around. 3) allocate and stop using a lot of junk. 4) call performMajorGC. I suspect some extra heuristics have been added that I'm not aware of
20:50:56 × gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.8)
20:58:36 × jero98772 quits (~jero98772@2800:484:1d84:9000::3) (Ping timeout: 265 seconds)
21:02:42 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
21:02:51 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
21:05:49 × alexherbo2 quits (~alexherbo@2a02-842a-8180-4601-acc1-abab-ab34-357a.rev.sfr.net) (Remote host closed the connection)
21:09:29 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 250 seconds)
21:11:21 × emmanuelux_ quits (~emmanuelu@user/emmanuelux) (Read error: Connection reset by peer)
21:11:48 jero98772 joins (~jero98772@2800:484:1d84:9000::3)
21:12:07 emmanuelux_ joins (~emmanuelu@user/emmanuelux)
21:13:02 accord joins (uid568320@id-568320.hampstead.irccloud.com)
21:13:12 lottaquestions joins (~nick@2607:fa49:503f:6d00:5c2:d038:28d6:c518)
21:14:17 jpds4 joins (~jpds@gateway/tor-sasl/jpds)
21:14:53 × jpds3 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds)
21:17:11 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
21:22:31 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 276 seconds)
21:24:22 × bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection)
21:32:58 zeenk joins (~zeenk@2a02:2f04:a20f:5200::7fe)
21:35:25 wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com)
21:35:25 × wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
21:35:25 wroathe joins (~wroathe@user/wroathe)
21:38:09 milia parts (~milia@user/milia) ()
21:40:23 × Inst quits (~Inst@2601:6c4:4081:54f0:4cd2:14dd:a80c:8533) (Read error: Connection reset by peer)
21:49:14 drdo joins (~drdo@bl14-14-164.dsl.telepac.pt)
21:52:07 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
22:04:53 × hgolden quits (~hgolden@cpe-172-251-233-141.socal.res.rr.com) (Remote host closed the connection)
22:06:01 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
22:06:34 hgolden joins (~hgolden@cpe-172-251-233-141.socal.res.rr.com)
22:08:35 × jero98772 quits (~jero98772@2800:484:1d84:9000::3) (Ping timeout: 264 seconds)
22:12:29 × stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 255 seconds)
22:12:32 MQ-17J joins (~MQ-17J@104.28.216.165)
22:12:36 × MQ-17J quits (~MQ-17J@104.28.216.165) (Client Quit)
22:13:25 × opticblast quits (~Thunderbi@172.58.85.88) (Ping timeout: 240 seconds)
22:13:27 MQ-17J joins (~MQ-17J@104.28.216.166)
22:13:35 × MQ-17J quits (~MQ-17J@104.28.216.166) (Client Quit)
22:18:42 × mcglk quits (~mcglk@131.191.19.145) (Read error: Connection reset by peer)
22:20:18 jero98772 joins (~jero98772@2800:484:1d84:9000::3)
22:20:20 × michalz quits (~michalz@185.246.207.217) (Remote host closed the connection)
22:21:12 mcglk joins (~mcglk@131.191.19.145)
22:22:19 stiell_ joins (~stiell@gateway/tor-sasl/stiell)
22:31:40 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
22:36:37 × emmanuelux_ quits (~emmanuelu@user/emmanuelux) (Ping timeout: 276 seconds)
22:45:41 × mcglk quits (~mcglk@131.191.19.145) (Quit: (seeya))
22:46:21 × gurkenglas quits (~gurkengla@46.114.178.101) (Ping timeout: 265 seconds)
22:46:42 × a6a45081-2b83 quits (~aditya@2600:1700:8fd0:3660::48) (Remote host closed the connection)
22:48:10 gurkenglas joins (~gurkengla@dynamic-089-204-139-194.89.204.139.pool.telefonica.de)
22:51:15 opticblast joins (~Thunderbi@172.58.85.88)
23:01:26 falafel joins (~falafel@2603:8000:d700:115c:12f7:bd7:ccb3:ed19)
23:02:19 Me-me joins (~Me-me@146.102.215.218.dyn.iprimus.net.au)
23:03:41 × Me-me quits (~Me-me@146.102.215.218.dyn.iprimus.net.au) (Changing host)
23:03:41 Me-me joins (~Me-me@user/me-me)
23:08:07 × Feuermagier quits (~Feuermagi@user/feuermagier) (Quit: Leaving)
23:09:42 × Tuplanolla quits (~Tuplanoll@91-159-68-236.elisa-laajakaista.fi) (Quit: Leaving.)
23:09:56 × terrorjack quits (~terrorjac@2a01:4f8:c17:87f8::) (Quit: The Lounge - https://thelounge.chat)
23:12:43 mcglk joins (~mcglk@131.191.19.145)
23:13:08 foul_owl joins (~kerry@94.140.8.139)
23:14:09 × ddellacosta quits (~ddellacos@143.244.47.84) (Ping timeout: 255 seconds)
23:15:25 × acidjnk quits (~acidjnk@p54ad56b7.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
23:18:47 × jero98772 quits (~jero98772@2800:484:1d84:9000::3) (Ping timeout: 264 seconds)
23:26:56 × xff0x quits (~xff0x@ai098135.d.east.v6connect.net) (Quit: xff0x)
23:29:45 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds)
23:30:08 jero98772 joins (~jero98772@2800:484:1d84:9000::3)
23:31:43 × zeenk quits (~zeenk@2a02:2f04:a20f:5200::7fe) (Quit: Konversation terminated!)
23:31:50 terrorjack joins (~terrorjac@2a01:4f8:c17:87f8::)
23:45:42 nate1 joins (~nate@98.45.169.16)
23:45:55 mauke_ joins (~mauke@user/mauke)
23:47:27 × mauke quits (~mauke@user/mauke) (Ping timeout: 255 seconds)
23:47:28 mauke_ is now known as mauke
23:47:45 × unit73e quits (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) (Remote host closed the connection)
23:50:25 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 240 seconds)
23:51:02 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
23:53:19 × gurkenglas quits (~gurkengla@dynamic-089-204-139-194.89.204.139.pool.telefonica.de) (Ping timeout: 276 seconds)

All times are in UTC on 2023-04-23.