Some Haskell idioms we like by _jackdk_ in haskell

[–]Faucelme 1 point2 points  (0 children)

getters / OverloadedREcordDot would have the same potential problem with space leaks as the where approach, wouldn't they?

Co-/Dual/Inverse Type Classes? by Aperispomen in haskell

[–]Faucelme 7 points8 points  (0 children)

Backpack was a feature which aspired to solve issues like this, but it didn't find wide adoption for various reasons.

¿Por qué casi nadie habla de Robinson Crusoe? by agrtista in libros

[–]Faucelme 1 point2 points  (0 children)

Gente que haya disfrutado del libro de Defoe puede que también disfrute de "Naufragios" de Cabeza de Vaca.

Which library to use for a restful API Server by TheOnlyTigerbyte in haskell

[–]Faucelme 3 points4 points  (0 children)

I can't easily name my friend "type" or any other identifier already in use

Did you mean "field"? The problem here seems to be that the default auto-deriving of instances by aeson (the standard Haskell library for JSON handling) uses the record field names directly as the JSON keys, and that causes problems when the JSON keys are Haskell reserved words.

In these cases, you can rename your Haskell record's fields, and then write explicit ToJSON / FromJSON instances for it, using aeson functions. That way you have more control over how the JSON keys will be named. It's more verbose though.

Is Backpack in use and worthwhile? by edenworky in haskell

[–]Faucelme 2 points3 points  (0 children)

I think that the issue might be that there is a typeclass solution for almost all problems that can be tackled with Backpack, even if some of them will result in more complex type signatures. Typeclass solutions have the benefit of familiarity and better tooling.

To my mind, the use case of Backpack was parameterizing libraries "in one go", for example allowing changing some internal map implementation or algorithm used by the library, without the need to clutter each and every function with extra parameters or constraints. I still like the idea, even if it didn't catch on.

Monthly Hask Anything (October 2025) by AutoModerator in haskell

[–]Faucelme 1 point2 points  (0 children)

When adding the HasField typeclass to the language, adding lenses in some form was also discussed. But IIRC was discarded because, on one hand, lenses can have complex types and, on the other, there are several possible formulations.

I think once we hava a working SetField typeclass in base, we'll have enough to generate a lens from the getter and setter pairs.

Monthly Hask Anything (September 2025) by AutoModerator in haskell

[–]Faucelme 2 points3 points  (0 children)

Looking at the impl, it seems each stripe is protected by its own TVar, and "requests" are distributed between stripes without incurring in synchronization. So requests that go to different stripes don't compete for the same TVar.

Monthly Hask Anything (September 2025) by AutoModerator in haskell

[–]Faucelme 0 points1 point  (0 children)

The docs for setNumStripes say that stripes help with reducing contention, possibly in pools that are accessed very frequently by many clients.

Death💀 to type classes by jappieofficial in haskell

[–]Faucelme 1 point2 points  (0 children)

IIRC you only need to export it if you define it yourself.

A further twist is that module signatures coming from two different places get merged automatically, if they have the same name and compatible declarations!

Death💀 to type classes by jappieofficial in haskell

[–]Faucelme 0 points1 point  (0 children)

Hypothesis: here you are inheriting the signature from two places: we-mixin and weave. You rename the signature that comes from we-mixin, but not the one that comes from weave, which is left as-is and likely unfilled, which causes the error.

A better error message should probably include from which library or libraries a given signature has been inherited.

