2 ms·
> I absolutely want to check, statically, that my user input is `ByteString`, or `String` My condolences, you must have horribly unreliable user widget/user in
by mpweiher 5y ago
> I absolutely want to check, statically, that my user input is `ByteString`, or `String`
My condolences, you must have horribly unreliable user widget/user input libraries. My TextFields always deliver a "String" to me (unless I've set them up to deliver numbers). I don't need to check that statically.
> You are confusing "type" with "not a function type".
No I am not.
You don't seem to understand what I meant with "You are not going to statically type check your users".
- chriswarbo 5y ago> My condolences, you must have horribly unreliable user widget/user input libraries The libraries seem pretty reliable; but I'm not (exactly the same as in the SQL example, BTW). For example, I don't think I've ever managed to write a Python3 program which hasn't crashed at some point due to me mixing-up string/bytes; of course, testing doesn't usually find such problems, even with Hypothesis, since I make exactly the same mistakes when I'm writing the tests. I've also written a whole bunch of Python3 programs which spend ages crunching numbers, only to output '<map object at 0x10199c2e0>' instead of printing a list. I make exactly the same mistakes when writing Haskell and Scala; but the computer tells me that I've made a mistake, and how to fix it, before the program ever gets a chance to run. > You don't seem to understand what I meant with "You are not going to statically type check your users". That might be the case. I can't elaborate on what you meant (since I may have misunderstood)
- mpweiher 5y ago> Python3 program which hasn't crashed at some point due to me mixing-up string/bytes Not sure what that even is, but I'd point out that dynamically-typed ≠ Python. In particular, the "hash languages" (Python, Ruby, JavaScript) seem to make it particularly easy to make a hash of things, but not due to the dynamic typing. I've never had that problem with NSString and NSData. They are quite distinct. > Python3 ... crunching numbers ... map instead of list ?? Why would you output a map when you are crunching numbers? To get a "list", for example, I'd use an NSArray. It seems tricky to get an NSDictionary instead, since you have to explicitly ask for an NSDictionary in order to get one.