Question
Create your programs using Visual Studio scripting, and submitting the F# scripting program .fsx; All of your F# code should be purely functional. You should
Create your programs using Visual Studio scripting, and submitting the F# scripting program .fsx; All of your F# code should be purely functional. You should not make any use of mutable variables, loops, etc.; Do not use built-in F# functions other than the ones discussed in class; Pay attention to the types that F# infers for your functions! They are very informative; Put comments in your code as appropriate; You may define auxiliary functions to help in solving some of the problems, but you should try to use them only when necessary. a) Write a curried F# function find x y that checks whether x is in list y, which returns true when x is in y and false otherwise: > find 2 [1;2;3];; val it : bool = true b) Write an F# program removedup x that removes duplicated elements in list x (hint: use find function). For example, > removedup [1;2;1;3;2;4;4;5;7;6;7;5];; val it : int list = [1; 3; 2; 4; 6; 7; 5]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started