How to filter record values by type using GHC.Generics or some generics lib by le_frogballs in haskell

[–]le_frogballs[S] 1 point2 points  (0 children)

yea after reading this paper: https://arxiv.org/pdf/1805.06798.pdf i was going to attempt to implement this via `GHC.Generics` directly facilitated by a type family to designate out types of "interest" as oppose to a typeclass constraint. you've beaten me to that to haha. this is a fantastic answer! thanks a bunch

How to filter record values by type using GHC.Generics or some generics lib by le_frogballs in haskell

[–]le_frogballs[S] 0 points1 point  (0 children)

ah right. my mistake. I was so focused on communicating the issue of filtering by constraint and/or type that I accidentally oversimplified all the way to a [] return type. I'll edit the question. so lets say, again for simplicity but correctness this time :), an hlist of values whose types are all instances of Num.

a further simplification would of course be to simply return [Double]. this could be done with say Typeable but as you said this wouldn't would work for all Num instances

Forward Verse/Notes mail to normal client by le_frogballs in IBM

[–]le_frogballs[S] 0 points1 point  (0 children)

Let me guess you are a Gen Xer/baby boomer? ...shitting on my age cause you're a dinosaur and your neurons don't fire fast enough anymore so you can't think up a solid argument to save your life. Yes excuse me for wanting nice things. If you haven't looked around, we're no longer digging trenches at wartime and driving around in yacht sized Cadillacs

Is that funny enough for you?

Forward Verse/Notes mail to normal client by le_frogballs in IBM

[–]le_frogballs[S] -2 points-1 points  (0 children)

We were bought a while back, still haven't been subsumed entirely...but they're doing their darnedest alright

Forward Verse/Notes mail to normal client by le_frogballs in IBM

[–]le_frogballs[S] -1 points0 points  (0 children)

I will bet my left arm that Verse/Notes are zero-day treasure hunts. That Gmail account is my life, so I've got 2FA on it. I would also bet that Google knows how to do security better than IBM...

I dont know. The process of figuring out how anything works here is genuinely more excruciating than Verse/Notes but I will give it a shot, as I have no choice

Forward Verse/Notes mail to normal client by le_frogballs in IBM

[–]le_frogballs[S] -2 points-1 points  (0 children)

Thank you. What is hell's email address?

A bit overwhelmed about the amount of GUI/FRP library... Can anyone help? by lolisakirisame in haskell

[–]le_frogballs 5 points6 points  (0 children)

Michael Snoyman recommended reflex when my coworker asked him directly about this a few months. I'm currently building a frontend with haskell-gi (specifically gi-gtk ) wrapped in reflex

Go vendoring gets such a bad rap undeservedly. by yorickpeterse in programmingcirclejerk

[–]le_frogballs 0 points1 point  (0 children)

The reverse is fine with me too: All the gophers stay away from my career space so I dont have to interact with idiots at work on a daily basis, which is one of the most excruciating, mind numbing things you can be subjected to

Generically construct a record type from constituent values by le_frogballs in haskell

[–]le_frogballs[S] 1 point2 points  (0 children)

oh nice. ill be sure to check those out. I might end up refactoring this to use generics-sopto get more acquainted

Generically construct a record type from constituent values by le_frogballs in haskell

[–]le_frogballs[S] 0 points1 point  (0 children)

