Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 526 527 528 529 530 531 532 533 534 535 536 .. 5022
502,152 events total
2020-10-09 05:01:16 <hololeap> so, a Traversal cannot be used as a lens, but the types make it seem like Traversals are a subset of Lenses
2020-10-09 05:02:01 <hololeap> type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t
2020-10-09 05:02:02 × nados quits (~dan@107-190-41-58.cpe.teksavvy.com) (Quit: Leaving)
2020-10-09 05:02:12 <hololeap> type Lens s t a b = forall f. Functor f => (a -> f b) -> s -> f t
2020-10-09 05:03:11 <hololeap> since all Applicatives are also Functors, why does it say in the lens docs that a Traversal cannot be used as a Lens
2020-10-09 05:04:14 <dolio> Functor f => Applicative f, so (Applicative f => T) < (Functor f => T)
2020-10-09 05:05:07 × Dungdv quits (abf4bce2@gateway/web/cgi-irc/kiwiirc.com/ip.171.244.188.226) (Ping timeout: 240 seconds)
2020-10-09 05:06:24 <dolio> Wait, I wrote some of that backwards, didn't I?
2020-10-09 05:06:37 <hololeap> right, the set of Applicatives is a subset of the set of Functors
2020-10-09 05:06:40 <dolio> Anyhow, the subtyping relationship flips on the left of an arrow.
2020-10-09 05:07:00 <hololeap> so shouldn't the same be true for Traversals vs Lenses?
2020-10-09 05:07:47 <hololeap> therefore, any Traversal is also a Lens?
2020-10-09 05:07:53 <dibblego> it's the other way around
2020-10-09 05:08:08 <dolio> Applicative is the subtype.
2020-10-09 05:08:29 natechan joins (~natechan@108-233-125-227.lightspeed.sntcca.sbcglobal.net)
2020-10-09 05:09:13 <hololeap> any Applicative is also a Functor, therefore any Traversal should also be a Lens. what am i missing here?
2020-10-09 05:09:27 <dibblego> any Applicative is also a Functor, therefore any Lens should also be a Traversal
2020-10-09 05:09:57 <hololeap> but why?
2020-10-09 05:10:03 <dolio> Lenses work for every Functor, so they also work for every Applicative.
2020-10-09 05:10:11 <dibblego> because the types say so
2020-10-09 05:10:31 <dibblego> the constraint is in contravariant position
2020-10-09 05:10:33 <hololeap> oh, i get it now
2020-10-09 05:11:15 <hololeap> that was a little tricky :)
2020-10-09 05:12:05 <dibblego> Applicative f => f a -> b -- this function not only accepts any Applicative, but also any Functor
2020-10-09 05:13:38 <hololeap> that's freaky. i never thought about the fact that constraints could be contravariant
2020-10-09 05:13:48 <hololeap> although it makes total sense intuitively
2020-10-09 05:15:47 × fresheyeball quits (~isaac@c-71-237-105-37.hsd1.co.comcast.net) (Ping timeout: 240 seconds)
2020-10-09 05:16:45 <hololeap> dolio: what is a subtyping relationship?
2020-10-09 05:17:29 <dolio> A is a subtype of B if every A can be used when a B is required.
2020-10-09 05:18:37 <hololeap> i reread the sentence, and you're saying that if it's used in the negative position, the relationship is reversed, aka contravariant
2020-10-09 05:19:14 <dolio> Yes.
2020-10-09 05:20:56 jedws joins (~jedws@121.209.161.98)
2020-10-09 05:21:05 <hololeap> although, in these cases, the constraint is placed on a variable that appears in the negative and positive positions
2020-10-09 05:21:17 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-10-09 05:22:18 × sand_dull quits (~theuser@104.140.53.43) (Ping timeout: 260 seconds)
2020-10-09 05:23:56 <dolio> That part doesn't matter, because what's being subtyped is the type class, basically.
2020-10-09 05:24:15 <dolio> You could think of it as the dictionaries being subtypes, if you want.
2020-10-09 05:25:09 <hololeap> wait, what are these dictionaries you mentioned?
2020-10-09 05:26:10 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 256 seconds)
2020-10-09 05:26:38 coot joins (~coot@37.30.49.218.nat.umts.dynamic.t-mobile.pl)
2020-10-09 05:27:26 <dolio> A record that contains the methods and superclasses of the type class.
2020-10-09 05:28:21 <dolio> For Functor, {fmap}, and for Applicative, {fmap, pure, (<*>)}, or something.
2020-10-09 05:29:24 aqd joins (~aqd@87-92-145-87.rev.dnainternet.fi)
2020-10-09 05:29:40 <spinnylights> sm[m]: submitted ^^ there were a few small config changes needed as well but it should only a take a moment to look over
2020-10-09 05:30:08 <hololeap> you know, the more i think about it, the more i see the obviousness of the answer here. i'm not sure what made me think it would be otherwise >_>
2020-10-09 05:30:45 alp joins (~alp@2a01:e0a:58b:4920:c189:de1b:78e1:7d82)
2020-10-09 05:31:15 takuan joins (~takuan@178-116-218-225.access.telenet.be)
2020-10-09 05:31:16 <dolio> Well, the fact that it's written `Functor f => Applicative f` probably doesn't help.
2020-10-09 05:32:43 <hololeap> it's saying that Functor f is equal to or larger then Applicative :)
2020-10-09 05:32:50 <dolio> It even made me give you the wrong answer at first.
2020-10-09 05:36:15 × alp quits (~alp@2a01:e0a:58b:4920:c189:de1b:78e1:7d82) (Ping timeout: 272 seconds)
2020-10-09 05:37:14 <proofofme> One more question: How do I process a type of `IO (Maybe [String])` line by line? For now, just to `print` it line by line. `print =<< allStrings` works, but it doesn't provide the line-by-line control
2020-10-09 05:38:02 <Taneb> :t mapM_
2020-10-09 05:38:16 <lambdabot> (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
2020-10-09 05:38:47 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-10-09 05:38:58 <Taneb> proofofme: if you make a function of type "Maybe [String] -> IO a" then you can use it with (=<<) like you're doing with print
2020-10-09 05:39:22 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-09 05:40:20 dyeplexer joins (~lol@unaffiliated/terpin)
2020-10-09 05:42:42 × falafel quits (~falafel@2605:e000:1527:d491:1ccf:5c8d:7928:e9cc) (Ping timeout: 260 seconds)
2020-10-09 05:43:39 Guest40023 is now known as lep-delete
2020-10-09 05:43:40 lep-delete is now known as Guest40023
2020-10-09 05:43:42 Guest40023 is now known as lep-delete
2020-10-09 05:44:53 × proofofme quits (~proofofme@184-96-74-65.hlrn.qwest.net) (Remote host closed the connection)
2020-10-09 05:46:07 × xff0x quits (~fox@2001:1a81:53da:5200:18dc:5fd3:ab0c:ba1c) (Ping timeout: 240 seconds)
2020-10-09 05:47:36 xff0x joins (~fox@2001:1a81:53da:5200:18dc:5fd3:ab0c:ba1c)
2020-10-09 05:48:15 maroloccio joins (~marolocci@212.129.85.119)
2020-10-09 05:49:17 × GyroW_ quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
2020-10-09 05:49:35 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
2020-10-09 05:49:36 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
2020-10-09 05:49:36 GyroW joins (~GyroW@unaffiliated/gyrow)
2020-10-09 05:58:39 Dungdv joins (abf4bce2@gateway/web/cgi-irc/kiwiirc.com/ip.171.244.188.226)
2020-10-09 06:00:01 × jpcw1 quits (~jpcw@195.206.169.184) ()
2020-10-09 06:00:07 × solonarv quits (~solonarv@adijon-655-1-70-207.w90-13.abo.wanadoo.fr) (Ping timeout: 240 seconds)
2020-10-09 06:00:24 <Axman6> :t mapM (mapM putStrLn)
2020-10-09 06:00:27 <lambdabot> (Traversable t1, Traversable t2) => t1 (t2 String) -> IO (t1 (t2 ()))
2020-10-09 06:00:44 <Axman6> :t mapM (mapM putStrLn) `asAppliedTo` (undefined :: Maybe [String])
2020-10-09 06:00:46 <lambdabot> Maybe [String] -> IO (Maybe [()])
2020-10-09 06:01:10 <Axman6> :t mapM_ (mapM_ putStrLn) `asAppliedTo` (undefined :: Maybe [String])
2020-10-09 06:01:12 <lambdabot> Maybe [String] -> IO ()
2020-10-09 06:02:37 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-10-09 06:03:06 danvet_ joins (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa)
2020-10-09 06:03:24 snakemas1 joins (~snakemast@213.100.206.23)
2020-10-09 06:04:17 × kori quits (~kori@arrowheads/kori) (Ping timeout: 260 seconds)
2020-10-09 06:06:45 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds)
2020-10-09 06:07:47 × snakemas1 quits (~snakemast@213.100.206.23) (Ping timeout: 240 seconds)
2020-10-09 06:12:15 toorevitimirp joins (~tooreviti@117.182.180.245)
2020-10-09 06:19:27 hackage Z-Data 0.1.5.0 - Array, vector and text https://hackage.haskell.org/package/Z-Data-0.1.5.0 (winterland)
2020-10-09 06:20:56 <hololeap> type Iso s t a b = forall p f. (Profunctor p, Functor f) => p a (f b) -> p s (f t)
2020-10-09 06:21:21 <hololeap> could this not be simplified since Star f is already a profunctor?
2020-10-09 06:21:44 <hololeap> type Iso s t a b = forall p. Profunctor p => p a b -> p s t
2020-10-09 06:25:58 <hololeap> maybe this would conflict with Lens, etc being a subtype of Iso
2020-10-09 06:26:08 <hololeap> that must be the reason
2020-10-09 06:27:19 <Taneb> hololeap: yeah, that's the reason
2020-10-09 06:27:29 <Taneb> We want to be able to compose a lens with an iso
2020-10-09 06:27:33 snakemas1 joins (~snakemast@213.100.206.23)
2020-10-09 06:27:38 chele joins (~chele@ip5b416ea2.dynamic.kabel-deutschland.de)
2020-10-09 06:27:47 <Taneb> There's another style of lenses called "pure profunctor" lenses
2020-10-09 06:28:12 × sfvm quits (~sfvm@37.228.215.148) (Quit: off to the basement, mixing up the medicine)
2020-10-09 06:28:24 <Taneb> Which I think has type Lens s t a b = Strong p => p a b -> p s t
2020-10-09 06:29:34 <hololeap> oh ok

All times are in UTC.