Question: Consider the following abstract syntax for a language for nonnested integer lists. N represents integer constants. The constant Empty denotes an empty list. The operation

 Consider the following abstract syntax for a language for nonnested integer

Consider the following abstract syntax for a language for nonnested integer lists. N represents integer constants. The constant Empty denotes an empty list. The operation Cons adds an integer (given as the first argument) to a list. We can extract the first element of a list using Head and the operation Length represents a function to compute the length of a list. data Expr = N Int Empty Cons Expr Expr | Head Expr | Length Ex pr Which of the following expressions should be considered to be type correct by a type checker for that language? Select one or more. Cons (N 1) (N 5) Head ( Cons (N 5) Empty ) Length Empty Cons ( Length Empty) Cons ( Length Empty ) Empty

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!