Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-23 00:15:35 × Tario quits (~Tario@201.192.165.173) (Remote host closed the connection)
2021-03-23 00:15:51 <forp> Thanks Axman6
2021-03-23 00:16:13 <Axman6> which is one of my favourite resourtces for helping people "get" what it is to be monadic, without using HAskell
2021-03-23 00:16:56 stevenxl joins (~stevenlei@c-73-45-168-220.hsd1.il.comcast.net)
2021-03-23 00:18:20 javran joins (~javran@108-201-186-97.lightspeed.sntcca.sbcglobal.net)
2021-03-23 00:21:15 × stevenxl quits (~stevenlei@c-73-45-168-220.hsd1.il.comcast.net) (Ping timeout: 246 seconds)
2021-03-23 00:21:38 × average quits (uid473595@gateway/web/irccloud.com/x-dptrohonzedrpdag) (Quit: Connection closed for inactivity)
2021-03-23 00:22:56 <javran> Hi folks, I have a simple instance of Contravariant: https://github.com/Javran/unicode-general-category/blob/master/src/Data/Char/GeneralCategory/Predicates.hs#L79-L88 I'm wondering if this is easy to do with Generics (I have little to none experience regarding Generics)
2021-03-23 00:23:16 <forp> Axman6, this is a good talk I didn't expect
2021-03-23 00:24:06 Tario joins (~Tario@200.119.184.39)
2021-03-23 00:24:44 × acidjnk_new quits (~acidjnk@p200300d0c72b9578819a903e74dd056f.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
2021-03-23 00:25:04 <Axman6> javran: unless you need to do it for lots of types it's probably not worth the effort - I'm guessing Contravariant can't be automatically derived using another mechanism easily either :\
2021-03-23 00:25:39 × heatsink quits (~heatsink@2600:1700:bef1:5e10:90f:37ea:5699:98fc) (Remote host closed the connection)
2021-03-23 00:25:52 <dmwit> Huh, Contravariant is in base now. Neat.
2021-03-23 00:26:07 <dmwit> Looks like it already has instances for the relevant Generic stuff, too.
2021-03-23 00:27:06 <javran> dmwit: yes, that's when I started to wonder - I tried `contramap f p = to (contramap f (from p))`, which didn't work.
2021-03-23 00:27:23 <Axman6> shouldn't be too hard to add support for deriving it like Functor right?
2021-03-23 00:27:31 <javran> I probably won't bother to actually do it for such a simple case, just wondering.
2021-03-23 00:27:42 <Axman6> it makes me sad that doesn't work :(
2021-03-23 00:27:53 <monochrom> Axman6, forp: "for(a in anArray) { for(b in anotherArray)" would just need the list Applicative; for full use of the list Monad, make "anotherArray" a function of a.
2021-03-23 00:27:56 <Axman6> that instance should totally be in Generic though
2021-03-23 00:28:13 <Axman6> monochrom: shhh :)
2021-03-23 00:28:22 <monochrom> OK!
2021-03-23 00:28:46 mp___ joins (mp@hell.cx)
2021-03-23 00:28:58 × nighmi quits (~felix@port-83-236-34-206.dynamic.as20676.net) (Quit: WeeChat 3.0.1)
2021-03-23 00:29:08 × solidus-river quits (~mike@174.127.249.180) (Quit: leaving)
2021-03-23 00:29:27 Vadrigar_ joins (~Vadrigar@ip5b417208.dynamic.kabel-deutschland.de)
2021-03-23 00:29:45 ski . o O ( "Escaping Hell with Monads" by Philip Nilsson in 2017-05-08 at <https://philipnilsson.github.io/Badness10k/escaping-hell-with-monads/> )
2021-03-23 00:29:53 × fissureman quits (~quassel@c-73-201-159-163.hsd1.dc.comcast.net) (Ping timeout: 260 seconds)
2021-03-23 00:31:11 <monochrom> Heh badness 10000 = TeX overflow
2021-03-23 00:32:26 dcoutts__ joins (~duncan@94.186.125.91.dyn.plus.net)
2021-03-23 00:33:42 × Vadrigar_ quits (~Vadrigar@ip5b417208.dynamic.kabel-deutschland.de) (Ping timeout: 256 seconds)
2021-03-23 00:34:28 × conal quits (~conal@192.145.118.79) (Quit: Computer has gone to sleep.)
2021-03-23 00:35:01 <Axman6> javran: what's this project for anyway?
2021-03-23 00:35:50 j is now known as jess
2021-03-23 00:36:04 <javran> Axman6: a byproduct as my adventure towards a Java parser using Alex/Happy :)
2021-03-23 00:36:40 <javran> it's basically just Data.Char.generalCategory but with Unicode 13.0.0 database
2021-03-23 00:36:46 conal joins (~conal@192.145.118.79)
2021-03-23 00:36:59 <javran> (since Java SE 15+ Spec calls for Unicode 13)
2021-03-23 00:37:20 × acarrico quits (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) (Ping timeout: 240 seconds)
2021-03-23 00:37:33 <Axman6> fun :) you could combine this with dibblego's javaclass package: https://hackage.haskell.org/package/javaclass-0.0.1/docs/Language-Java-Class-ClassFile.html
2021-03-23 00:38:46 <javran> Thanks for the link, I'll take a note of that
2021-03-23 00:38:48 × Tario quits (~Tario@200.119.184.39) (Read error: Connection reset by peer)
2021-03-23 00:39:02 <Axman6> javran: also, do you reckon this might be useful for Data.Char?
2021-03-23 00:39:19 <Axman6> javran: that package is pure craziness (Sorry Tony)
2021-03-23 00:39:51 <dibblego> yeah it was a crazy time
2021-03-23 00:40:19 <Axman6> sure was
2021-03-23 00:40:22 <javran> I'm not sure what other use could it have though - just to untie Unicode depedency from any specific GHC version
2021-03-23 00:40:38 <dibblego> I'd do it differently today, but not a lot
2021-03-23 00:41:04 <javran> as base ships with its own Unicode database, which is manually updated and outdated a bit these days
2021-03-23 00:41:07 × puffnfresh_ quits (~puffnfres@45.76.124.5) (Ping timeout: 265 seconds)
2021-03-23 00:41:23 <Axman6> yeah I wondered how out of date it was
2021-03-23 00:41:45 <javran> The file is libraries/base/cbits/WCsubst.c
2021-03-23 00:41:54 <javran> (In GHC repo)
2021-03-23 00:41:55 puffnfresh joins (~puffnfres@45.76.124.5)
2021-03-23 00:43:09 <javran> speak of which I'm not sure how performant GHC version is doing - for now it's not supercritical so I just binary-search a unboxed Array, wondering why is this bit in C
2021-03-23 00:44:07 <Axman6> I've been meaning for a few weeks to rewrite bits of https://github.com/BobSteagall/utf_utils in Haskell for the text-utf8 package
2021-03-23 00:44:48 Tario joins (~Tario@201.192.165.173)
2021-03-23 00:45:34 heatsink joins (~heatsink@2600:1700:bef1:5e10:90f:37ea:5699:98fc)
2021-03-23 00:46:20 <Axman6> I have a PR that I didn't quite finish off for navigating utf8 encoded data that was 100x faster than take and drop using stream fusion using SIMDish ideas, but never finished off the last part
2021-03-23 00:46:20 rajivr joins (uid269651@gateway/web/irccloud.com/x-qhxglwtyogwwwcfv)
2021-03-23 00:50:20 × Raito_Bezarius quits (~Raito@unaffiliated/raito-bezarius/x-8764578) (Remote host closed the connection)
2021-03-23 00:50:41 Raito_Bezarius joins (~Raito@unaffiliated/raito-bezarius/x-8764578)
2021-03-23 00:50:43 stevenxl joins (~stevenlei@c-73-45-168-220.hsd1.il.comcast.net)
2021-03-23 00:52:04 <dmwit> oh
2021-03-23 00:52:10 <dmwit> Yet Another String (tm)
2021-03-23 00:52:55 <dmwit> At some point all these add is frequent interconversions. To really be an efficiency win your whole infrastructure has to agree on a single choice.
2021-03-23 00:54:38 × forp quits (57e3c46d@87.227.196.109) (Quit: Connection closed)
2021-03-23 00:54:54 <dmwit> What happened with backpack? Where is the string-adapter pack?
2021-03-23 00:55:11 × stevenxl quits (~stevenlei@c-73-45-168-220.hsd1.il.comcast.net) (Ping timeout: 256 seconds)
2021-03-23 00:57:43 <Axman6> well text-utf8 was intended to be a replacement for text eventually once it proved itself. what I really want is text-utf8 with a concise structure to give O(1) indexing - newhoggy's got a package that could allow that pretty easily
2021-03-23 00:58:42 <Axman6> and the space overhead would be like something like 0.25% or something crazy like that
2021-03-23 00:59:58 <Axman6> uh, succinct, not concise
2021-03-23 01:00:03 <dmwit> I figured.
2021-03-23 01:01:18 Axman6 thinks concise would be a good name for a library of succinct data structures
2021-03-23 01:01:43 × Deide quits (~Deide@217.155.19.23) (Quit: Seeee yaaaa)
2021-03-23 01:04:35 slack1256 joins (~slack1256@dvc-186-186-101-190.movil.vtr.net)
2021-03-23 01:05:57 × dragestil quits (~quassel@fsf/member/dragestil) (Ping timeout: 264 seconds)
2021-03-23 01:07:01 × slack1256 quits (~slack1256@dvc-186-186-101-190.movil.vtr.net) (Remote host closed the connection)
2021-03-23 01:08:11 dragestil joins (~quassel@fsf/member/dragestil)
2021-03-23 01:10:26 bobweb joins (ac3a11c2@172.58.17.194)
2021-03-23 01:11:41 <bobweb> Hi. I have this problem: https://paste.tomsmeding.com/enFWKfUv. Please help me to define an Applicative instance for a product datatype. Thank you.
2021-03-23 01:12:11 × stree quits (~stree@68.36.8.116) (Ping timeout: 256 seconds)
2021-03-23 01:13:39 × __monty__ quits (~toonn@unaffiliated/toonn) (Quit: leaving)
2021-03-23 01:14:36 × conal quits (~conal@192.145.118.79) (Quit: Computer has gone to sleep.)
2021-03-23 01:14:51 <monochrom> IIRC you need to start with "instance Monoid a => Applicative (Const a b)". You need the "Monoid a" assumption. Then you will find that the rest is a breeze.
2021-03-23 01:15:17 <monochrom> IOW you will find that a's mempty and mappend very useful.
2021-03-23 01:15:58 conal joins (~conal@192.145.118.79)
2021-03-23 01:16:13 <c_wraith> the problem is the definition of pure - I think you just lost track of what you were doing
2021-03-23 01:16:30 <bobweb> OK, now that I've posted I've seen some clue in the text along the lines of what you mention. Thank you. If not, I'll be back...
2021-03-23 01:16:47 <bobweb> yes, noob-itis...
2021-03-23 01:17:12 <c_wraith> But yeah, listen to monochrom. This needs Monoid, not just Semigroup
2021-03-23 01:17:27 <bobweb> OK.
2021-03-23 01:21:18 stevenxl joins (~stevenlei@c-73-45-168-220.hsd1.il.comcast.net)
2021-03-23 01:22:58 <bobweb> monochrom: and c_wraith: Thank you, it works now.
2021-03-23 01:23:05 <monochrom> :)
2021-03-23 01:23:48 × bobweb quits (ac3a11c2@172.58.17.194) (Quit: Connection closed)
2021-03-23 01:25:26 stree joins (~stree@68.36.8.116)
2021-03-23 01:26:24 × conal quits (~conal@192.145.118.79) (Quit: Computer has gone to sleep.)
2021-03-23 01:28:38 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)

All times are in UTC.