Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
