@DiazCarrete@hachyderm.io avatar

DiazCarrete

@DiazCarrete@hachyderm.io

This profile is from a federated server and may be incomplete. Browse more on the original instance.

DiazCarrete, to random
@DiazCarrete@hachyderm.io avatar

"he could not think this way, he had to take a sheet of paper, and he started writing"
https://lobste.rs/s/qgjisu/software_engineering_is_about_thinking#c_wzkfko

b0rk, to random
@b0rk@jvns.ca avatar

working on a very short list of helpful command line git tools. so far I have:

what am I missing?

(I think GUI git tools are great too but that's not my focus right now)

DiazCarrete, (edited )
@DiazCarrete@hachyderm.io avatar

@b0rk I often use fzf in my git aliases, to help select files/branches. It even allows multi-selection.
https://github.com/danidiaz/miscellany/blob/a2623794433aa8bd9df5eca48a4b495dd507fbf3/linux/.gitconfig#L22

DiazCarrete, to random
@DiazCarrete@hachyderm.io avatar

cabal init --non-interactive --no-comments --dependency="base, servant, servant-server, servant-blaze, blaze-html, blaze-htmx"

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

@clementd Do you know of any comparison between blaze-html and lucid2?

DiazCarrete, to webdev
@DiazCarrete@hachyderm.io avatar

"Accessible, Typesafe, Progressively Enhanced Modern Web Forms"
https://www.epicweb.dev/accessible-typesafe-progressively-enhanced-modern-web-forms

DiazCarrete, to random
@DiazCarrete@hachyderm.io avatar

"By default, an element that causes a request will include its value if it has one. If the element is a form it will include the values of all inputs within it."
https://htmx.org/docs/#parameters

What if want to use "formaction" for supporting different target URLs in the form (like "delete all" / "export all" buttons) ?
https://github.com/bigskysoftware/htmx/issues/623
https://github.com/bigskysoftware/htmx/pull/1777

DiazCarrete, to random
@DiazCarrete@hachyderm.io avatar
DiazCarrete, to haskell
@DiazCarrete@hachyderm.io avatar

Even after enabling the DuplicateRecordFields, NoFieldSelectors and OverloadedRecordDot triad, record update for ambiguous fields remains a pain, often alleviated with lens libraries like "generic-lens".

Explicitly deconstructing and constructing values might be an alternative in some cases.
🔗 https://discourse.haskell.org/t/first-release-of-derive-has-field-derive-hasfield-instances-for-records/7723/6?u=danidiaz
🔗 https://gist.github.com/danidiaz/1659defe71d5d51ae042e001c98014ae

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

Alas, this RecordWildcards-based solution might cause spurious warnings in combination with -Wname-shadowing

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

Renaming a record field update
📽️ 🔗 https://www.youtube.com/watch?v=1ClZ0ySPHtI&t=1735s

DiazCarrete, to postgres
@DiazCarrete@hachyderm.io avatar

"How to work with pg_stat_statements"
🐦🔗 https://twitter.com/samokhvalov/status/1709069225762095258

DiazCarrete, (edited ) to haskell
@DiazCarrete@hachyderm.io avatar

Checking if the "algebraic-graphs" library allows vertices to connect to themselves. (It does.)

And if you remove an edge, the vertices stay in the graph.

So, if I wanted to remove self-loops (to be able to perform topological sorting) I could get the list of vertices and repeatedly call "removeEdge".

https://hackage.haskell.org/package/algebraic-graphs

DiazCarrete, to haskell
@DiazCarrete@hachyderm.io avatar

"I wonder at which point we should simply require whitespace between most lexemes, like Agda."
https://github.com/ghc-proposals/ghc-proposals/pull/451#issuecomment-954250714

DiazCarrete, (edited ) to random
@DiazCarrete@hachyderm.io avatar

currently engaged in a RESTological disquisition

Why isn't HTTP PUT allowed to do partial updates in a REST API?
🔗 https://stackoverflow.com/questions/19732423/why-isnt-http-put-allowed-to-do-partial-updates-in-a-rest-api

Why PATCH is neither safe nor idempotent?
🔗 https://stackoverflow.com/questions/41390997/why-patch-is-neither-safe-nor-idempotent

Same representation for GET and PUT?
🔗 https://stackoverflow.com/questions/36498982/same-representation-for-get-and-put

I might even consult the holy RFCs themselves
🔗 https://developer.mozilla.org/en-US/docs/Web/HTTP/Resources_and_specifications

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

I might be splitting hairs about the semantics of PUT, but there seems to be a slight contradiction in

On one hand, a GET after a PUT should return the exact representation that was set by the PUT.

On the other hand, a PUT "might also cause links to be added between the related resources" which seems to say that the representation might be enriched with extra links.

DiazCarrete, (edited ) to random
@DiazCarrete@hachyderm.io avatar
DiazCarrete, to programming
@DiazCarrete@hachyderm.io avatar
DiazCarrete,
@DiazCarrete@hachyderm.io avatar

I generally prefer package-by-feature. But: I also like -first development (generating controller interfaces using Generator for example) and I feel it clashes a little with the package-by-feature approach, because you generate an entire "layer" (the controllers) in one go, and all the results tend to be put in the same package.
https://openapi-generator.tech/docs/generators/spring/
How to resolve this apparent tension?

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

@clementd Yeah, I can see how it would be useful. "package by layer" wins in that case I guess.

DiazCarrete, to random
@DiazCarrete@hachyderm.io avatar
DiazCarrete, to haskell
@DiazCarrete@hachyderm.io avatar

The library lets you construct queries using a monadic interface.

Interesting bit: "Rel8 has a fairly unique feature in that it’s able to return not just lists of rows, but can also return trees."

https://rel8.readthedocs.io/en/latest/cookbook.html#tree-like-queries

image/png

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

@blaue_Fledermaus Rel8 is more like a DSL for building queries. ORMs typically support returning object graphs, but handle a lot of other things as well: caching, lazy loading, dirty tracking, etc. They might also trigger multiple queries behind the scenes.

So the particularity of Rel8 is that it generates stand-alone queries and yet it's able to reconstruct hierarchical data from the results. I'm not sure what's the exact mechanism though... Rel8-generated queries are quite scary to look at!

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

@mangoiv Five minutes for a small module seems quite a lot, even for a type-dense library!

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

Post about Entity Framework, touching on how to extract across a foreign key relationship
https://blog.ploeh.dk/2023/09/18/do-orms-reduce-the-need-for-mapping/
https://twitter.com/ploeh/status/1703782709422657939

DiazCarrete, to random
@DiazCarrete@hachyderm.io avatar
DiazCarrete,
@DiazCarrete@hachyderm.io avatar
DiazCarrete,
@DiazCarrete@hachyderm.io avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • cisconetworking
  • DreamBathrooms
  • ngwrru68w68
  • tacticalgear
  • mdbf
  • magazineikmin
  • Youngstown
  • modclub
  • rosin
  • slotface
  • everett
  • kavyap
  • khanakhh
  • anitta
  • Durango
  • InstantRegret
  • GTA5RPClips
  • osvaldo12
  • tester
  • thenastyranch
  • cubers
  • Leos
  • ethstaker
  • normalnudes
  • provamag3
  • megavids
  • lostlight
  • All magazines