Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-20 01:09:24 × acidjnk_new quits (~acidjnk@p200300d0c719ff356dc4eeabe79b61ea.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2020-11-20 01:09:24 × gentauro quits (~gentauro@unaffiliated/gentauro) (Read error: Connection reset by peer)
2020-11-20 01:10:10 × Deide quits (~Deide@217.155.19.23) (Quit: Seeee yaaaa)
2020-11-20 01:10:16 gentauro joins (~gentauro@unaffiliated/gentauro)
2020-11-20 01:10:17 christo joins (~chris@81.96.113.213)
2020-11-20 01:11:24 <dolio> Someone's working on yi?
2020-11-20 01:11:37 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-11-20 01:12:38 alp joins (~alp@2a01:e0a:58b:4920:a9d4:25a5:c24f:25ed)
2020-11-20 01:13:04 × hnOsmium0001 quits (uid453710@gateway/web/irccloud.com/x-lviokxjrzjjmnlqh) (Ping timeout: 240 seconds)
2020-11-20 01:14:01 × Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Ping timeout: 264 seconds)
2020-11-20 01:14:16 leungbk joins (~user@cpe-104-33-52-83.socal.res.rr.com)
2020-11-20 01:14:37 × christo quits (~chris@81.96.113.213) (Read error: No route to host)
2020-11-20 01:15:14 hnOsmium0001 joins (uid453710@gateway/web/irccloud.com/x-itluyvgbrrzsqlpm)
2020-11-20 01:15:16 christo joins (~chris@81.96.113.213)
2020-11-20 01:16:00 hackage yi-core 0.19.2 - Yi editor core library https://hackage.haskell.org/package/yi-core-0.19.2 (TomMurphy)
2020-11-20 01:16:52 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-11-20 01:19:07 <glguy> Maybe someone could tell Tom Murphy about package candidates
2020-11-20 01:20:45 × erisco quits (~erisco@d24-57-249-233.home.cgocable.net) (Quit: Leaving)
2020-11-20 01:21:46 ShinyPants joins (~user@2604:3d09:207f:f650:1c53:faca:fa1d:35d3)
2020-11-20 01:22:35 olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber)
2020-11-20 01:24:16 iqubic joins (~user@2601:602:9500:4870:d13a:6a31:cf0a:f017)
2020-11-20 01:25:49 <iqubic> Well, I'm struggling right now. I want to write a function with the type [[a]] -> M.Map (V2 Int), where the first element of the first list is associated with (V2 0 0), and the rest follows from there. I'm not sure how to do that.
2020-11-20 01:27:35 <iqubic> Can I get some help on how to do that?
2020-11-20 01:27:50 <dsal> I don't understand how you get from `a` to whatever V2 is.
2020-11-20 01:27:57 <dsal> Is `V2 Int` a type?
2020-11-20 01:28:40 <iqubic> dsal: data V2 a = V2 a a.
2020-11-20 01:28:58 <iqubic> It's from the Data.Linear package, but you can just use that definite.
2020-11-20 01:29:03 <dsal> So something like this? > fmap (\(x:xs) -> (x, xs)) ["abc", "def"]
2020-11-20 01:29:14 <dsal> > fmap (\(x:xs) -> (x, xs)) ["abc", "def"] -- -> M.fromList
2020-11-20 01:29:16 <lambdabot> [('a',"bc"),('d',"ef")]
2020-11-20 01:30:01 × olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Ping timeout: 265 seconds)
2020-11-20 01:30:15 <dsal> Oh, I think I understand.
2020-11-20 01:30:29 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-11-20 01:30:46 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:7958:7d8e:4908:c843) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-11-20 01:32:23 <dsal> > fmap (\(y,l) -> zipWith (\x a -> (x,y,a)) [0..] l) $ zip [0..] ["abc", "def"] -- something like this?
2020-11-20 01:32:25 <lambdabot> [[(0,0,'a'),(1,0,'b'),(2,0,'c')],[(0,1,'d'),(1,1,'e'),(2,1,'f')]]
2020-11-20 01:34:05 <iqubic> Basically something like this:
2020-11-20 01:34:07 <iqubic> https://dpaste.com/AVYCK9ULA
2020-11-20 01:34:22 <iqubic> If that makes any sense.
2020-11-20 01:34:43 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 246 seconds)
2020-11-20 01:34:48 <iqubic> I see what you've given me.
2020-11-20 01:34:48 Lord_of_Life_ joins (~Lord@46.217.218.71)
2020-11-20 01:34:51 × Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Ping timeout: 265 seconds)
2020-11-20 01:34:51 × cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 265 seconds)
2020-11-20 01:35:03 <iqubic> dsal: Does my paste make sense?
2020-11-20 01:35:16 × roconnor quits (~roconnor@host-104-157-230-3.dyn.295.ca) (Ping timeout: 260 seconds)
2020-11-20 01:35:21 nbloomf joins (~nbloomf@2600:1700:ad14:3020:7958:7d8e:4908:c843)
2020-11-20 01:35:35 <dsal> Yeah, completely. I just sketched that thing in lambdabot, but I think it gets you pretty close to what you want.
2020-11-20 01:35:42 <iqubic> Yes. It does.
2020-11-20 01:36:05 <iqubic> I just need to change the data types used, and feed the result into M.fromList.
2020-11-20 01:38:03 <dsal> Cool... There's probably a better way to do that, and I should probably come up with a nice way to do that. Sort of a two dimensional zip.
2020-11-20 01:38:19 avoandmayo joins (~textual@122-58-109-105-adsl.sparkbb.co.nz)
2020-11-20 01:38:55 × p-core quits (~Thunderbi@2a0e:1c80:4:1023::1004) (Ping timeout: 272 seconds)
2020-11-20 01:39:14 <iqubic> For now, that's the least of my worries.
2020-11-20 01:42:34 olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber)
2020-11-20 01:44:18 × ShinyPants quits (~user@2604:3d09:207f:f650:1c53:faca:fa1d:35d3) (Remote host closed the connection)
2020-11-20 01:44:59 × remby quits (~rg@2607:fea8:2c40:307::1ef6) (Quit: Konversation terminated!)
2020-11-20 01:45:13 <iqubic> Can I use zip when the first argument is [0..]?
2020-11-20 01:46:38 <dsal> :t zip
2020-11-20 01:46:39 <lambdabot> [a] -> [b] -> [(a, b)]
2020-11-20 01:46:49 <dsal> Oh, you mean will it terminate?
2020-11-20 01:46:59 <dsal> zip ends when either input ends
2020-11-20 01:47:19 <iqubic> :t zipWith
2020-11-20 01:47:20 <lambdabot> (a -> b -> c) -> [a] -> [b] -> [c]
2020-11-20 01:47:27 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-11-20 01:49:03 <dsal> `zip` is just `zipWith (,)`
2020-11-20 01:50:30 hackage yi-frontend-pango 0.19.0 - Pango frontend for Yi editor https://hackage.haskell.org/package/yi-frontend-pango-0.19.0 (TomMurphy)
2020-11-20 01:50:34 × Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer)
2020-11-20 01:50:46 <dsal> Oh, I didn't notice a thing I did.
2020-11-20 01:50:47 Tario joins (~Tario@201.192.165.173)
2020-11-20 01:50:53 <dsal> `zipWith2D :: (a -> b -> c -> d) -> [a] -> [b] -> [[c]] -> [d]; zipWith2D f xs ys = foldMap (\(y, l) -> zipWith (\x -> f x y) xs l) . zip ys`
2020-11-20 01:50:57 <dsal> That's a slightly better version.
2020-11-20 01:51:02 × LKoen quits (~LKoen@169.244.88.92.rev.sfr.net) (Quit: “It’s only logical. First you learn to talk, then you learn to think. Too bad it’s not the other way round.”)
2020-11-20 01:51:30 hackage yi-frontend-vty 0.19.0 - Vty frontend for Yi editor https://hackage.haskell.org/package/yi-frontend-vty-0.19.0 (TomMurphy)
2020-11-20 01:52:04 <dsal> using fmap meant you got a `[[d]]` back, which was confusing me when I tried doing it with a declared type.
2020-11-20 01:56:00 hackage yi-keymap-vim 0.19.0 - Vim keymap for Yi editor https://hackage.haskell.org/package/yi-keymap-vim-0.19.0 (TomMurphy)
2020-11-20 01:57:01 hackage yi-misc-modes 0.19.0 - Yi editor miscellaneous modes https://hackage.haskell.org/package/yi-misc-modes-0.19.0 (TomMurphy)
2020-11-20 01:57:26 <dsal> I need to add that to my aoc toolkit. I end up inventing something like that regularly.
2020-11-20 02:00:04 <dsal> Oh cool, I had a function that was slightly related that could be built on that, and it already had tests, so I can wedge it in there.
2020-11-20 02:00:41 <iqubic> dsal: I'm actually preparing my AOC toolkit as we speak.
2020-11-20 02:01:01 <dsal> I should do more of that. I always feel like it would've been a great idea after the fact.
2020-11-20 02:01:03 <iqubic> I have a file literally called Grid.hs, for doing grid based stuff.
2020-11-20 02:02:01 <dsal> I've got `parseGrid :: (Char -> a) -> String -> Map (Int,Int) a` which is pretty common for those map things for me. And a bunch of `around` and distance functions.
2020-11-20 02:02:56 <dsal> And stuff that takes those grid things and spits out text or png visualizations.
2020-11-20 02:04:05 <dsal> Mostly just use this text one: `draw :: Bounded2D a => FilePath -> a -> PixelFun -> IO ()`
2020-11-20 02:05:11 × crdrost quits (~crdrost@2601:646:8280:85f0:90f7:1b03:f01f:afae) (Quit: This computer has gone to sleep)
2020-11-20 02:05:22 roconnor joins (~roconnor@host-104-157-230-3.dyn.295.ca)
2020-11-20 02:07:25 × Tario quits (~Tario@201.192.165.173) (Ping timeout: 264 seconds)
2020-11-20 02:08:28 da39a3ee5e6b4b0d joins (~da39a3ee5@2403:6200:8876:6c06:f0fd:283a:1f37:de16)
2020-11-20 02:09:53 × christo quits (~chris@81.96.113.213) (Remote host closed the connection)
2020-11-20 02:11:09 guest1120 joins (~user@49.5.6.87)
2020-11-20 02:11:38 <MarcelineVQ> I always think aoc is a really great idea until problem 3 or 4
2020-11-20 02:11:57 <MarcelineVQ> Then I feel less and less sure about that until the curve becomes eliptical
2020-11-20 02:12:22 <monochrom> haha
2020-11-20 02:13:12 <monochrom> This proves that your sentiment is under Newtonian gravitation >:)
2020-11-20 02:13:37 <MarcelineVQ> this explains why I'm always in free fall
2020-11-20 02:13:42 × Entertainment quits (~entertain@104.246.132.210) ()
2020-11-20 02:14:24 × codeAlways quits (uid272474@gateway/web/irccloud.com/x-zbflumxjrtygmhzc) (Quit: Connection closed for inactivity)
2020-11-20 02:15:32 <iqubic> What is Bounded2D?
2020-11-20 02:15:44 <iqubic> My drawing function is quite primative.

All times are in UTC.