4 ms·
Static typing can help with a lot of things but it can't fix this error: pub fn add(a: i64, b: i64) i64 { return a - b; }
by dnautics 7y ago
Static typing can help with a lot of things but it can't fix this error:
pub fn add(a: i64, b: i64) i64 {
return a - b;
}
- maxdamantus 7y agoActually, it kind of can: https://tryidris.herokuapp.com/compile#YWRkIDogSW50IC0+IEludCAtPiBJbnQKYWRkIGEgYiA9IGEgLSBiCgphZGRUZXN0IDogYWRkIDQgNSA9IDkKYWRkVGVzdCA9IFJlZmw= https://tryidris.herokuapp.com/compile#YWRkIDogSW50IC0+IElud... The above link refers to the following Idris code: add : Int -> Int -> Int add a b = a - b addTest : add 4 5 = 9 addTest = Refl
- reitzensteinm 7y agoThat unit test would be just as easily implemented with dynamic typing.
- deleted 7y ago[deleted]