Generally speaking, you don't check for this, because start=ziel
is not a pattern -- patterns are (for the most part) values or special patterns like _
or variable names, while start = ziel
is an expression that is not fully evaluated.
Instead, pattern match to extract start
and ziel
, and then you can either case on or use an if statement to do different things depending on whether or not start = ziel
.
For example:
| hanoi(anz, start, ziel) = if start = ziel
then ...
else ...
or
| hanoi(anz, start, ziel) = case start = ziel of
true => ...
| false => ...
These two options do the same thing -- which to use is a stylistic decision.