Suppose I have made my own data type in haskell as:
data List a = ListNode a (List a) | ListEnd
How can I implement a custom maximum function which finds the maximum of the list for instance:
mymaximum (ListNode 10 ListEnd)
should return 10
mymaximum (ListNode 20 (ListNode 10 ListEnd))
will return 20