Question: Please write the program in Haskell. This is the content of the sort1.txt file: [(1,2),(3,4),(1,3),(2,4),(2,3)] There were 2 other solutions to this question, but they
Please write the program in Haskell. This is the content of the sort1.txt file:
[(1,2),(3,4),(1,3),(2,4),(2,3)]
There were 2 other solutions to this question, but they both result in this error:
Non-exhaustive patterns in [a,b]
The a,b can be any other letter that was coded.

![sort1.txt file: [(1,2),(3,4),(1,3),(2,4),(2,3)] There were 2 other solutions to this question, but](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4eb5f3cca6_07066f4eb5edcfa6.jpg)
![they both result in this error: Non-exhaustive patterns in [a,b] The a,b](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4eb5ff0679_07166f4eb5f933f2.jpg)
For this part, you have to implement running a comparator network on an input sequence. The command-line for this is Run filename sequence where filename is the name for a file containing a comparator network (like sort1.txt), and sequence is a list like [5,1,3,0]. You may assume that the list is in the correct format, that all numbers in the list are distinct, and that its length is equal to the biggest wire number in the comparator network that will be used. You should print out the result of applying the network to the sequence. Just print it to the standard-output channel of the program using a function like putStrLn, and print it out in the Haskell format for lists of integers (you can just call show on a list you compute in your code). There is a public test to check that the running sort1.txt on [5,1,3,0] produces [0,1,3,5]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
