Steelmanning this decision: I would guess for the use-case of "I have a C project and I want to run it in Fil-C" the ability for this to be a warning + run-time panic is very helpful for quickly getting started. Reminds…
I'm sure Bill understands what I'm about to say, but as a person on team "require explicit initializations" I think the mitigations I would be looking at are: 1. Only require that the programmer prove the variable is…
> `foo :: Semigroup a, Traversable t => t a -> a` I already know that whatever is passed to this function can be traversed and have it's sum computed. It's impossible to pass something which doesn't satisfy both of…
Would you expect IS_CONST to evaluate to the constant? With a name like that I would expect it to evaluate to true/false. C here is asserting that the value inside is a constant and then evaluating to that constant.
> One very frustration aspect is that there is basically no real documentation I looked at DRM/KMS briefly earlier in the year and this is what made me abandon it in the end. Can you recommend any sources of…
> doesn't run against the grain of the entire language Not an expert, but my gut says maybe it runs against zero values? As in, "what's the zero value for a non-nullable reference?" Maybe the answer is something like…
I think the person you're responding to is agreeing with you that you should optimize for languages other than English rather than for people naming a label "Bin" and then switching to the UK locale.
FWIW, that's not dependent typing, because the type doesn't depend on run-time values. A bool is either true or false, a [0...1] is either 0 or, ..., or 1. As for which languages allow it. I'm not sure for floats, but…
Please write a blog post!
I'd probably find the name Natural Seitan misleading (i.e. mistakenly buy it thinking it was vegan), but calling it "Animal Seitan" would be perfectly acceptable/clear to me .
Forbid "\t* *\t"?
I wouldn't do it, but this works perfectly fine. The rule is "use tabs to indent blocks of code, use spaces to align within those blocks". <TAB><TAB>function name(arg1, arg2, <TAB><TAB> arg3)
What about implementing something like map for lists? You know literally nothing about the values and the function except for their types. map :: (a -> b) -> [a] -> [b] map f [] = [] map f (a:as) = f a : map f as…
I'd probably think of Bool as being isomorphic to Maybe (), which would mean your map implementation looks a bit like: map :: Bool -> (() -> b) -> Maybe b map True f = Just (f ()) map False _ = Nothing Or, in Haskell…
I had meant to restrict my weight lifting comments to the kind of weight lifting that goes on in gyms (what was being discussed upthread). And I have to confess I don't know much about those sports you named, but do the…
Don't many QuickCheck-inspired libraries have special cases to ensure they generate common numbers like those? I could be misremembering, but I would have sworn I read that in the documentation of the last library I…
That isn't a very good comparison. Lifting weights isn't a competition in the way that basketball is. I want to say the latter is more "zero-sum", but I'm not sure if that's correct terminology.
From the article: > multiplied does not: it starts off 0, and every time it is multiplied via multiplied = multiplied * count it remains 0. The article then goes on to use that fact for some optimizations.
You might be right, it's been a long time for me too. But if it can define new classes, then I'd expect that the code for those classes' methods would also be in the pickled format, at which point there's no particular…
I'm pretty confident that you could write something that was equivalent to all the useful `pickle` calls. By that I mean you'll need to know which operations you'll want to do on your unpickled object: readAny :: forall…
I think (but cannot guarantee) there's nothing much stopping you writing template Haskell to construct valid values at compile time if you want. It's just that most of the time you're (or at least I am) happy to use…
Not to sound like a pedant, but the small spelling mistakes would scare me away if I were a potential customer. > but even the most beautiful code is useless if it takes to long to write! "too long" > Tansparent…
I don't write brackets where the condition and body fit on one line, and do otherwise. e.g. like these: if (ptr == NULL) return NULL; for (int i = 0; i < n; ++i) dst[i] = src[i]; I particularly like it for guards at the…
One solution to ensuring that the order is preserved (that I've actually used in production Haskell code where this was a real risk) is to use a heterogeneous list instead of a Vec. rzipWith :: (forall a. f a -> g a ->…
I hope it's not literally to prevent people reinventing these simple data structures. The ecosystem exerts a lot of pressure on developers to not reinvent fundamental things, in Haskell I practically never reach for a…
Steelmanning this decision: I would guess for the use-case of "I have a C project and I want to run it in Fil-C" the ability for this to be a warning + run-time panic is very helpful for quickly getting started. Reminds…
I'm sure Bill understands what I'm about to say, but as a person on team "require explicit initializations" I think the mitigations I would be looking at are: 1. Only require that the programmer prove the variable is…
> `foo :: Semigroup a, Traversable t => t a -> a` I already know that whatever is passed to this function can be traversed and have it's sum computed. It's impossible to pass something which doesn't satisfy both of…
Would you expect IS_CONST to evaluate to the constant? With a name like that I would expect it to evaluate to true/false. C here is asserting that the value inside is a constant and then evaluating to that constant.
> One very frustration aspect is that there is basically no real documentation I looked at DRM/KMS briefly earlier in the year and this is what made me abandon it in the end. Can you recommend any sources of…
> doesn't run against the grain of the entire language Not an expert, but my gut says maybe it runs against zero values? As in, "what's the zero value for a non-nullable reference?" Maybe the answer is something like…
I think the person you're responding to is agreeing with you that you should optimize for languages other than English rather than for people naming a label "Bin" and then switching to the UK locale.
FWIW, that's not dependent typing, because the type doesn't depend on run-time values. A bool is either true or false, a [0...1] is either 0 or, ..., or 1. As for which languages allow it. I'm not sure for floats, but…
Please write a blog post!
I'd probably find the name Natural Seitan misleading (i.e. mistakenly buy it thinking it was vegan), but calling it "Animal Seitan" would be perfectly acceptable/clear to me .
Forbid "\t* *\t"?
I wouldn't do it, but this works perfectly fine. The rule is "use tabs to indent blocks of code, use spaces to align within those blocks". <TAB><TAB>function name(arg1, arg2, <TAB><TAB> arg3)
What about implementing something like map for lists? You know literally nothing about the values and the function except for their types. map :: (a -> b) -> [a] -> [b] map f [] = [] map f (a:as) = f a : map f as…
I'd probably think of Bool as being isomorphic to Maybe (), which would mean your map implementation looks a bit like: map :: Bool -> (() -> b) -> Maybe b map True f = Just (f ()) map False _ = Nothing Or, in Haskell…
I had meant to restrict my weight lifting comments to the kind of weight lifting that goes on in gyms (what was being discussed upthread). And I have to confess I don't know much about those sports you named, but do the…
Don't many QuickCheck-inspired libraries have special cases to ensure they generate common numbers like those? I could be misremembering, but I would have sworn I read that in the documentation of the last library I…
That isn't a very good comparison. Lifting weights isn't a competition in the way that basketball is. I want to say the latter is more "zero-sum", but I'm not sure if that's correct terminology.
From the article: > multiplied does not: it starts off 0, and every time it is multiplied via multiplied = multiplied * count it remains 0. The article then goes on to use that fact for some optimizations.
You might be right, it's been a long time for me too. But if it can define new classes, then I'd expect that the code for those classes' methods would also be in the pickled format, at which point there's no particular…
I'm pretty confident that you could write something that was equivalent to all the useful `pickle` calls. By that I mean you'll need to know which operations you'll want to do on your unpickled object: readAny :: forall…
I think (but cannot guarantee) there's nothing much stopping you writing template Haskell to construct valid values at compile time if you want. It's just that most of the time you're (or at least I am) happy to use…
Not to sound like a pedant, but the small spelling mistakes would scare me away if I were a potential customer. > but even the most beautiful code is useless if it takes to long to write! "too long" > Tansparent…
I don't write brackets where the condition and body fit on one line, and do otherwise. e.g. like these: if (ptr == NULL) return NULL; for (int i = 0; i < n; ++i) dst[i] = src[i]; I particularly like it for guards at the…
One solution to ensuring that the order is preserved (that I've actually used in production Haskell code where this was a real risk) is to use a heterogeneous list instead of a Vec. rzipWith :: (forall a. f a -> g a ->…
I hope it's not literally to prevent people reinventing these simple data structures. The ecosystem exerts a lot of pressure on developers to not reinvent fundamental things, in Haskell I practically never reach for a…