warning: invalid comparison with struct literal ~N"2018-10-19 21:35:18.005355". Comparison operators (>, <, >=, <=) perform structural and not semantic comparison. Comparing with a struct literal is unlikely to give a meaningful result. Modules typically define a compare/2 function that can be used for semantic comparison
But currently this happens only when literal structs are used. For example, when using `Enum.sort` to sort a list of dates, this warning is not raised. I know there
already has been some discussion on this, but I believe
OvermindDL's suggested approach to have a Comparable protocol is much better. Kernel's comparison operators would delegate to this protocol, with implementations for common things like Date/Time, and letting it simply throw
Protocol.UndefinedError
for structs which do not have explicitly implemented it.