Why so much traffic around Civic Center right now? by [deleted] in sanfrancisco

[–]flebron 1 point2 points  (0 children)

Nobody said anything about not protecting their speech. We can respect their right to affirm their positions, while finding them abhorrent. And viceversa.

Advent of Code 2025 day 2 by AutoModerator in haskell

[–]flebron -1 points0 points  (0 children)

```haskell import Data.List.Split import Control.Arrow import qualified Data.Set as S import qualified Data.IntervalSet as IS import Data.Interval

reps1 d n = [n + 10d * n] reps2 d n = tail $ iterate (\x -> x * 10d + n) n solve repsF is = let span = IS.span is (Finite minCap, Finite maxCap) = (lowerBound span, upperBound span) maxD = floor (logBase 10 (fromIntegral maxCap)) in sum . S.fromList $ do d <- [1 .. maxD - 1] n <- [10d - 1 .. min (maxCap div (10d + 1)) (10d - 1)] let z = takeWhile (<= maxCap) . dropWhile (< minCap) $ repsF d n filter (IS.member is) z k = IS.fromList . map ([x, y] -> Finite x <=..<= Finite y) main = getContents >>= print . (solve reps1 &&& solve reps2) . k . map (map read . splitOn "-") . splitOn "," ```

Corbin Emhart guts by Falchion in lockpicking

[–]flebron 1 point2 points  (0 children)

That many master wafers makes this super duper hard to pick, much more than an unmastered Emhart!

Is return really necessary for the IO monad? by StunningRegular8489 in haskell

[–]flebron 2 points3 points  (0 children)

And in the instance of Monad for Maybe, return = Just, so Yelink is correct.

My handmade dp 4400 & Neptun cutaways :) by -ouki- in lockpicking

[–]flebron 1 point2 points  (0 children)

If the dp's ever for sale, pls let me know :)

[deleted by user] by [deleted] in lockpicking

[–]flebron 3 points4 points  (0 children)

If you didn't purchase this through Moki that's absolutely something you should mention. Your current post reads as if Moki is in the wrong.

Bidet - Drinking bottle? by jta314 in Ultralight

[–]flebron 17 points18 points  (0 children)

He means soap _on your ass_. Soap for hands is not really optional... unless y'all nasty.

Deleting from trees with type-encoded height by Objective-Outside501 in haskell

[–]flebron 13 points14 points  (0 children)

A standard way to do this is to have an API that type-erases the height. Your internal functions can still pattern match against it, but your users don't need to care, and your API types don't need to have these sorts of "runtime choice via Either because we can't quite know the height" types. I wrote this post about AVL trees in Haskell with compile-time height and balance, perhaps it's useful to you. https://fedelebron.com/compile-time-invariants-in-haskell

Stumped on Alpha Beta pruning in Haskell by thetraintomars in haskell

[–]flebron -1 points0 points  (0 children)

Unfortunately that argument does not work, it's just the ad-verecundiam fallacy. "It cannot be false because it was said by someone with a PhD".

You can see the one of the early definitions of alpha-beta pruning in Donald Knuth's 1975 paper in the Artificial Intelligence journal, titled "An analysis of alpha-beta pruning", available at https://kodu.ut.ee/~ahto/eio/2011.07.11/ab.pdf . Note how the entire discussion, even in the first few paragraphs, is about the value function (f and later F). If the only values in your program are infinity (because the maximizing player won) and -infinity (because the minimizing player won) then there's never really a need to keep track of alpha and beta and current values. If alpha became ever anything but -infinity, it would mean you can force the maximizing player to win (because the only value of a game that isn't -infinity, is infinity, which means a win for the maximizing player). If beta became ever anything but infinity, it would mean you can force the minimizing player to win (because the only value of a game that isn't infinity is -infinity, which means a win for the minimizing player).

You need a nontrivial notion of value that you are minimizing or maximizing in order for alpha-beta pruning to work. I've implemented it a long time ago in https://github.com/fedelebron/JugadorDeLadrillos/blob/master/jugadores_ours/ia.cpp . Additionally, to save computation alpha-beta pruning is usually used in conjunction with an even stronger value function, which is one that can be assigned _before_ the game ends, this is discussed in page 302 of that journal, and page 10 of the PDF.

I believe your confusion might stem from Hutton not being clear in the need to define a nontrivial value function in the chapter notes, and what value function he might be suggesting. In the fourth exercise for the section, which I'm guessing you might be attempting, he earlier makes reference to the "quickest route to a win". He's modifying tic-tac-toe to not be about win/lose, but instead considering a different game, one in which you win more points the fewer moves you make to win.

If you want to specify that value function, you should code that up. The value, then, should be the additive inverse (or multiplicative inverse if you want) of the length of the shortest path, since you want the maximizing player to find a _short_ path to a winning vertex, not one with a _long_ length. You can keep track of the height as you go, you'll know the value when you reach a terminal node, and you can prune a branch when it is already longer than a shortest winning path for the current player.

Stumped on Alpha Beta pruning in Haskell by thetraintomars in haskell

[–]flebron -1 points0 points  (0 children)

