Which of the following Semigroup instances are lawful?   Please show the solution for each option.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter10: Object-oriented Programming
Section: Chapter Questions
Problem 4RQ
icon
Related questions
Question

Which of the following Semigroup instances are lawful?

 

Please show the solution for each option.

Monoids and Semigroups
Question 5
Which of the following Semigroup instances are lawful?
1. О
newtype X = X Int
instance Semigroup X where
Ха <> Х ь 3D х (а + b)
2. O
newtype X = X Int
instance Semigroup X where
Ха <> X ь 3D х (а — b)
3.
newtype X = X Int
instance Semigroup X where
Ха <> Х ь - х (аbs (a + b))
4. O
newtype X = X Int
instance Semigroup X where
Ха <> X ь %3D Ха
Transcribed Image Text:Monoids and Semigroups Question 5 Which of the following Semigroup instances are lawful? 1. О newtype X = X Int instance Semigroup X where Ха <> Х ь 3D х (а + b) 2. O newtype X = X Int instance Semigroup X where Ха <> X ь 3D х (а — b) 3. newtype X = X Int instance Semigroup X where Ха <> Х ь - х (аbs (a + b)) 4. O newtype X = X Int instance Semigroup X where Ха <> X ь %3D Ха
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage