[-] expr@programming.dev 1 points 3 weeks ago

I can't even find showings in my state.

[-] expr@programming.dev 1 points 2 months ago

Your post only showed adding functionality over the algebra, not new types on which the algebra operates (or "sorts", as they are otherwise known). In other words, you can't easily extend Expr to support Boolean logic in addition to addition itself. For a concrete example, how could you represent ternary operators like in the expression 2 + 2 == 4 ? 1 : 2, such that it's well typed and will never result in an exception? With GADTs, this is very simple to do:

data Expr a where
  Lit :: Int -> Expr Int
  Add :: Expr Int -> Expr Int -> Expr Int
  Eq :: Expr Int -> Expr Int -> Expr Bool
  If :: Expr Bool -> Expr Int -> Expr Int ->  Expr Int

eval :: Expr a -> a
eval expr = case expr of
  Lit n -> n
  Add a b -> eval a + eval b
  Eq a b -> eval a == eval b
  If p a b -> if eval p then eval a else eval b

-- >> eval example == 1 => true
example :: Expr Int
example =
  If ((Lit 2 `Add` Lit 2)  `Eq` Lit 4) (Lit 1) (Lit 2)
[-] expr@programming.dev 1 points 2 months ago

Nulls are famously called the billion dollar mistake, and for good reason.

Option types are the answer to that problem, because they make the optionality explicit and require one to handle it or propagate it.

That being said: as someone that does functional programming professionally, this looks kinda janky, to me. But the good news is that C# is actually adding support for discriminated unions finally (seriously, it's been waaaay too damn long): https://github.com/dotnet/csharplang/blob/18a527bcc1f0bdaf542d8b9a189c50068615b439/proposals%2FTypeUnions.md

With discriminated unions, you can finally comfortably work with Option/Result types natively.

[-] expr@programming.dev 1 points 2 months ago

Just gonna keep posting this since we shouldn't be perpetuating lies: https://www.snopes.com/fact-check/jd-vance-couch-cushions/.

[-] expr@programming.dev 1 points 2 months ago

If you have a 401k, HSA, or other common financial accounts offered by employers, you most likely have money in the stock market. Usually it's an indexed mutual fund of some kind.

[-] expr@programming.dev 1 points 4 months ago

Yeah that's what I was referring to by "archaic". Pretty much anything using the LAMP stack falls in that category. I don't generally see new things using it.

[-] expr@programming.dev 1 points 9 months ago

In Haskell, it's the same as the mathematical = symbol.

[-] expr@programming.dev 1 points 9 months ago

I wasn't talking about frontend state, just the server. Frontend state is kind of irrelevant, tbh.

[-] expr@programming.dev 1 points 9 months ago

Hasn't been the party of Lincoln ever since the parties switched due to the southern strategy.

[-] expr@programming.dev 1 points 10 months ago

Umm, we definitely don't need a muzzle for the family labs when in public. That absolutely says something about the breed.

I'm glad you're happy with your dog and work hard to keep it happy and peaceful, but that simply does not change the fact that it is an inherently dangerous breed (that has been intentionally bred for aggression).

Btw, I absolutely think that a dog's owner bears full responsibility for them. But that doesn't mean it's a safe breed we should be promoting, either.

[-] expr@programming.dev 1 points 10 months ago

No matter the GUI you use, you're leaving a lot of useful functionality on the table. By their nature, you only get a small fraction of git's features. There are many useful commands I use regularly that are impossible to replicate using GUIs.

[-] expr@programming.dev 1 points 1 year ago

Yep. It has a population of 24,967. As someone who has been there multiple times, it's quite small. NE Nebraska is just not very populated in general.

view more: ‹ prev next ›

expr

joined 1 year ago