Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-13 04:42:32 × jedws quits (~jedws@101.184.175.183) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-11-13 04:43:28 jedws joins (~jedws@101.184.175.183)
2020-11-13 04:43:30 <bqv> looks about as good as you'll get, to me
2020-11-13 04:45:20 × jedws quits (~jedws@101.184.175.183) (Client Quit)
2020-11-13 04:45:55 conal joins (~conal@64.71.133.70)
2020-11-13 04:47:36 <jakob_> actually the type MyNum has a lot of constructors (in my non example code its MyValue) and i want a check for every constructor. That would mean writing a lot these isMy... functions
2020-11-13 04:48:58 <bqv> well in that case, why not make a newtyped Eq instance which only compares the constructor
2020-11-13 04:50:15 <bqv> then you can do e.g. any (\x -> TypeOf x == MyRationalType)
2020-11-13 04:50:26 jonatanb joins (~jonatanb@83.24.155.27.ipv4.supernova.orange.pl)
2020-11-13 04:50:52 × conal quits (~conal@64.71.133.70) (Ping timeout: 256 seconds)
2020-11-13 04:54:16 <jakob_> ah, that sounds like a neat idea. I'll try it
2020-11-13 04:54:45 × jonatanb quits (~jonatanb@83.24.155.27.ipv4.supernova.orange.pl) (Ping timeout: 240 seconds)
2020-11-13 04:55:27 × renzhi quits (~renzhi@2607:fa49:655f:e600::28da) (Ping timeout: 260 seconds)
2020-11-13 04:55:52 <dsal> > [Left 1, Left 2, Left 3, Right 4, Left 5] ^? folded . _Right -- jakob_ non-beginner answer for LOL
2020-11-13 04:55:54 <lambdabot> Just 4
2020-11-13 04:56:12 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-11-13 04:56:57 <bqv> lenses solve everything
2020-11-13 04:57:27 <dsal> The cause of, and solution to...
2020-11-13 05:01:06 <dsal> `myDouble :: MyNum -> Just Double` is probably more useful, though.
2020-11-13 05:01:15 <dsal> er, Maybe
2020-11-13 05:01:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
2020-11-13 05:02:39 clog joins (~nef@bespin.org)
2020-11-13 05:04:47 × polyphem quits (~p0lyph3m@2a02:810d:640:776c:76d7:55f6:f85b:c889) (Ping timeout: 260 seconds)
2020-11-13 05:07:18 jedws joins (~jedws@101.184.175.183)
2020-11-13 05:07:57 dbmikus__ joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com)
2020-11-13 05:07:57 Jonkimi727406120 joins (~Jonkimi@119.123.240.220)
2020-11-13 05:10:25 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 264 seconds)
2020-11-13 05:11:01 <jakob_> bqv this is not what you suggested i suppose? https://pastebin.com/m5gh6TrS
2020-11-13 05:11:31 <bqv> ah, not quite
2020-11-13 05:11:49 <jakob_> i thought so ;)
2020-11-13 05:12:23 <jakob_> do you have a hint what you would go for
2020-11-13 05:12:23 × motte quits (~weechat@unaffiliated/motte) (Ping timeout: 260 seconds)
2020-11-13 05:12:37 × dbmikus__ quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 256 seconds)
2020-11-13 05:13:10 <dsal> bqv's suggestion involved making a newtype called TypeOf
2020-11-13 05:13:49 <bqv> jakob_: think i overthought that one, pastebin.com/z4SvV5wr
2020-11-13 05:15:02 <dsal> I still think the is* model is probably not great.
2020-11-13 05:15:43 <bqv> hard to tell, without more info
2020-11-13 05:16:38 <jakob_> dsal yes, the maybe version might be helpful indeed. I'll try it after i got this one working
2020-11-13 05:16:50 × jedws quits (~jedws@101.184.175.183) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-11-13 05:17:24 <dsal> e.g.:
2020-11-13 05:17:26 <bqv> it's probably simpler codewise, thanks to makePrisms
2020-11-13 05:17:43 <dsal> > myInteger (MyDouble 3)
2020-11-13 05:17:45 <lambdabot> Nothing
2020-11-13 05:17:50 <dsal> > myInteger (MyInteger 3)
2020-11-13 05:17:52 <lambdabot> Just 3
2020-11-13 05:17:55 <dsal> :t myInteger
2020-11-13 05:17:56 <lambdabot> MyNum -> Maybe Integer
2020-11-13 05:18:02 <dsal> :t isJust . myInteger
2020-11-13 05:18:03 <lambdabot> MyNum -> Bool
2020-11-13 05:18:15 uhrenmacher joins (~uhrenmach@p4fc078af.dip0.t-ipconnect.de)
2020-11-13 05:18:24 jedws joins (~jedws@101.184.175.183)
2020-11-13 05:18:50 <bqv> i just suggested the more direct route because it's a lot less boilerplate
2020-11-13 05:18:55 × uhrenmacher quits (~uhrenmach@p4fc078af.dip0.t-ipconnect.de) (Remote host closed the connection)
2020-11-13 05:20:07 <dsal> Sure, it's a shorter path to the stated goal. I just don't like the goal. :)
2020-11-13 05:20:27 <bqv> simple questions get simple answers :p
2020-11-13 05:20:41 <dsal> Yeah, I'm trying to remember how to write a prism by hand.
2020-11-13 05:20:49 <bqv> :t prism
2020-11-13 05:20:51 <lambdabot> (Choice p, Applicative f) => (b -> t) -> (s -> Either t a) -> p a (f b) -> p s (f t)
2020-11-13 05:20:52 <bqv> :t prism'
2020-11-13 05:20:53 <lambdabot> (Choice p, Applicative f) => (b -> s) -> (s -> Maybe a) -> p a (f b) -> p s (f s)
2020-11-13 05:23:45 <jakob_> bvq https://pastebin.com/d30J3Usw thanks for the hint.
2020-11-13 05:25:05 × denisse quits (~spaceCat@gateway/tor-sasl/alephzer0) (Remote host closed the connection)
2020-11-13 05:25:25 denisse joins (~spaceCat@gateway/tor-sasl/alephzer0)
2020-11-13 05:26:39 Jeanne-Kamikaze joins (~Jeanne-Ka@66.115.189.209)
2020-11-13 05:30:07 <koz_> :t confusing
2020-11-13 05:30:09 <lambdabot> Applicative f => LensLike (Data.Functor.Day.Curried.Curried (Data.Functor.Yoneda.Yoneda f) (Data.Functor.Yoneda.Yoneda f)) s t a b -> LensLike f s t a b
2020-11-13 05:30:35 <Axman6> :t confusing traverse
2020-11-13 05:30:36 <lambdabot> (Applicative f, Traversable t) => LensLike f (t a) (t b) a b
2020-11-13 05:30:36 × whatisRT quits (~whatisRT@2002:5b41:6a33:0:d89f:d10e:927a:2962) (Read error: Connection reset by peer)
2020-11-13 05:31:07 day_ joins (~Unknown@unaffiliated/day)
2020-11-13 05:33:01 <bqv> confusing is confusing
2020-11-13 05:33:37 <bqv> aiui it's effect isn't visible at type-level so it's weird
2020-11-13 05:34:11 × Jonkimi727406120 quits (~Jonkimi@119.123.240.220) (Ping timeout: 265 seconds)
2020-11-13 05:34:29 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-11-13 05:34:40 × day quits (~Unknown@unaffiliated/day) (Ping timeout: 265 seconds)
2020-11-13 05:34:40 day_ is now known as day
2020-11-13 05:35:00 <Axman6> it's secret make go faster juice
2020-11-13 05:35:19 <bqv> :D
2020-11-13 05:38:35 <koz_> :t confusing fmap
2020-11-13 05:38:37 <lambdabot> Applicative f => LensLike f (Data.Functor.Day.Curried.Curried (Data.Functor.Yoneda.Yoneda f) (Data.Functor.Yoneda.Yoneda f) a) (Data.Functor.Day.Curried.Curried (Data.Functor.Yoneda.Yoneda f) (Data.
2020-11-13 05:38:37 <lambdabot> Functor.Yoneda.Yoneda f) b) a b
2020-11-13 05:42:30 <bqv> :t lens . has . confusing . elements
2020-11-13 05:42:31 <lambdabot> error:
2020-11-13 05:42:31 <lambdabot> • Couldn't match type ‘Gen a’
2020-11-13 05:42:31 <lambdabot> with ‘(a0
2020-11-13 05:42:37 <bqv> darn
2020-11-13 05:42:42 <bqv> that worked on a repl
2020-11-13 05:43:21 <bqv> :: (Traversable t1, Functor f) => (Int -> Bool) -> (t1 a -> b -> t2) -> (Bool -> f b) -> t1 a -> f t2
2020-11-13 05:44:24 AbhayAysola joins (312587e9@49.37.135.233)
2020-11-13 05:45:12 <koz_> What package(s) did those identifiers come from?
2020-11-13 05:45:16 Jonkimi727406120 joins (~Jonkimi@119.123.240.220)
2020-11-13 05:45:21 <koz_> I think lambdabot might have something else for one or more of them.
2020-11-13 05:45:30 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-11-13 05:45:33 <koz_> :t is
2020-11-13 05:45:34 <lambdabot> error:
2020-11-13 05:45:34 <lambdabot> • Variable not in scope: is
2020-11-13 05:45:34 <lambdabot> • Perhaps you meant one of these:
2020-11-13 05:45:37 <koz_> :(
2020-11-13 05:45:39 <bqv> they'll all be from lens, for me
2020-11-13 05:45:42 <Axman6> % :t lens . has . confusing . elements

All times are in UTC.