{-# OPTIONS_GHC -threaded #-}
{-# LANGUAGE FlexibleInstances #-}
module DobutokO.Sound.One where
data One2 a = O21 a | O22 a a deriving One2 a -> One2 a -> Bool
(One2 a -> One2 a -> Bool)
-> (One2 a -> One2 a -> Bool) -> Eq (One2 a)
forall a. Eq a => One2 a -> One2 a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: One2 a -> One2 a -> Bool
$c/= :: forall a. Eq a => One2 a -> One2 a -> Bool
== :: One2 a -> One2 a -> Bool
$c== :: forall a. Eq a => One2 a -> One2 a -> Bool
Eq
one2C :: One2 a -> String
one2C :: One2 a -> String
one2C (O21 a
_) = String
"O21"
one2C (O22 a
_ a
_) = String
"O22"
one21 :: One2 a -> [a]
one21 :: One2 a -> [a]
one21 (O21 a
x) = [a
x]
one21 (O22 a
x a
y) = [a
x,a
y]
one2Set1 :: a -> One2 a -> One2 a
one2Set1 :: a -> One2 a -> One2 a
one2Set1 a
x (O21 a
_) = a -> One2 a
forall a. a -> One2 a
O21 a
x
one2Set1 a
x (O22 a
_ a
y) = a -> a -> One2 a
forall a. a -> a -> One2 a
O22 a
x a
y
one2Set2 :: a -> One2 a -> One2 a
one2Set2 :: a -> One2 a -> One2 a
one2Set2 a
y (O21 a
x) = a -> a -> One2 a
forall a. a -> a -> One2 a
O22 a
x a
y
one2Set2 a
y (O22 a
x a
_) = a -> a -> One2 a
forall a. a -> a -> One2 a
O22 a
x a
y
one2toList :: One2 a -> [a]
one2toList :: One2 a -> [a]
one2toList (O21 a
x) = [a
x]
one2toList (O22 a
x a
y) = [a
x,a
y]
data One3 a = O31 a | O32 a a | O33 a a a deriving One3 a -> One3 a -> Bool
(One3 a -> One3 a -> Bool)
-> (One3 a -> One3 a -> Bool) -> Eq (One3 a)
forall a. Eq a => One3 a -> One3 a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: One3 a -> One3 a -> Bool
$c/= :: forall a. Eq a => One3 a -> One3 a -> Bool
== :: One3 a -> One3 a -> Bool
$c== :: forall a. Eq a => One3 a -> One3 a -> Bool
Eq
one3C :: One3 a -> String
one3C :: One3 a -> String
one3C (O31 a
_) = String
"O31"
one3C (O32 a
_ a
_) = String
"O32"
one3C (O33 a
_ a
_ a
_) = String
"O33"
one31 :: One3 a -> [a]
one31 :: One3 a -> [a]
one31 (O31 a
x) = [a
x]
one31 (O32 a
x a
y) = [a
x,a
y]
one31 (O33 a
x a
y a
z) = [a
x,a
y,a
z]
one3Set1 :: a -> One3 a -> One3 a
one3Set1 :: a -> One3 a -> One3 a
one3Set1 a
x (O31 a
_) = a -> One3 a
forall a. a -> One3 a
O31 a
x
one3Set1 a
x (O32 a
_ a
y) = a -> a -> One3 a
forall a. a -> a -> One3 a
O32 a
x a
y
one3Set1 a
x (O33 a
_ a
y a
z) = a -> a -> a -> One3 a
forall a. a -> a -> a -> One3 a
O33 a
x a
y a
z
one3Set2 :: a -> One3 a -> One3 a
one3Set2 :: a -> One3 a -> One3 a
one3Set2 a
y (O31 a
x) = a -> a -> One3 a
forall a. a -> a -> One3 a
O32 a
x a
y
one3Set2 a
y (O32 a
x a
_) = a -> a -> One3 a
forall a. a -> a -> One3 a
O32 a
x a
y
one3Set2 a
y (O33 a
x a
_ a
z) = a -> a -> a -> One3 a
forall a. a -> a -> a -> One3 a
O33 a
x a
y a
z
one3Set3 :: a -> One3 a -> Maybe (One3 a)
one3Set3 :: a -> One3 a -> Maybe (One3 a)
one3Set3 a
z (O32 a
x a
y) = One3 a -> Maybe (One3 a)
forall a. a -> Maybe a
Just (a -> a -> a -> One3 a
forall a. a -> a -> a -> One3 a
O33 a
x a
y a
z)
one3Set3 a
z (O33 a
x a
y a
_) = One3 a -> Maybe (One3 a)
forall a. a -> Maybe a
Just (a -> a -> a -> One3 a
forall a. a -> a -> a -> One3 a
O33 a
x a
y a
z)
one3Set3 a
_ One3 a
_ = Maybe (One3 a)
forall a. Maybe a
Nothing
one3toList :: One3 a -> [a]
one3toList :: One3 a -> [a]
one3toList (O31 a
x) = [a
x]
one3toList (O32 a
x a
y) = [a
x, a
y]
one3toList (O33 a
x a
y a
z) = [a
x, a
y, a
z]