Viewing profile — lkitching
lkitching
HN member- Joined
- Sun, May 22, 2016, 8:32 AM UTC
- HN karma
- 150
- Public activity
- 96 items
- HN profile
- View on Hacker News ↗
About lkitching
No profile information was provided.
Recent public activity
-
comment
Comment #43170195
I've already shown that type hints do not constitute type checking: (defn f [^String s] (.length s)) (f 3) is a valid Clojure program that fails at runtime with a cast error. class…
-
comment
Comment #43166566
Of course Clojure has to ultimately be compiled into a native format for the host platform, bytecode in the case of the JVM implementation, but that doesn't require type checking i…
-
comment
Comment #43162154
Protocols do not work like Java interfaces or classes. Their methods are compiled into regular functions which lookup the implementation to use at runtime based on the runtime type…
-
comment
Comment #43158244
Neither defprotocol nor deftype introduce static typing into Clojure. Errors in their usage are not checked statically and are only discovered at runtime.
-
comment
Comment #41521953
That just means the semantics of the language are defined by whatever the default implementation does. It's a big stretch to conclude that means Rust 'was' OCaml in some sense when…
-
comment
Comment #41521502
I'm not convinced the implementation language of the compiler counts as a feature of the Rust language. If the argument is that Rust wouldn't have been invented without the origina…
-
comment
Comment #41521104
Which OCaml features exist in Rust but not Haskell? The trait system looks very similar to Haskell typeclasses, but I'm not aware of any novel OCaml influence on the language.
-
comment
Comment #40560974
The way in which monads are monoids isn't really helpful for understanding them for progamming.
-
comment
Comment #38127911
Since this defines an interface, does this solve the null problem? e.g. Maybe foo = null; foo.map(s -> "bar"); explicit pattern matching is usually discouraged anyway though, and y…
-
comment
Comment #37856179
How is this related to Brexit? Ireland have had a low corporation tax rate for the last 20 years, long before the Brexit vote.
-
comment
Comment #37014953
Assuming you're referring to *1, *2, *3 and *e, these are only defined within the REPL and are never used in real programs.
-
comment
Comment #35055815
The OP is contrasting between a 'validation' function with type e.g. validateEmail :: String -> IO () and a 'parsing' function validateEmail :: String -> Either EmailError ValidEma…
-
comment
Comment #35054377
The post is suggesting that parsing and validation are different things, since the output of a parser captures the properties being checked in the type, and validation does not. Do…
-
comment
Comment #34415244
Arguably the resource is the dataset of stock exchanges, and the CSV representation is forced to omit all the metadata but the HTML representation isn't.
-
comment
Comment #32839245
There's been a fair amount of churn in the ecosystem, even if the language itself has been very stable. Leiningen was ubiquitous 5-6 years ago, but if you switched to using deps fo…
- comment
-
comment
Comment #30822665
All those links are to the first game, not Wipeout 3.
-
comment
Comment #29343085
Sorry for the confusion, but regardless of whether you call it casting, conversion, or something else, it's still trivial to do safely in one directly and impossible to do safely i…
-
comment
Comment #29331385
> I said why does it even matter not why can't you do it I've explained why it matters - the types are more precise in my version and if you start from that you can always throw aw…
-
comment
Comment #29308340
> First, Why does this even matter? The reason you can't write my version using yours is that the types are less precise and you can't recover the imprecision in the output type af…
-
comment
Comment #29287203
> This is just your arbitrary preference It's not arbitrary since it's possible to write your function using mine but not vice versa. If you disagree then please implementing the f…
-
comment
Comment #29281840
> The structure of the code handling this type of div is identical to code handling an actual exception You would never write an exception handler to handle such a failure from div…
-
comment
Comment #29276644
> There is nothing weak going on here The type for your static version of div is: def div(x: Int, y: Int) -> Optional[Int]: The precondition for the dynamic behaviour of div is tha…
-
comment
Comment #29264793
Div always returns an int as long as the precondition - that the divisor is non-zero - is satisfied. The caller is always responsible for ensuring the precondition is satisfied whi…
-
comment
Comment #29252075
My first preference is to change the type of the divisor to NonZero[Int], and throwing an exception within div is only my second preference. It doesn't make sense to change the ret…