3 ms·
I think that this is true only if you want to be an instance of `Num`, which makes sense: the collection of, say, lengths is not such an instance, because you
by JadeNB 12y ago
I think that this is true only if you want to be an instance of `Num`, which makes sense: the collection of, say, lengths is not such an instance, because you cannot multiply two lengths and get a length. Nothing stops us from defining (simplified)
data Unit a = Unit a [String]
(*) (Unit a as) (Unit b bs) = Unit (a Main.* b) (as ++ bs)
Of course, we will then have to disambiguate `` when we use it in the code. Another option would be to give it another name, like `unit` (or something less awful).
- Guvante 12y agoI didn't think there was a way to set `*` without losing `Num` (which is required for raw numbers in your code).