So I’m trying to learn haskell. How do I create a semi group?
I feel like my syntax is off.
data myBool = myBool Bool
instance Semigroup myBool where
(<>) :: myBool -> myBool -> myBool
(<>) x y | False False = False
| False True = False
| True False = False
| True True = True
I can’t seem to find documentation that implements a semi group. Any advice?
I tried the above, and placing the (False, False)
in brackets like this and still no luck.
New contributor
user20102550 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.