Jump to content

Dutch national flag problem: Difference between revisions

m
deleted first line of the entry text as suggested by Paddy3118
m (added signature to isDutch)
m (deleted first line of the entry text as suggested by Paddy3118)
Line 265:
</pre>
=={{header|Haskell}}==
This problem is very easy to solve in Haskell. No algorithms necessary, because Haskell provides everything we need.
 
With the Color data type we take care that no other values than Red, White and Blue can be used.
The "deriving" clause is a key aspect: We want Haskell to make Color automatically an instance of the classes Show, Eq, Ord and Enum.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.