Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Conider the type checker for a simple expression language data Type = Int | Bool | TypeError deriving ( Eq , Show ) tc ::
Conider the type checker for a simple expression language
data Type Int Bool TypeError
deriving EqShow
tc :: Expr Type
tc N i Int
tc Plus e e tc eInt && tc eInt Int
tc Equal e e tc eInt && tc eInt Bool
tc eBool && tc eBool Bool
tc Not e tc eBool Bool
tc TypeError
Suppose you want to add type checking for boolean Or Or expr expr of two expressions that must evaluate to booleans. Select the appropriate line of code.
Group of answer choices
tc Or e e tc eBool && tc eBool Bool
tc Or e e tc eBool or tc eBool Bool
tc Or e e tc eBool or tc eBool
tc Or e e tc eBool && tc eBool Int
None of these
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