Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 432 433 434 435 436 437 438 439 440 441 442 .. 5022
502,152 events total
2020-10-05 16:46:40 <monochrom> What was all that about anyway?
2020-10-05 16:46:52 × tbreslein quits (~tbreslein@2a02:8108:140:44f8::3cc4) (Remote host closed the connection)
2020-10-05 16:47:17 <nshepperd> fog in his manic phase
2020-10-05 16:47:28 <c_wraith> I'm not sure anyone's ever known what they're talking about
2020-10-05 16:47:59 coot joins (~coot@37.30.49.218.nat.umts.dynamic.t-mobile.pl)
2020-10-05 16:49:04 <sm[m]> nshepperd: it probably is, but it has been working great since beginner-me concocted it
2020-10-05 16:49:38 × nineonin_ quits (~nineonine@216-19-190-182.dyn.novuscom.net) (Remote host closed the connection)
2020-10-05 16:52:32 <ski> monochrom : yes, like `simple-ivar'
2020-10-05 16:53:33 juliusdeane joins (~user@130.64.35.16)
2020-10-05 16:53:45 mrbentarikau joins (~caubert@82.131.52.222.cable.starman.ee)
2020-10-05 16:54:09 × flatmap quits (~flatmap@p200300dd371bf60068aa0495bfcb4a49.dip0.t-ipconnect.de) (Quit: Textual IRC Client: www.textualapp.com)
2020-10-05 16:55:07 howdoi joins (uid224@gateway/web/irccloud.com/x-bfkecngtkcukjezu)
2020-10-05 16:55:21 <monochrom> ivar-simple
2020-10-05 16:55:56 geekosaur joins (42d52102@66.213.33.2)
2020-10-05 16:57:56 × reppertj quits (~textual@pool-96-246-209-59.nycmny.fios.verizon.net) (Quit: Textual IRC Client: www.textualapp.com)
2020-10-05 16:58:37 × mrbentarikau quits (~caubert@82.131.52.222.cable.starman.ee) (Remote host closed the connection)
2020-10-05 16:59:27 hackage hakyll-alectryon 0.1.0.0 - Hakyll extension for rendering Coq code using Alectryon https://hackage.haskell.org/package/hakyll-alectryon-0.1.0.0 (lyxia)
2020-10-05 17:00:13 nineonine joins (~nineonine@216.81.48.202)
2020-10-05 17:00:30 oisdk joins (~oisdk@2001:bb6:3329:d100:2471:1ee3:650d:c8f7)
2020-10-05 17:00:36 × nineonine quits (~nineonine@216.81.48.202) (Read error: Connection reset by peer)
2020-10-05 17:00:36 snakemasterflex joins (~snakemast@213.100.206.23)
2020-10-05 17:00:47 nineonine joins (~nineonine@216.81.48.202)
2020-10-05 17:00:49 zoom joins (44beb1c9@068-190-177-201.res.spectrum.com)
2020-10-05 17:01:56 zoom84 joins (44beb1c9@068-190-177-201.res.spectrum.com)
2020-10-05 17:01:56 Guest_83 joins (d4ba09dc@212-186-9-220.cable.dynamic.surfer.at)
2020-10-05 17:02:14 int-e wonders whether to worry about the ivar-simple reference.
2020-10-05 17:02:27 × Guest_83 quits (d4ba09dc@212-186-9-220.cable.dynamic.surfer.at) (Remote host closed the connection)
2020-10-05 17:02:39 caubert joins (~caubert@82.131.52.222.cable.starman.ee)
2020-10-05 17:03:11 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2020-10-05 17:03:17 <monochrom> It is mentioned for "immutable references to help with explicating cycles"
2020-10-05 17:03:34 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-10-05 17:04:35 Guest_45 joins (590fec7f@x590fec7f.dyn.telefonica.de)
2020-10-05 17:04:56 × sQVe quits (~sQVe@unaffiliated/sqve) (Quit: Bye!)
2020-10-05 17:05:16 <int-e> Not sure that it does anything about cycles... oh well. It still compiles with ghc-8.10, I'll stop worrying :)
2020-10-05 17:05:29 × zoom quits (44beb1c9@068-190-177-201.res.spectrum.com) (Ping timeout: 245 seconds)
2020-10-05 17:06:07 × borne quits (~fritjof@200116b86471bb007fe01feb1760d29e.dip.versatel-1u1.de) (Ping timeout: 240 seconds)
2020-10-05 17:07:19 <monochrom> It has Eq so we can observe aliasing in pure functions.
2020-10-05 17:07:38 juliusdeane parts (~user@130.64.35.16) ("ERC (IRC client for Emacs 26.3)")
2020-10-05 17:07:58 <zoom84> could really use some help understanding implementing functors for type constructors that take two params. I read through the learnyouhaskll example of the Either type and generally understand the notion of partially applying the typeclass via Functor (Either a) but I'm getting twisted in knots trying to understand how the class Functor translates
2020-10-05 17:07:58 <zoom84> to the implementation of Functor (MyEither a)
2020-10-05 17:08:21 <int-e> monochrom: Oh right. Heh... it's been so long.
2020-10-05 17:08:38 <zoom84> I created my own type to experiment:
2020-10-05 17:08:49 <zoom84> data MyEither a b = MyLeft a | MyRight b deriving(Show)
2020-10-05 17:08:58 <zoom84> instance Functor (MyEither a) where
2020-10-05 17:09:06 <zoom84> fmap f (MyRight b) = MyRight (f b)
2020-10-05 17:09:11 <ski> monochrom : er, right
2020-10-05 17:09:14 <zoom84> fmap f (MyLeft x) = MyLeft x
2020-10-05 17:09:38 <ski> (it also has `read :: IVar a -> a')
2020-10-05 17:09:39 <monochrom> That's correct. What's the error message?
2020-10-05 17:10:05 × Guest18 quits (567e8866@gateway/web/cgi-irc/kiwiirc.com/ip.86.126.136.102) (Quit: Connection closed)
2020-10-05 17:10:26 <zoom84> learnyouhaskell says the effective prototype would be would be : (b -> c) -> MyEither a b -> MyEither a c
2020-10-05 17:10:47 <ski> zoom84 : "generally understand the notion of partially applying the typeclass via Functor (Either a)" -- the type class (`Functor') isn't partially applied, it's the `data' type, `Either', that is
2020-10-05 17:11:23 <ski> yes, that's a correct type signature for `fmap' here
2020-10-05 17:11:26 <zoom84> I get the "MyEither a b" part, but I don't understand how the "c" var is introduced, for both b->c and My Either a c
2020-10-05 17:12:00 <monochrom> OK. Allow me to use the shorthand E to stand for "Either a".
2020-10-05 17:12:14 <monochrom> You expect (b->c) -> E b -> E c, no?
2020-10-05 17:12:23 <monochrom> Now expand E to Either a.
2020-10-05 17:12:49 × pfurla quits (~pfurla@104.192.219.186) (Quit: gone to sleep. ZZZzzz…)
2020-10-05 17:13:12 <monochrom> or s/Either/MyEither/g throughout
2020-10-05 17:13:15 <zoom84> why is it (b -> c) instead of (a->b)
2020-10-05 17:13:18 <ski> zoom84 : if you add the line `{-# LANGUAGE InstanceSigs #-}' to the top of your module, then you should be able to put the type signature `fmap :: (b -> c) -> MyEither a b -> MyEither a c' inside your `instance'
2020-10-05 17:13:23 × ericsagnes quits (~ericsagne@2405:6580:0:5100:953c:5f38:35fd:b3fd) (Ping timeout: 272 seconds)
2020-10-05 17:13:40 <zoom84> consdering fmap in the class is map :: (a -> b) -> f a -> f b
2020-10-05 17:13:43 <monochrom> "a" is already used up in "MyEither a". Gotta think up other variable names.
2020-10-05 17:13:54 <zoom84> ahh...
2020-10-05 17:14:02 <ski> zoom84 : the names of type variables doesn't really matter (as long as you use them consistently, within one context)
2020-10-05 17:14:05 <sim590> zoom84: it's the return type of your function that is applied to the right part of the MyEither type. Functor describes how to map a function onto elements in the type. The implementation of Functor for Either chooses to apply the map on the right side by convention. That's what you wrote with your example for MyEither. When f is applied on the `b` type, it becomes a ̀c`.
2020-10-05 17:14:20 <ski> saying
2020-10-05 17:14:24 <ski> class Functor f
2020-10-05 17:14:24 <zoom84> @monochrome, let me process that and see if it makes sense then...
2020-10-05 17:14:25 <lambdabot> Unknown command, try @list
2020-10-05 17:14:26 <ski> where
2020-10-05 17:14:32 <ski> fmap :: (a -> b) -> (f a -> f b)
2020-10-05 17:14:37 <ski> is the same thing, as saying
2020-10-05 17:14:39 <ski> class Functor f
2020-10-05 17:14:40 <ski> where
2020-10-05 17:14:41 × cosimone quits (~cosimone@93-47-228-249.ip115.fastwebnet.it) (Quit: Quit.)
2020-10-05 17:14:45 <monochrom> For this reason I much prefer "(a -> b) -> Either x a -> Either x b" actually
2020-10-05 17:14:47 <ski> fmap :: (b -> c) -> (f b -> f c)
2020-10-05 17:15:06 <ski> iow, you can rename `a' and `b' to some other variable names here
2020-10-05 17:15:10 × dbmikus quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Remote host closed the connection)
2020-10-05 17:15:33 <int-e> monochrom: Oh I see. The Eq instance wasn't my idea. "this change was suggested by nwf" -- probably on IRC and I don't know who it was, which is why there's no proper credit for it in the changelog.
2020-10-05 17:15:36 <ski> (but you can't rename the `f' in the signature here, without also renaming the `f' in the type class head `class Functor f')
2020-10-05 17:16:33 cosimone joins (~cosimone@2001:b07:ae5:db26:b248:7aff:feea:34b6)
2020-10-05 17:18:01 × justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) (Ping timeout: 246 seconds)
2020-10-05 17:18:07 × Guest_45 quits (590fec7f@x590fec7f.dyn.telefonica.de) (Remote host closed the connection)
2020-10-05 17:19:22 brandly joins (~brandly@c-73-68-15-46.hsd1.ma.comcast.net)
2020-10-05 17:19:31 <zoom84> i've read countless times how the placeholder variable names like 'a' and 'b' have no significance in the names selected but I still manage to get tripped up when single-letter placeholders like that are used for when integrating different vars in a single case like functor
2020-10-05 17:20:19 <zoom84> i carry over the original use of "a" and "b" when integrating into a different type signature which also uses it's own letters. it's a constant source of confusion for me
2020-10-05 17:20:48 <zoom84> maybe I should just start using more descriptive variable names and dropping the letters, even though the convention is to use letters
2020-10-05 17:21:18 <ski> after a while, you'll probably get more used to renaming tyvars, on a by-need basis ?
2020-10-05 17:21:25 × cosimone quits (~cosimone@2001:b07:ae5:db26:b248:7aff:feea:34b6) (Ping timeout: 240 seconds)
2020-10-05 17:21:26 <lordcirth_> zoom84, descriptive names don't hurt
2020-10-05 17:21:37 × ggole quits (~ggole@2001:8003:8119:7200:18b6:6ff8:b669:283) (Ping timeout: 244 seconds)
2020-10-05 17:21:49 <ski> if they can sensibly be descriptive
2020-10-05 17:21:50 <hpc> the hard part is, for things that generic, what do you name them?
2020-10-05 17:21:54 <monochrom> descriptive names take forever to conjure, or forever to understand
2020-10-05 17:22:01 <ski> (and, i suspect, they can actually hurt, at times)
2020-10-05 17:22:13 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-05 17:22:29 <hpc> even the famously verbose java has the convention of "T" for type variables

All times are in UTC.