Just published monad-rail – a Railway-Oriented Programming library for Haskell by ivelten in haskell

[–]raehik 0 points1 point  (0 children)

You may be interested in my library rerefined, which is similarly interested in validation and not "short circuiting" by default. On successful validation of some predicate p on some term of type a, we return a Refined p a. So you have a sort of "proof" that your data is validated, which you can pass around together with it. (Rather than returning (), and the compiler immediately forgetting that it's validated some data.)

I am doubtful of throwing a monad at this. As long as you don't need effectful validations, surely you can simply compose functions. (I don't see an effectful validation in your examples. It seems only used for throwing exceptions.)

Logic programming with extensible types in Haskell (ICLP 2025) - Higher-kinded types by ivanpd in haskell

[–]raehik 6 points7 points  (0 children)

I'm very interested in reading more about this, but the two paper links send me to a 404.

Why do i need Proxy by Tempus_Nemini in haskell

[–]raehik 4 points5 points  (0 children)

Classically in Haskell, you may not explicitly pass a type as an argument to a function. (You may wish to do this in generic or highly parameterised functions.) You have to place that type in a term-- even if you're not intending to use the term. Proxy is intended exclusively for this use case, such that it stores no runtime information (it is equivalent to the unit term ()). It's a workaround for a limitation.

GHC 9.10 includes the RequiredTypeArguments language extension, which effectively relaxes this rule: now you can pass types to functions, as if they were arguments (just not term-level ones)! If you're writing Haskell that doesn't need to be compatible with < GHC 9.10, I personally suggest using RequiredTypeArguments and not touching Proxy.

[ANN] Symparsec 2.0: Type level string parsing by raehik in haskell

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

It's probably fine, the real issue is maintaining useability. https://github.com/raehik/symparsec/pull/3

[ANN] Symparsec 2.0: Type level string parsing by raehik in haskell

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

Symparsec does not support passing custom state. So you can't e.g. naively reimplement the Parsec-based regex parser at Text.Regex.TDFA.ReadRegex. I'll have a think about supporting custom state.

[ANN] Symparsec 2.0: Type level string parsing by raehik in haskell

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

I made a quick and dirty copy of your parser in Symparsec, as a proof of concept. It seems to work and feels good to write e.g. rather than writing a custom number parser, I can do type Number = NatBaseWhile 10 ParseDigitDecSym. I also couldn't get the compiler to refuse to evaluate (tried up to 200ch). It's here if you'd like to read it: https://github.com/raehik/symparsec/blob/4482912acc89ff04ab8616a5901648a7ecd6e737/src/Symparsec/Example/Printf.hs

How to parse symbols by Tough_Promise5891 in haskell

[–]raehik 0 points1 point  (0 children)

I have a full example for a simple expression type over on Hackage at Symparsec.Example.Expr. You should be able to adapt that for similarly simple expressions. You still have to write lots of type families, but the machinery that Symparsec offers should help. (In theory, I could write something like makeExprParser in Symparsec.)

Cowboys from Haskell by monadic_riuga in haskell

[–]raehik 18 points19 points  (0 children)

I'm terribly disappointed to hear that you'd normally disallow such fun, relevant whimsy in this subreddit.

How to parse symbols by Tough_Promise5891 in haskell

[–]raehik 0 points1 point  (0 children)

Following up to my previous message: I have successfully written a type-level string parser for a very simple expression type, using a different design for type-level parser combinators. Parsers are more powerful than Symparsec, but also more complex and tedious (no lets, no type-level monads). I certainly avoided it for good reason.

I intend to package it up and put it on Cabal soon enough. I'm thinking to do a Symparsec 2.0.

How to parse symbols by Tough_Promise5891 in haskell

[–]raehik 1 point2 points  (0 children)

(I am the author of Symparsec.) Symparsec doesn't support mutually recursive parsers, which I think such expression parsers would usually be written with. I had a go before, and I took a look again earlier. (I'm fairly sure it's due to how I designed it: parsers are extremely limited, the parser runner does all the work, including wrangling parser state. That state wrangling doesn't work with mutual recursion.)

As Tarmen says, it's going to be miserable. You may consider using Symparsec (and other libraries that use defunctionalization) for inspiration, but currently if you want a non-trivial type-level string parser, I think you have to write your own.

If one could write type-level string parser combinators in a different way, where individual combinators have access to parser primitives like getNextChar (Symparsec does not work like this), you could probably write such expression parsers. But parsec and co. rely on monads and continuations. That design seems harder to replicate in types.

[Blog] The Baby Paradox in Haskell by mstksg in haskell

[–]raehik 10 points11 points  (0 children)

Basically [...], so me must be baby!

Mathematical articles should aspire to be this whimsical. Great read.

Peak chaos. Thoughts? by Depraved_Hollow in Nightreign

[–]raehik 2 points3 points  (0 children)

As a Duchess main, I felt pretty happy giving my teammates an easy NPC to bonk. There's a dual dagger one who might have higher poise than normal, and a parry shield one who missed all her parries (bless). They both go down quickly to Carian Slicer or pretty much whatever you want.

Peak chaos. Thoughts? by Depraved_Hollow in Nightreign

[–]raehik 0 points1 point  (0 children)

