@underlap there are only 3 combinators. One for unfolding, and two for merging nodes. The rest are ye olde fmap, traverse, etc.
Maaaybe if you put in your AST as a functor and get a driver for peephole optimisation or something like that. The whole thing reminds me of recursion-schemes contents.
@underlap it's unfold combinator takes (a -> f a) and that f drives the whole thing. You can then traverse, fold, annotate and aggregate using Functor composition.
I had a late night thought that my sparse quad tree structure can be split up into a bunch of functors.
And that is indeed the case:
type SparseQuadTree a = Free Quad (Sparse (Range a))And the scaffold/compact functions are “bring your own algebra” now.
Replace Quad with Binary or Octal and you’d get the matching structure.
Going from a dense (but lazy) scaffold to sparse states that in type:
(a -> Sparse a) -> Free s a -> Free s (Sparse a)And the decider is a simple function that isn’t concerned with structure at all, making it reusable.
@haskman what do you mean by complexity here?
@haskman
Strict-by-default is just asking users do to what a compiler should do.
For the same reason we don't want to use manual memory management (even with the borrow checker assistance) *all the time*.
Let me focus on what's important and let the compiler find a best way to do it.
@ianbicking > From a practical standpoint, this strengthens my worries about LLM assistants entrenching popular languages and tools. If ChatGPT, Bing, and similar tools become an essential part of a programmer's arsenal, it's hard to imagine a new language—or even a new framework—taking off if the models can't use them. Yet, if the language or framework doesn't take off, the models will never learn how to use it for lack of training data.
This is very sad. The network effects get even more networky and we're getting stuck more deeply in some local optima ![]()
@matthew_d_green this is what you get for leaving the future of the web in corporate hands...
But... Was it, ever, free from it? ![]()
@reidrac@social.sdf.org Just found something that can be a good kata on parsers and typeclasses.
And not without utility! You can add some CLI options to your game while getting acquainted with the basics.
@reidrac@social.sdf.org I hope I didn't interfere with your studying/project goals. I tried to let you discover things that are close by and only suggest "obvious" parts what are just out of current search space
In my beginning I wasted a lot of time chasing trivial things just because I didn't knew where to search and not even a guess of what to find. That wasn't a productive activity and a mentor could have cut "time to prod" even more.
@reidrac@social.sdf.org Fair.. An opportunity to take note how avoiding abstraction has its own costs. Like growing codebase makes it progressively difficult to navigate.
Anyway, I, too, usually write a lot of concrete code first, with minimal abstraction. And only when I see that a certain pattern persists I take the abstraction saw to the accrued boilerplate. Expansion-compression cycle of a code pump (8
@reidrac@social.sdf.org writing parsers is a good way to understand the language. It trains a few things about composition, assembling code from smaller parts.
Type classes are Haskell's power tools of the trade (:
They encode many common patterns about types and make that distinct coding flow of "delegate this away and let me focus on my types here" (that you did with the Vector instance).
You can use the Typeclassopedia for an overview of what you can encounter in the wild and where they can be helpful. You don't have to remember everything, just the names of the things and maybe the context where you may encounter them.
The most important are Semigroup/Monoid, Functor/Applicative/Monad, and Functor/Foldable/Traversable. Recently dual-variable classes like Bifunctor are starting to get prominence too.
Awww yisss! Everything* I wanted feature-wise from this tileset:
- Map declared in Multicolor SDF (lava is the base layer, everything else is boolean'd together)
- 4-corner Wang tiles extracted from TileSetter project (no, I didn't do those 96 tiles by hand) (package pending)
- Per-tile attributes in the "free" vec4 slot. Here - tile speed (also used for passability).
- A* path-finding with per-tile travel costs (the truck on the screenshot prefers flat terrain as ridges are slow to crawl).
* I have unused alternative biome tiles... to spice up the landscape 😏
Reading Wikipedia resulted in a slightly different path-finding algorithm than intended.
Behold: A-A-A-A-A*!
(At least it doesn't jump straight into lava.)
End of #LudumDare day 1:
https://youtube.com/shorts/zLGhr3dtoRY
Not yet playable, just no-engine basics.
@teahands LDJam has a month-long format now
@boilingsteam 2024 will be the year of GNU/Linux on desk
@boilingsteam Should we switch to GNU mice, keyboards, and webcams?
@ubernostrum ChatGPT is revenge on the French for Coq
Toots as he pleases.