1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
WINSTONCH [101]
4 years ago
5

Write a function match that takes a valu * pattern and returns a (string * valu) list option, namely NONE if the pattern does no

t match and SOME lst where lst is the list of bindings if it does. Note that if the value matches but the pattern has no patterns of the form VariableP s, then the result is SOME []. Hints: Sample solution has one case expression with 7 branches. The branch for tuples uses all_answers and ListPair.zip. Sample solution is 13 lines. Remember to look above for the rules for what patterns match what values, and what bindings they produce. These are hints: We are not requiring all_answers and ListPair.zip here, but they make it easier.
Computers and Technology
1 answer:
yan [13]4 years ago
5 0

Answer:

Check the explanation

Explanation:

fun match (v,p)   =

    case (v,p) of  

     (_,Wildcard) => SOME []

    |(Const v1,ConstP p1) =>if v1 = p1 then SOME [] else NONE

    |(Unit,UnitP) =>SOME []

    |(Constructor (s ,v1),ConstructorP (s1, p1) ) => if s = s1 then match(v1,p1) else NONE

    |(Tuple vs,TupleP ps) => if List.length vs = List.length ps  

                             then case all_answers match (ListPair.zip(vs,ps))  of

                                   SOME v2=>SOME v2

                                  |_ => NONE

                             else NONE

    |(_, Variable s ) => SOME [(s,v)]

    |(_,_) => NONE

You might be interested in
5.11 LAB: Print string in reverse [JAVA]:
ss7ja [257]

Answer:

This article discusses different ways to reverse a string in Java with examples.

8 0
2 years ago
Type the correct answer in the box. Spell all words correctly. Which language should you use to add functionality to web pages?
lubasha [3.4K]

The language that you will use to  add functionality to web pages is JavaScript.

<h3>What is JavaScript?</h3>

JavaScript is known to be a tool that is often used in a lot of ways.

It is used by in web development by Web developers as they are said to use this language to input interactive elements in websites.

Therefore, The language that you will use to  add functionality to web pages is JavaScript.

Learn more about functionality from

brainly.com/question/25638609

#SPJ1

5 0
3 years ago
What dictionary operation can you use to remove all the keys within the dictionary-named contacts?
Ierofanga [76]

The dictionary operation that you use to remove all the keys within the dictionary-named contacts is contacts.clear().

<h3>What is dictionary add and remove element from dictionary?</h3>

The act of Removing elements from Dictionary is one that can delete a specific item in a dictionary by the use of the pop() method.

Note that this method deletes an item with the given key and returns the value .

Hence, The dictionary operation that you use to remove all the keys within the dictionary-named contacts is contacts.clear().

Learn more about dictionary operation  from

brainly.com/question/24680091

#SPJ1

3 0
2 years ago
B. WAP to check whether input number is palindrome number or not using SUB...... END SUB.​
sveticcg [70]

For a number to be palindrome, the reverse of the number and the original number must be the same.

<h3>The main program</h3>

The program written in Python, where comments are used to explain each line is as follows:

#This gets input for the number

num = input()

#This reverses the number

numrev = num[::-1]

#If the reverse and the original number is the same

if num == numrev:

   #This prints Palindrome

   print("Palindrome")

else:

   #Otherwise, it prints Not palindrome

   print("Not palindrome")

Read more about Python programs at:

brainly.com/question/26497128

3 0
2 years ago
The computer that has been traditionally found on the desks in many offices and homes is the ___ computer.
Sladkaya [172]

Answer:

<u> Personal</u> computer

Explanation:

I.d.k the answer so don't blame me if its incorrect

7 0
3 years ago
Other questions:
  • Marco makes $65,000 a year as a graphic designer. He makes a charitable donation of $1,000 each year. He also has $5,000 of busi
    12·2 answers
  • What are the disadvantages of cloud computing?
    9·1 answer
  • What is an advantage of using a meta-search engine?
    14·1 answer
  • How many unique ip addresses can be made in a fixed-length ip address system using 6 bits?
    8·1 answer
  • 3. The channel bit error rate is 0.00001, and each packet’s total length is 1024 bytes including all overheads. Assume there are
    12·2 answers
  • A ________ refers to specific content of a field.
    7·1 answer
  • Three batch jobs, A through E, arrive at a computer center at almost the same time. They have estimated running times of 10, 6,
    6·1 answer
  • What is a special character when creating a password?
    8·2 answers
  • What is a command-line interactive scripting environment that provides the commands for almost any management task in a Windows
    9·1 answer
  • PLEASE HELP
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!