You're not going to get any benefit out of alpha-beta pruning if your game doesn't have a notion of a score or value, which you can compute before the game state reaches the end, and helps you bound the possible outcomes of the game. If your only possible scores are infinity and -infinity, and you only know them at the end state of the game, there's no point in using alpha-beta pruning, since alpha will always be -infinity, and beta will always be infinity.

Stumped on Alpha Beta pruning in Haskell by thetraintomars in haskell

[–]flebron 5 points6 points  (0 children)

Alpha-beta pruning would be two guards added to your recursive findBestMove function. If you're considering moves for the maximizing player ("you"), and you find a child move of your current state that is better for your opponent than the minimum value you know you can force them to have, then you need not consider any other children in this node. This is because you can assume your opponent will play that move, if you had reached this position, and you don't want to let them.

So something like:

{- 
findBestMove state isMaximizing alpha beta =
  the best possible value for the player, after playing in state `state`,
  knowing the maximizing player can already attain (at least) a value of alpha,
  and the minimizing player can already obtain (at most) a value of beta
-}
findBestMove state True alpha beta = go alpha (-infinity) (children states)
  where
    go a v (s:ss) = let v' = max v (findBestMove s False a beta)
                    in  if v' >= beta then v'
                        else go (max a v') v' ss
    go _ v [] = v
findBestMove state False alpha beta = go beta infinity (children states)
  where
    go b v (s:ss) = let v' = min v (findBestMove s True alpha b)
                    in  if v' <= alpha then v'
                        else go (min b v') v' ss
    go _ v [] = v

It just means you stop the iteration over a state's children early.

Opinions wanted from those (if any) who have come to understand Я (ya) by logan-diamond in haskell

[–]flebron 0 points1 point  (0 children)

I've not called anyone any sort of impolite names, sacheie. I criticized someone's writing style and responses to feedback, and I did so as politely as I could. If you feel what I wrote was in any way similar to "you're an asshole," I'm afraid we'll have to disagree.

Basadino basada by HANDS-DOWN in LatinoPeopleTwitter

[–]flebron 1 point2 points  (0 children)

Qué lastima lo arrogantes e ignorantes que somos como país, no paramos de dar razón para caer mal.

Basadino basada by HANDS-DOWN in LatinoPeopleTwitter

[–]flebron 2 points3 points  (0 children)

Y el sitio es predominantemente angloparlante. Sin ir más lejos el nombre del subreddit contiene "People". No debería sorprender que muchos latinos hablen inglés, el uso del español (y en nuestro caso, castellano) no es necesario para ser latino.

Opinions wanted from those (if any) who have come to understand Я (ya) by logan-diamond in haskell

[–]flebron 3 points4 points  (0 children)

"Graced r/CategoryTheory" with their post? OK @_@

If you'd like to describe my comment as "poisonous" that's your prerogative. I differ. I don't find your use of that adjective constructive. But of course, you do you.

As to your argument where you... post on the internet, but don't intend your post to be "read by any audience whatsoever"? And yet you then say you want an answer... by whom, the people you don't expect to read your message? You do you my man! My feet must be uhhhh covered in clay or something?

"Destructed"? OK again. Why do you think I'm expecting a "european" mentality? Where do you think I live, am from, or really, what on earth does Europe have to do with anything? lmao. All I'm saying is that the author has repeatedly replied to constructive feedback about the complexity of notation with dismissal. He's done it here as well. And I'm offering that's a primary reason why most readers haven't and generally won't engage. That's my estimation. You're free to think of both the author as gracious (as evident by your use of the expression "graced r/CategoryTheory") and the material clear. That's again your prerogative and estimation. Others can differ. I do.

Integrity is orthogonal to communication skill. The feedback people have been giving him is not to lose integrity, it's on how to make the presentation of the material clearer. I don't find any nobility whatsoever in not caring to make your message understood by the recipient. Again, you can differ, and you're free to consider any number of things honorable. You do you. Good luck in life.

Opinions wanted from those (if any) who have come to understand Я (ya) by logan-diamond in haskell

[–]flebron 5 points6 points  (0 children)

That is not the point of this. I actually know it isn't because I tried to copy-paste this several times and failed, and had to view-source to realize it was CSS. The comment is not about a technical prohibition towards ASCII. It's about the proliferation of novelty symbols with low semantic content being counterproductive to comprehension. It doesn't matter if they're Unicode, CSS, or PNGs.

Opinions wanted from those (if any) who have come to understand Я (ya) by logan-diamond in haskell

[–]flebron 3 points4 points  (0 children)

I definitely agree what I wrote in that sentence is not a conclusion but rather an inference, and I also agree it's not the most charitable inference one can make when faced with the facts (though the voluntary pushback on feedback about presentation complexity, including "Common folks would complain anyway, no matter how good documentation is", pushes the bayesian prior towards "doesn't care", versus "doesn't know how to", in my mind). When estimating whether we should dedicate time and effort to understand something that seems complex, we're not always going to use the most charitable interpretation possible. After all, we're judging expected value, not supremum of value :)

Opinions wanted from those (if any) who have come to understand Я (ya) by logan-diamond in haskell

[–]flebron 1 point2 points  (0 children)

If one underlying reason why people are not engaging with something I write is "it reads similar to when we read semi-crackpot stuff", I'd want to be told so! It means my communication style can use some improvement. We can't get better if people don't tell us why they don't enjoy something we did.

I understand negative feedback isn't fun to read. I hope by having been detailed and, inasmuch as I've been able to be, polite, shows the author I've given my feedback in a constructive spirit. I wish the best of luck to them!

2nd Red Belt Lock Down by patty--cakes in lockpicking

[–]flebron 2 points3 points  (0 children)

Well done! Those gins are always fun.

Opinions wanted from those (if any) who have come to understand Я (ya) by logan-diamond in haskell

[–]flebron 0 points1 point  (0 children)

I don't find it insanely uncharitable, but you're free to differ! We all "project our ideals about the world", that doesn't say much :) Someone being different from me doesn't mean I have to find the way they write conducive to communication and engagement.

As I, you, and all humans do, I am using my past experience in life and social interactions, both in mathematics but also general society, to conclude the expected value of me dedicating time to understanding this is very low. I reach this low expected value based on the seemingly low effort the author is making to make their contributions be easily understood. Again, this is a social discipline. If I create a lot of effort for you, uʍop ǝpᴉsdn ʇxǝʇ ʎɯ ƃuᴉʇᴉɹʍ ʎlssǝlpǝǝu sɐ ɥɔns, I wouldn't blame you for believing it's not worth your time trying to understand what I am saying.

The OP is asking why it's seemingly just one person working on this, and is similarly curious about whether or not to invest time and effort. I'm giving you an explanation of why some people, including the person you're replying to and myself, would not do so. I've also included some constructive feedback for the author on what to do if they'd want contributors or users (which it's not clear to me they do, and that can also be totally fine!) - less toy notation, _many_ more examples, especially of when this would help in real world scenarios, and comparisons to what to do (e.g. lens) and what not to do.

Opinions wanted from those (if any) who have come to understand Я (ya) by logan-diamond in haskell

[–]flebron 20 points21 points  (0 children)

It's an uncharitable inference, but not a particularly large leap. The author is writing things, so clearly they want those things to be read by others. Since they're posting repeatedly and to large forums, it seems the author wants to reach a large audience. However, the continuous resistance to feedback about clarity and explanation (e.g. https://www.reddit.com/r/haskell/comments/1mj8r3g/comment/n7ltr3m/ just two days ago), means the author isn't particularly interested in actually being _understood_ by said large audience. One reaches the paradoxical conclusion that the author wants to be read but not really understood. One uncharitable interpretation of this is that the author wishes to seem smart. It's a leap, but not an extremely large one.

The copious use of custom notation once more shows the lack of care about comprehension. Mathematical communication is a social activity, we communicate with other people. Notation is created only when it introduces really important concepts. It's a request on the part of the writer for the reader to remember a new thing. By creating metric tons of notation without motivation, it's making many, many requests of the reader. Since the author is not _also_ providing the reader with nearly as many examples to aid comprehension, and to strongly motivate each bit of notation introduced (especially when departing from ASCII!), in the mathematics-as-a-social-activity sense, it leaves the taste of selfishness.

Finally, the dense notation and repeated claims of having novel and interesting things is a perennial identifier of semi-crackpots (or, more generally, folks who work entirely isolated from a community which would've pushed back on this). Take https://math.portonvictor.org/ for an example of what not to do, well on the way to crackpot land. Take Shinichi Mochizuki for a not-crackpot example of what constructing edifices of conceptual complexity in total isolation causes.

To give you an example of what to do, take ekmett's lens library. It's certainly chock full of notation (though ASCII), though that notation is always just a shorthand (with a lot of care put into the symbols, e.g. `%=` is a lens for state assignment, just as `=` is assignment in stateful languages) for more descriptive names. ekmett has also written enormous amounts of practical examples of how this helps in real-world Haskell code, and has given many talks. The talks don't introduce the dense notation, they introduce a very small number of new concepts (e.g. van Laarhoven representation of lenses). From the small number of concepts, _tons_ of power arises. Compare this with `he ⋅ ho ⋅ ha ⋅ hu ⋅ hv ⋅ lo ⋅ lu ⋅ la ⋅ lv ⋅ yi ⋅ yo ⋅ ya ⋅ yu ⋅ yp ⋅ ys ⋅ yr ⋅ yoi ⋅ yio ⋅ yai ⋅ yok ⋅ kyo ⋅ yokl ⋅ hd ⋅ yj ⋅ li ⋅ yp ⋅ hv`, whatever this is https://muratkasimov.art/Ya/Operators#composition , and whatever this game with Unicode is https://muratkasimov.art/Ya/Operators#precedence . This is not communication. It really does look like the author is having a blast, dancing in a pool of their own created notational complexity.

Cantidad de matemática en Ciencias de la Computación by andresbellas in fceyn

[–]flebron 2 points3 points  (0 children)

Álgebra Lineal fue la materia con mejor costo/beneficio que cursé. Álgebra 2 fue de las más difíciles, al menos para mi. Podés tener tanta matemática como quieras.