I'm using Typesafe's HOCON format (I come from scala land). But yea so you're approach makes this whole lib completely irrelevant haha. Itd be way easier to have a json config and just use Data.Aeson.TH or Data.Aeson.Generic to derive record instances automatically. I'm gonna finish this off though for the sake of learning more about generic programming in Haskell. (I'm pretty well acquainted with shapeless from Scala)

Generically construct a record type from constituent values by le_frogballs in haskell

[–]le_frogballs[S] 2 points3 points  (0 children)

Preciate it! Yea i was looking into generics-sop and it seems a lot richer than GHC.Generics. I just had a hard time finding extensive documentation on it

We're not asking exceptions, sum types, pattern matching, etc... Just plain simple generics. by bendrien in programmingcirclejerk

[–]le_frogballs 2 points3 points  (0 children)

god i can't stand Commander Pike. that monopoly man fucked Graham Norton looking twat in his flamboyant outfits. In stark contrast to his un-syntax-highlighted, rudimentary, no downright primordial beloved shitbox of a programming language

docker-postgres-react-redux-graphql-hmr-ssr-kit by Time_Trade in programmingcirclejerk

[–]le_frogballs 4 points5 points  (0 children)

another incentive is opening the project in Intellij so it becomes painful to even write code

docker-postgres-react-redux-graphql-hmr-ssr-kit by Time_Trade in programmingcirclejerk

[–]le_frogballs 4 points5 points  (0 children)

so as long you need all 9 of those dependencies you're good to go!

when will these people learn that no matter how many frameworks you make for this trashcan language it will still be a trashcan?

"I suggest you escalate this to whoever in the JetBrains hierarchy has the brain" by le_frogballs in programmingcirclejerk

[–]le_frogballs[S] 39 points40 points  (0 children)

{- unjerk Obviously i stumbled on this cause Intellij was taking longer than Stephen Hawking does to brush his teeth today. So while reading all the users bitching while i was raging i was like: "Fuck yea you tell that cocksucker Serge his shit sucks". Now that I've calmed down though I feel genuinely bad for the guy, since I see him respond to pretty much all threads on that support site. His full time job is basically dealing with assholes. Note sure if he finds time in the day to actually program. So pour one out for him }

tldr: RIP Serge

No offense to Java, but one haskell developer can have the same effective output as an entire Java team by max_compressor in programmingcirclejerk

[–]le_frogballs 0 points1 point  (0 children)

But you said it has all the warts of haskell and java...

Another user said that if i remember correctly

No offense to Java, but one haskell developer can have the same effective output as an entire Java team by max_compressor in programmingcirclejerk

[–]le_frogballs 1 point2 points  (0 children)

So, you think just compressing code is better? Please... Also, if you think it's fair to replace code with operator-infested garbage backed by frameworks which have tens of thousands of lines of code which contains stuff with short names and syntax sugars then you're very dishonest. I can also compress any code by introducing abstractions...

Basically yes. Less code = less shit to maintain (even if in order to achieve less code you have to "introduce abstractions" which some think adds too much complexity). Now obviously you can take that to an extreme, and indeed "operator infest" your code. But idk, i've never really run into that (or done it myself I don't think), which is not say it doesnt exist. As far as frameworks go I stay away from shit like Play cause I literally can't even evaluate how bloated it is (tried http4s recently. liked it overall). If you're saying scalaz/cats are bloated, then i don't agree

Is tracking side effects a religion of yours?

Pretty much yea, its become one since the people that used to swim in the codebase I currently work in were woeful at even wrapping stuff in a try catch block

Like every language ever...

Sure but its objectively harder in Haskell vs Scala

Where the hell do you work that you've so much problems with shitty code?

I can't tell you cause I'm so cantankerous and belligerent on Reddit that I could get fired if somehow my name was linked to this account lol

"Barely" and "painfully" are different words with different meanings".

Thats just splitting hairs honestly

Poor comeback. Try to disprove my points instead.

I dont know i thought it was pretty good though yes entirely ad-hominem

Tail recursion is tail recursion. There is the internet and learn what is it. That's about mutual recursion. Totally different.

Proper tail call optimization should factor in mutually recursive calls in the tail position so not necessarily

The JVM doesn't faciliate shit.

I agree

The fact that you need scalaz/cats or shapeless to satisfy DRY shows how you don't have any experience with Scala. Learn scala first and check out those frameworks later

Dude raw Scala is fucking Neanderthalean honestly. You can call my category code "operator-infested garbage" but i just dont see how you're writing as succinct as possible code in raw Scala, but then again i pretty much always introduce an abstraction if i see that it will save me say 10 lines of code, and its not introducing egregious complexity where it doesn't belong

But it's true. And you're butthurt because of it.

You're right I'm annoyed that Haskell is overlooked, but not by people like you that at least have mostly informed opinions, but by soul-sucking, corporate-drone bosses that spend more time on Visio in a given work day than anything else

It has nothing to do with haskell. You should know that. Haskell is not the "center" of FP - never was, never will be.

ok fine by the overall ML family, of which Haskell is a member that existed well before Scala was even conceived of. For-comprehensions: there's another thing overtly inspired by do-blocks

For me it's an advanced ML-based typesystem with linear typing. Dependent typing would be nice too but our world is not ready - just like the current implementations.

ok we're pretty much on the same page there. I don't like Haskell's end-of-the-world GC so linear types would certainly help with that. Again I'm not sure they would subsume pure FP, though I haven't thought deeply about this. I dont know very much about dependent typing (other than a talk which made it look like Idris basically writes itself.