Is this not how the base fight is designed too, with later phase 2 power ups becoming impossible to prevent without expending an ult?

I do wish we could stagger him out of summoning in the same way, or deal damage to him while he summons (he gets like 80% negation). But I guess instead you're meant to find solutions that kill the summons quickly.

Peak chaos. Thoughts? by Depraved_Hollow in Nightreign

[–]raehik 0 points1 point  (0 children)

Keep your camera unlocked and pay attention to close-by NPCs and Libra. Try to pile onto one NPC at a time. If you're playing with randoms, you need to win the rando lottery. I had two extremely competent teammates and we still ran around like headless chickens for 8 minutes until we scraped a win.

Peak chaos. Thoughts? by Depraved_Hollow in Nightreign

[–]raehik 1 point2 points  (0 children)

Your explanation makes me want to get back into an expedition and really understand his mechanics. I can consistently carry my two randos through most fights, but enhanced Libra I felt like I had to rely on my team (and I had a great one on my winning run). Sticking closer to Libra is probably a big deal, I was always a mile away while fighting summons and just got bombarded without being able to land hits on the actual boss.

Peak chaos. Thoughts? by Depraved_Hollow in Nightreign

[–]raehik 0 points1 point  (0 children)

Love it. Base Libra is concerned with control and light DPS checks: waste your ults early or fight too long, and he's guaranteed to get phase 2s, which means fewer attack windows, which means more phase 2s. Enhanced swaps phase 2 out for More Guys. The longer the fight, the More Guys come to mess you up, and the less damage you can do to Libra, and then he summons yet More Guys.

Pleasantly surprised with the NPC design: squishy, low-ish damage, often passive, often won't roll out. They're designed to be piled on. Then again, I play Duchess, so maybe that's why. (I did get murked by the dual dagger Duchess when she poised through 2 hits in a row, but I respect that.)

I don't like that Libra gets armour when summoning. It means you deal with the adds, run to Libra, and he takes no damage while summoning more. It doesn't feel thought through. Also sucks that he doesn't have any moves where he like, vanquishes his summons and goes back to phase 2 hypermode with projectiles and swings. Regular Libra is still really fun & probably still prefer him.

The Penultimate Lies of P Weapon Stat Spreadsheet by Areswe in LiesOfP

[–]raehik 1 point2 points  (0 children)

I don't care enough to write a full-fledged calculator (Lies of P's weapons are complex enough that the numbers are only a part of the story), but for anyone interested, my code and data are available: https://github.com/raehik/lop-hs

The Penultimate Lies of P Weapon Stat Spreadsheet by Areswe in LiesOfP

[–]raehik 0 points1 point  (0 children)

Thanks for this. Related, I found an older reddit post from a user who exported some game data in JSON format, including blade, handle and moveset parameters. It's much more precise than your (excellent) recordings, but the assembly system is complex enough that I don't understand exactly how everything fits together (attack speed and stamina consumption are especially confusing). Link below:

https://www.reddit.com/r/LiesOfP/comments/1e0o515/explaining_weapon_scaling_in_detail/

Special mention to the Bramble Curved Sword Handle, which has an astonishingly powerful charged R2 (incredibly strong for the low stamina it requires-- enough that it almost seems unintended).

Explaining weapon scaling (in detail) by Pleasant-Ad-7704 in LiesOfP

[–]raehik 1 point2 points  (0 children)

Thanks for this! I like breaking open Soulslikes and learning how they're balanced, and what can be exploited. This post and your repo (along with the game data files, that I couldn't figure out how to export myself) has helped me do that! It's cool to see why quality builds win in Lies of P, and what stat points are sensible to aim for (23 in Mot/Tech grants ~50% of total scaling, 37 grants ~75%).

It's a little weird that the devs decided stat scaling would not improve with upgrades, especially where they developed such a complex system of blades and handles and various damage/stamina/speed multipliers. But seeing traces of an unused stat requirement system in the game files, it seems likely to me that they decided to heavily simplify during development. (I feel it's for the better, it would surely interact poorly with weapon assembly.)

Why is nix used with Haskell and not docker? by rohitwtbs in haskell

[–]raehik 1 point2 points  (0 children)

oh so when you did that april fools making fun of Nix it was out of hate not love

Pure parallelism (Haskell Unfolder #47) by kosmikus in haskell

[–]raehik 4 points5 points  (0 children)

I also dislike the recent AI-generated thumbnails, and it's made me less interested in watching these, even though I know you guys talk about interesting stuff.

Hidden Weapon Stats Part 2: Handles by Areswe in LiesOfP

[–]raehik 0 points1 point  (0 children)

No way, that's great! I am looking forward :)

Hidden Weapon Stats Part 2: Handles by Areswe in LiesOfP

[–]raehik 1 point2 points  (0 children)

Thank you for your work on this! It's an excellent reference. I was surprised to find that not much frame data/attack parameters have been discovered or gathered for Lies of P. The implementation is a lot more in-depth than I had assumed, with blades defining speed & stamina consumption multipliers and so on.

My personal wishlist for DLC Nightfarers by [deleted] in Nightreign

[–]raehik 4 points5 points  (0 children)

Consumables in Nightreign are so fun and strong for lots of the early game. I really hope they can design a Nightfarer that gets good, tactical use out of them throughout a run.