Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-25 05:11:11 <triteraflops> *downside
2020-11-25 05:12:02 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
2020-11-25 05:12:50 <triteraflops> If the file handle only exists inside that function, it can be unique and still have unmanaged side effects.
2020-11-25 05:13:03 conal joins (~conal@64.71.133.70)
2020-11-25 05:13:09 × conal quits (~conal@64.71.133.70) (Client Quit)
2020-11-25 05:13:14 × TooDifficult quits (~vg@139.59.59.230) (Quit: TooDifficult)
2020-11-25 05:13:18 <triteraflops> unless somehow, a world object has to be passed into every file handle creation...
2020-11-25 05:13:47 <dolio> Arrays are a better use case, because they don't have this problem.
2020-11-25 05:14:00 TooDifficult joins (~vg@139.59.59.230)
2020-11-25 05:14:09 <triteraflops> I had hoped somebody just knew the answer. There was a decent chance.
2020-11-25 05:14:11 <dolio> If you make an infinite loop that does stuff with an array, it doesn't really matter that it's modifying memory forever.
2020-11-25 05:14:15 <triteraflops> I'll just keep reading
2020-11-25 05:15:30 hackage advent-of-code-ocr 0.1.0.0 - Parse Advent of Code ASCII art letters https://hackage.haskell.org/package/advent-of-code-ocr-0.1.0.0 (jle)
2020-11-25 05:15:46 × Jonkimi727406120 quits (~Jonkimi@113.87.161.66) (Ping timeout: 246 seconds)
2020-11-25 05:16:02 <ocamler> how do you guys/girls deal with function arguments being in the wrong order, for example I want to map over a list [k] with this function: `findWithDefault :: Ord k => a -> k -> Map k a -> a` however the last argument wrong, is there a better way than writing a helper function for each one of these?
2020-11-25 05:16:14 <dibblego> @type flip
2020-11-25 05:16:15 <lambdabot> (a -> b -> c) -> b -> a -> c
2020-11-25 05:16:30 plutoniix joins (~q@175.176.222.7)
2020-11-25 05:16:31 <dsal> Or a section
2020-11-25 05:16:34 <dibblego> > flip (-) 7 9
2020-11-25 05:16:36 <lambdabot> 2
2020-11-25 05:17:24 <ocamler> but in this case wouldn't i need a type of `(a -> b -> c -> d) -> (a -> b -> d -> c)`
2020-11-25 05:18:54 <triteraflops> flip (findWithDefault some_a) some_map k should work
2020-11-25 05:19:00 <glguy> ocamler, either with a locally defined function or a lambda expression
2020-11-25 05:19:05 × shatriff quits (~vitaliish@176.52.219.10) (Remote host closed the connection)
2020-11-25 05:19:06 <triteraflops> if you curry the a argument first
2020-11-25 05:19:43 <glguy> [findWithDefault a k m | k <- ks] -- or even a list comprehension can work nicely
2020-11-25 05:19:44 <ocamler> ohhh that makes sense, thanks
2020-11-25 05:19:46 shatriff joins (~vitaliish@176.52.219.10)
2020-11-25 05:20:54 <jle`> ocamler: i'd often use a lambda too
2020-11-25 05:21:09 <jle`> map (\k -> findWithDefault a k m) ks
2020-11-25 05:23:36 × pavonia quits (~user@unaffiliated/siracusa) (Quit: Bye!)
2020-11-25 05:24:06 <triteraflops> Ah, my guess was right. You /do/ have to pass a world into the file handle open function.
2020-11-25 05:24:15 <triteraflops> and world is unique.
2020-11-25 05:24:19 <Axman6> almost always a lambda is more obvious than combinations of composition and flips
2020-11-25 05:24:42 <triteraflops> You can't do any further IO unless you extract the world from the io-performing function after it returns.
2020-11-25 05:25:01 <triteraflops> In this way, you can tell apart functions that do IO and functions that do not.
2020-11-25 05:25:14 Sarma joins (~Amras@unaffiliated/amras0000)
2020-11-25 05:25:17 <triteraflops> world or a file handle must be passed into a function that does IO!
2020-11-25 05:25:19 <Axman6> or at least, functions which may do IO?
2020-11-25 05:25:21 <triteraflops> very interesting
2020-11-25 05:25:27 <triteraflops> well, yes
2020-11-25 05:25:42 <triteraflops> you could pass world in and output world again, and not actually use it
2020-11-25 05:25:49 <triteraflops> though the same is true of the monad approach
2020-11-25 05:26:01 hackage skylighting-core 0.10.1 - syntax highlighting library https://hackage.haskell.org/package/skylighting-core-0.10.1 (JohnMacFarlane)
2020-11-25 05:26:01 <Axman6> I'm just being a pedant :)
2020-11-25 05:26:05 <triteraflops> lol
2020-11-25 05:26:22 <koz_> triteraflops: That's why I suggested the Lazy Functional State Threads paper.
2020-11-25 05:26:33 <koz_> The idea sounds _very_ similar to what it does, but safer.
2020-11-25 05:27:01 hackage skylighting 0.10.1 - syntax highlighting library https://hackage.haskell.org/package/skylighting-0.10.1 (JohnMacFarlane)
2020-11-25 05:27:05 <triteraflops> You know I still don't see a downside to the Clean approach.
2020-11-25 05:27:17 <triteraflops> Still waiting for the other shoe to drop lol
2020-11-25 05:29:18 subttle joins (~anonymous@unaffiliated/subttle)
2020-11-25 05:29:44 <Axman6> "No one uses clean, therefore it can't be very good" <- usually said about Haskell
2020-11-25 05:30:27 <ocamler> uh this is a weird compile error, `Couldn't match expected type ‘[Char] -> [String]’ with actual type ‘[[Char]]’`
2020-11-25 05:30:33 <ocamler> oh nvm
2020-11-25 05:30:34 <ocamler> sorry
2020-11-25 05:30:43 <Axman6> you got this, I believe in you
2020-11-25 05:31:11 <ocamler> lol thank you :)
2020-11-25 05:32:07 mpereira joins (~mpereira@2a02:810d:f40:d96:f587:a442:5e3:1e55)
2020-11-25 05:32:54 × Jeanne-Kamikaze quits (~Jeanne-Ka@66.115.189.187) (Quit: Leaving)
2020-11-25 05:33:07 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-11-25 05:34:45 <triteraflops> Axman6: well, yeah, exactly, right?
2020-11-25 05:36:47 × mpereira quits (~mpereira@2a02:810d:f40:d96:f587:a442:5e3:1e55) (Ping timeout: 272 seconds)
2020-11-25 05:40:37 × spatchkaa quits (~spatchkaa@S010600fc8da47b63.gv.shawcable.net) (Ping timeout: 246 seconds)
2020-11-25 05:41:02 × borne quits (~fritjof@200116b864eb5c00394a967dc8ef4e61.dip.versatel-1u1.de) (Ping timeout: 260 seconds)
2020-11-25 05:42:54 borne joins (~fritjof@200116b864509c00394a967dc8ef4e61.dip.versatel-1u1.de)
2020-11-25 05:43:29 × TooDifficult quits (~vg@139.59.59.230) (Quit: TooDifficult)
2020-11-25 05:54:22 mwalter joins (473b8f3e@c-71-59-143-62.hsd1.or.comcast.net)
2020-11-25 05:58:08 × adm_ quits (~adm@43.229.88.197) (Remote host closed the connection)
2020-11-25 05:59:54 × lemmih_ quits (~lemmih@2406:3003:2072:44:e4e6:2edc:c18b:f5e1) (Remote host closed the connection)
2020-11-25 06:00:00 adm_ joins (~adm@43.229.88.197)
2020-11-25 06:00:16 lemmih_ joins (~lemmih@2406:3003:2072:44:741a:bd6a:3c25:3ad0)
2020-11-25 06:05:22 spatchkaa joins (~spatchkaa@S010600fc8da47b63.gv.shawcable.net)
2020-11-25 06:07:11 × elliott__ quits (~elliott@pool-108-51-141-12.washdc.fios.verizon.net) (Ping timeout: 272 seconds)
2020-11-25 06:07:13 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 246 seconds)
2020-11-25 06:08:08 elliott__ joins (~elliott@pool-108-51-141-12.washdc.fios.verizon.net)
2020-11-25 06:11:44 × vicfred quits (~vicfred@unaffiliated/vicfred) (Quit: Leaving)
2020-11-25 06:12:05 Jonkimi727406120 joins (~Jonkimi@113.87.161.66)
2020-11-25 06:12:17 takuan joins (~takuan@178-116-218-225.access.telenet.be)
2020-11-25 06:15:00 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2020-11-25 06:15:05 <ocamler> hey quick question, I feel like this is simple idk why it doesn't work
2020-11-25 06:15:11 <ocamler> ```next :: Int -> [Int]
2020-11-25 06:15:26 <ocamler> next :: Int -> [Int]next = undefinedminimum :: Int -> Int -> Intminimum k x | k < 0 = inf | k == 0 = 0 | k > 0 = min $ next x
2020-11-25 06:15:28 <ocamler> oops
2020-11-25 06:15:36 jonatanb joins (jonatanb@gateway/vpn/protonvpn/jonatanb)
2020-11-25 06:15:38 <ocamler> next :: Int -> [Int]next = undefinedminimum :: Int -> Int -> Intminimum k x | k < 0 = inf | k == 0 = 0 | k > 0 = min $ next x
2020-11-25 06:15:41 <ocamler> sorry
2020-11-25 06:15:47 <ocamler> `next :: Int -> [Int]next = undefinedminimum :: Int -> Int -> Intminimum k x | k < 0 = inf | k == 0 = 0 | k > 0 = min $ next x`
2020-11-25 06:16:16 <ocamler> https://pastebin.com/BdHKv9y9
2020-11-25 06:16:25 <ocamler> I'm wondering why this isn't compiling
2020-11-25 06:17:46 <ocamler> this is the error message https://pastebin.com/wP3YGaLN
2020-11-25 06:19:15 <ocamler> nvm I solved it, sorry about the noise lol
2020-11-25 06:19:18 <xerox_> :t (min,minimum)
2020-11-25 06:19:20 <lambdabot> (Foldable t, Ord a1, Ord a2) => (a1 -> a1 -> a1, t a2 -> a2)
2020-11-25 06:19:46 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 256 seconds)
2020-11-25 06:20:36 × jonatanb quits (jonatanb@gateway/vpn/protonvpn/jonatanb) (Ping timeout: 272 seconds)
2020-11-25 06:22:59 × spatchkaa quits (~spatchkaa@S010600fc8da47b63.gv.shawcable.net) (Quit: Leaving)
2020-11-25 06:23:25 × ddellacosta quits (dd@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 240 seconds)
2020-11-25 06:24:55 × alp quits (~alp@2a01:e0a:58b:4920:ed97:230b:9822:a509) (Ping timeout: 272 seconds)

All times are in UTC.