Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-26 05:59:31 <jle`> oh btw there is an instance of `As () a` btw
2020-11-26 05:59:52 <crestfallen> thanks a lot MarcelineVQ happy thanksgiving if it matters to you.
2020-11-26 05:59:57 <jle`> er wait sorry
2020-11-26 05:59:59 <jle`> i mean As Void a
2020-11-26 06:00:09 <jle`> it's the analogue of Has () a
2020-11-26 06:00:17 × conal_ quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
2020-11-26 06:00:28 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 246 seconds)
2020-11-26 06:00:31 <jle`> ah, but there is no such instance in Data.Has. probably because of overlapping instances
2020-11-26 06:00:33 <jle`> nevermind :)
2020-11-26 06:01:48 × adm_ quits (~adm@43.229.88.197) (Ping timeout: 272 seconds)
2020-11-26 06:02:00 thatlinuxguy joins (~sand49@2001:8003:8431:d200:8d49:ec:3d23:9521)
2020-11-26 06:03:22 sord937 joins (~sord937@gateway/tor-sasl/sord937)
2020-11-26 06:04:20 christo joins (~chris@81.96.113.213)
2020-11-26 06:07:03 <incertia> _Void also happens to be Prism s s a Void and we are restricted to Prism s s a a
2020-11-26 06:07:03 <thatlinuxguy> Hi im having troble with generic typing. I'm trying to make a function that will return a flattened version of a given list. What I can't figure out is how to know when you've reached an element and not another list when recursing into the list, I know all elements of the base list will have the same depth because the list must be homogeneous but how do you determine what that is.
2020-11-26 06:07:40 <thatlinuxguy> sorry if I interrupted
2020-11-26 06:07:43 <crestfallen> MarcelineVQ: wondering. in both divv and divvy, we bind the result of read to x, but that is just the s (not the 'a' in (a,s) as well); i.e in \x it is just the single value of state: 's' .. correct?
2020-11-26 06:08:30 <jle`> incertia: that unifies though, with a ~ Void
2020-11-26 06:08:42 <jle`> so you can use _Void as a Prism s s a a
2020-11-26 06:08:54 <jle`> oh ah, my explanation is wrong
2020-11-26 06:09:09 × christo quits (~chris@81.96.113.213) (Ping timeout: 260 seconds)
2020-11-26 06:09:37 christo joins (~chris@81.96.113.213)
2020-11-26 06:10:16 <crestfallen> the second place of the tuple, (a,s) or (s,s)
2020-11-26 06:10:24 <incertia> thatlinuxguy: if flatten :: [[a]] -> [a] your first pattern match will be on a list. e.g. flatten (a:as) = ... <-- here a is a list and you can further pattern match on that
2020-11-26 06:11:01 Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas)
2020-11-26 06:11:29 <MarcelineVQ> It's the a, the first place of the tuple, because the a is what the Monad instance acts upon and >>= is from Monad. read just happens to put the same value into both sides of the tuple.
2020-11-26 06:11:44 <incertia> so like flatten ((b:bs):as) = b : flatten (bs:as) and flatten ((b:[]):as) = b : flatten as
2020-11-26 06:12:04 <thatlinuxguy> ok cool that makes sense incertia
2020-11-26 06:12:13 conal joins (~conal@64.71.133.70)
2020-11-26 06:12:36 <crestfallen> very helpful, thanks, I think that's why I was having trouble writing the read into it MarcelineVQ
2020-11-26 06:12:51 × christo quits (~chris@81.96.113.213) (Remote host closed the connection)
2020-11-26 06:13:01 × conal quits (~conal@64.71.133.70) (Client Quit)
2020-11-26 06:13:20 alp joins (~alp@2a01:e0a:58b:4920:fde0:51bd:f252:73ea)
2020-11-26 06:13:43 <jle`> incertia: yeah, _Void works for As Void a, it unifies as a Prism a a Void Void
2020-11-26 06:14:54 <jle`> previewer = const Nothing; reviewer = absurd
2020-11-26 06:15:00 <incertia> jle`: Prism a Void => previewer :: a -> Maybe Void seems kinda weird
2020-11-26 06:15:06 <incertia> do we just have previewer = const Nothing?
2020-11-26 06:15:11 <jle`> it's weird, but lawful :)
2020-11-26 06:15:45 Guest10117 joins (~vollenwei@4e69b241.skybroadband.com)
2020-11-26 06:16:03 <jle`> a Lens' S A means that there is some type x where S is equivalent to (A, x)
2020-11-26 06:16:04 <incertia> i guess reviewer = absurd makes sense
2020-11-26 06:16:11 <jle`> S is some product of A and some other type
2020-11-26 06:16:18 <jle`> so you can "factor" S
2020-11-26 06:16:29 <jle`> a Prism' S A means that there is some type x where S is equivalent to Either A x
2020-11-26 06:16:40 <jle`> S is a sum of A and some other type, so you can "split" S, sum-wise
2020-11-26 06:16:57 <incertia> splitting with void makes sense yeah
2020-11-26 06:17:06 <jle`> in the case of united, Lens' s () is saying that any s is equivalent to ((), s)
2020-11-26 06:17:22 <jle`> and in the case of _Void, Prism' s Void is saying that any s is equivalent to Either Void s
2020-11-26 06:17:35 <jle`> maybe more of a theoretical nicety than a useful thing though
2020-11-26 06:17:54 <incertia> the sum perspective makes much more sense
2020-11-26 06:18:00 christo joins (~chris@81.96.113.213)
2020-11-26 06:18:02 <jle`> that might be why there is no `Has () a` instance
2020-11-26 06:18:11 <koz_> Maybe Void is actually () in disguise. :P
2020-11-26 06:18:26 <incertia> no void is equivalent to empty set
2020-11-26 06:18:31 <incertia> and () is a set with one element
2020-11-26 06:20:05 adm_ joins (~adm@43.229.88.197)
2020-11-26 06:20:16 × Guest10117 quits (~vollenwei@4e69b241.skybroadband.com) (Ping timeout: 240 seconds)
2020-11-26 06:20:29 <incertia> Has () a does not cause any overlapping instance warning
2020-11-26 06:20:40 <incertia> ghc just tells me it's orphaned
2020-11-26 06:20:55 <incertia> but it doesn't seem to be very useful which is probably why it's not there
2020-11-26 06:21:01 <jle`> yeah, i'm guessing that there must have been some reason why it was not included
2020-11-26 06:21:23 <jle`> i wonder
2020-11-26 06:21:34 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2020-11-26 06:22:05 × christo quits (~chris@81.96.113.213) (Ping timeout: 240 seconds)
2020-11-26 06:24:51 × SanchayanMaity quits (~Sanchayan@171.76.82.54) (Remote host closed the connection)
2020-11-26 06:25:05 × Saukk quits (~Saukk@2001:998:f9:2914:1c59:9bb5:b94c:4) (Remote host closed the connection)
2020-11-26 06:25:39 SanchayanMaity joins (~Sanchayan@171.76.82.54)
2020-11-26 06:26:47 <koz_> incertia: There were missing quotes in what I said. I meant to say
2020-11-26 06:26:48 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 260 seconds)
2020-11-26 06:26:56 × adm_ quits (~adm@43.229.88.197) (Ping timeout: 240 seconds)
2020-11-26 06:26:58 <koz_> 'Maybe Void' is actually '()' in disguise.
2020-11-26 06:27:19 <incertia> ooooooo
2020-11-26 06:27:21 <incertia> that makes sense
2020-11-26 06:27:54 <koz_> Maybe a has cardinality 1 + the cardinality of a.
2020-11-26 06:28:04 <koz_> And since Void has cardinality 0... yeah. :P
2020-11-26 06:29:39 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2020-11-26 06:29:52 takuan joins (~takuan@178-116-218-225.access.telenet.be)
2020-11-26 06:30:08 <jle`> ha ha
2020-11-26 06:30:21 <jle`> maybe the real void was the friends we made along the way
2020-11-26 06:30:39 <koz_> The Void is clearly staring into jle`
2020-11-26 06:30:49 <incertia> the real friends were the voids we found along the way
2020-11-26 06:30:52 <incertia> because i have no friends
2020-11-26 06:30:53 <incertia> :)
2020-11-26 06:31:06 <koz_> incertia: Void is unique. :P
2020-11-26 06:31:11 <koz_> (thanks, axiom of extensionality)
2020-11-26 06:31:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
2020-11-26 06:32:34 × xff0x_ quits (~fox@2001:1a81:52e2:1100:66fc:dc44:c41d:a54) (Quit: xff0x_)
2020-11-26 06:35:40 adm_ joins (~adm@43.229.88.197)
2020-11-26 06:36:10 × Nahra quits (~Nahra@unaffiliated/nahra) (Quit: leaving)
2020-11-26 06:36:18 xff0x joins (~fox@2001:1a81:52e2:1100:66fc:dc44:c41d:a54)
2020-11-26 06:41:05 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-11-26 06:44:36 × caecilius quits (~caecilius@pool-108-46-151-95.nycmny.fios.verizon.net) (Ping timeout: 256 seconds)
2020-11-26 06:44:43 <crestfallen> :quit
2020-11-26 06:44:55 <crestfallen> exit
2020-11-26 06:44:58 <crestfallen> oops
2020-11-26 06:45:14 × crestfallen quits (~jvw@192-184-135-144.fiber.dynamic.sonic.net) (Quit: leaving)
2020-11-26 06:45:36 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds)
2020-11-26 06:47:04 × jedws quits (~jedws@101.184.180.34) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-11-26 06:47:30 gproto23 joins (~gproto23@unaffiliated/gproto23)
2020-11-26 06:47:49 × johnw quits (~johnw@haskell/developer/johnw) (Quit: ZNC - http://znc.in)

All times are in UTC.