In fact, the absence of Just does not mean that it is poorly printed.
Here's the deal. The code
nodeAreSame (Node a _ _) (Node b _ _) | a == b = a nodeAreSame _ _ = Nothing
well printed, provided that a and b are of type Maybe t for some t , since it is type Nothing . Thus, the type system makes this conclusion.
Now that you have a numeric literal such as 3 , it is assumed that it is of type Num s => s , until you pass it to a specific data type (for example, Int or Double ).
So, when he combines these two facts, he assumes the following:
Num (Maybe t) => 3 :: Maybe t .
Since there is no instance for Num (Maybe t) , he complains about this point before getting the opportunity to state that 3 :: Maybe t doesn't make sense.
source share