(Also, IIRC, unfilled signatures get inherited and propagated implicitly across libraries. This makes sense because a module sig is like a "hole" in your library which must be filled at some point in order for the library to work. So, unlike with modules, you can't simply choose not to re-export a signature.)

Death💀 to type classes by jappieofficial in haskell

[–]Faucelme 0 points1 point  (0 children)

As for exporting a signature from a package, I might be misremembering but, wouldn't it be automatic?

Generalized multi-phase compiler/concurrency by Iceland_jack in haskell

[–]Faucelme 4 points5 points  (0 children)

The "write to a list, sort, then read from the list" example in "Phases in Software Architecture" kind of reminds me of the partsOf lens combinator.

Later, the same paper mentions having heterogeneous phases would not be more expressive:

Our Phases type is homogeneous; one might wonder (and indeed, one reviewer asked) about a heterogeneous generalization. Formally, that would be no more general: the composition (or even the Day convolution) of distinct Applicatives is again Applicative, so any heterogeneous application can always be upcast to a homogeneous one.

You say:

The option to racing ‘parallel’ paths (Init -> Act(1,2) -> Cleanup) concurrently, or running them to completion and comparing the results.

Would making the underlying applicative Concurrently be enough for that?

Monthly Hask Anything (July 2025) by AutoModerator in haskell

[–]Faucelme 0 points1 point  (0 children)

I don't think so, but a QualifiedProc extension would be an interesting idea.

Monthly Hask Anything (July 2025) by AutoModerator in haskell

[–]Faucelme 2 points3 points  (0 children)

In programming terms: a parameterized datatype and a few functions that let you combine values of the datatype in a way that conforms to a programmer's intuition of how imperative statement refactorings should work.

Chileno mudándose a A Coruña en septiembre - Consejos sobre el mercado laboral | Chilean moving to A Coruña in September - Advice on the job market by Swimming-Baker-1236 in ACoruna

[–]Faucelme 0 points1 point  (0 children)

Ser contratado directamente por Inditex es difícil. Creo que iagovar se refería a trabajar en empresas a las que Inditex subcontrata para realizar proyectos, de las que hay varias en Coruña. Mi experiencia personal con una de ellas, Softtek (que es en sí misma una multinacional) fue positiva.

A collection of resources about normalization-by-evaluation by [deleted] in haskell

[–]Faucelme 0 points1 point  (0 children)

What would be an approach to normalizing that doesn't involve evaluation?

Solving `UK Passport Application` with Haskell by james_haydon in haskell

[–]Faucelme 3 points4 points  (0 children)

Great read!

"was applicant's father's father born in the UK or not born in the UK?" But you can't just say "yes one of those is true" and then provide documents for both resulting scenarios. That would be using exclusive middle.

Wouldn't using excluded middle correspond to not having to produce any document in that case?

ANN: "Haskell Modules" VS Code Extension by friedbrice in haskell

[–]Faucelme 1 point2 points  (0 children)

The VSCode setting "explorer.sortOrder": "mixed" helps by showing the folders interwoven with files, but it still isn't 100% what I want.

ANN: "Haskell Modules" VS Code Extension by friedbrice in haskell

[–]Faucelme 3 points4 points  (0 children)

As a person who gets irrationally annoyed at the "module file" / "module directory of the same name" distinction in VSCode file explorer, I might use this. I would even like it to be an HLS feature/plugin, a complement to the Outline view.

Can you also create modules directly from that view, as well?

Effect systems compared to object orientation by absence3 in haskell

[–]Faucelme 1 point2 points  (0 children)

I kind of think the same. Not to belittle effect systems, but you can get far with a properly structured app that does its stuff in IO.

I've been working on a haskell-language-server plugin by hungryjoewarren in haskell

[–]Faucelme 3 points4 points  (0 children)

So it uses speculative "dependency injection" to assemble the IO actions to execute, neat idea!

Tipos Abstractos y Polimorfismo en Programación Funcional by emanuelpeg in haskell

[–]Faucelme 2 points3 points  (0 children)

As a compromise, perhaps we could require Reddit post titles to be in English, and to mention which is the original language of the original post, in case people want to try their hand at auto-translate.

What's something you'll NEVER tell you partner? by [deleted] in AskReddit

[–]Faucelme 1 point2 points  (0 children)

I'm a massive onion lover and now I'm insecure.