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
Choose the answer that best explains why Morse's invention of the telegraph changed media forever.
Alex73 [517]

Just had this question, the correct answer is

It was the first form of media that did not require people to physically transport the information.

7 0
3 years ago
Read 2 more answers
A(n) _____ is substance in which one or more atoms have the same number of protons (i.e. the same atomic number).
natima [27]

I think it’s Element I think

3 0
3 years ago
What is the processing speed for the second generation of computers​
Helga [31]

10mbp

I hope it helps you

5 0
3 years ago
Explain the working system of a computer with an example​
Romashka-Z-Leto [24]

<h2>{\underline{\fcolorbox{White}{pink}{ANSWER♥︎}}}</h2>

<u>The computer is the combination of hardware and software. Hardware is the physical component of a computer like motherboard, memory devices, monitor, keyboard etc., while software is the set of programs or instructions. Both hardware and software together make the computer system function.</u>

<h2><u>E</u><u>x</u><u>a</u><u>m</u><u>p</u><u>l</u><u>e</u><u>s</u><u> </u><u>:</u><u>-</u><u> </u></h2>

<h3><u>Mainframe Computer</u></h3>
  • Mainframe Computer. 20 in Kickin Technology Series: MainFrame Computers. MORE POWEeeer! Movie 1. ...
  • Desktop Computer. Movie: 2. Desktop Computers. ...
  • Laptop or Notebook Computer. Movie: 3. Laptop Computers. ...
  • Palmtop Computer or Personal Digital Assistant (PDA)
7 0
3 years ago
A digital clock on a small cooking appliance keeps time by?
IgorLugansk [536]
They typically use the 50-60 Hz oscillation of AC power or a 32,768 hertz Chrystal oscillator to keep time. <span />
5 0
3 years ago
Other questions:
  • Operating systems such as Microsoft Windows use a specific character before a file extension to separate it from the filename. W
    9·2 answers
  • The inventory tracking system shows that 12 laptop were on hand before a customer brings two laptops to the register for purchas
    9·1 answer
  • What does the metric column in a routing table do?
    8·1 answer
  • Which scenario shows the best example of intrinsic motivation?
    13·2 answers
  • Studies show people remember at least ___more information when the document they are seeing or reading contains visual elements
    9·1 answer
  • Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.
    15·1 answer
  • Write a qbasic program to display integer numbers 1 to 100 using the for next loop<br>​
    9·1 answer
  • Hello Answerers it would be great if you could answer this:
    12·2 answers
  • Why are control components necessary in traditional software and generally not required in object-oriented software?​
    11·1 answer
  • patty works at Mcdonald's as a chef. it is her job to make hamburgers as each order arrives on her computer screen. one day patt
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!