{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}

module Data.Aviation.WB.Arm.ArmRange(
  ArmRange(..)
, HasArmRange(..)
, HasArmRanges(..)
, SetArmRange(..)
, HasArmRange0(..)
, (.->.)
) where

import Control.Lens(Lens', Traversal', Setter', lens, makeClassy)
import Data.Aviation.WB.Arm.ArmRangeLower(ArmRangeLower, HasArmRangeLower(armRangeLower), HasArmRangeLowers(armRangeLowers), SetArmRangeLower(setArmRangeLower))
import Data.Aviation.WB.Arm.ArmRangeUpper(ArmRangeUpper, HasArmRangeUpper(armRangeUpper), HasArmRangeUppers(armRangeUppers), SetArmRangeUpper(setArmRangeUpper))
import Data.Eq(Eq)
import Data.Maybe(Maybe)
import Data.Ord(Ord)
import Prelude(Show)

data ArmRange =
  ArmRange
    ArmRangeLower
    ArmRangeUpper
  deriving (ArmRange -> ArmRange -> Bool
(ArmRange -> ArmRange -> Bool)
-> (ArmRange -> ArmRange -> Bool) -> Eq ArmRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArmRange -> ArmRange -> Bool
$c/= :: ArmRange -> ArmRange -> Bool
== :: ArmRange -> ArmRange -> Bool
$c== :: ArmRange -> ArmRange -> Bool
Eq, Eq ArmRange
Eq ArmRange
-> (ArmRange -> ArmRange -> Ordering)
-> (ArmRange -> ArmRange -> Bool)
-> (ArmRange -> ArmRange -> Bool)
-> (ArmRange -> ArmRange -> Bool)
-> (ArmRange -> ArmRange -> Bool)
-> (ArmRange -> ArmRange -> ArmRange)
-> (ArmRange -> ArmRange -> ArmRange)
-> Ord ArmRange
ArmRange -> ArmRange -> Bool
ArmRange -> ArmRange -> Ordering
ArmRange -> ArmRange -> ArmRange
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ArmRange -> ArmRange -> ArmRange
$cmin :: ArmRange -> ArmRange -> ArmRange
max :: ArmRange -> ArmRange -> ArmRange
$cmax :: ArmRange -> ArmRange -> ArmRange
>= :: ArmRange -> ArmRange -> Bool
$c>= :: ArmRange -> ArmRange -> Bool
> :: ArmRange -> ArmRange -> Bool
$c> :: ArmRange -> ArmRange -> Bool
<= :: ArmRange -> ArmRange -> Bool
$c<= :: ArmRange -> ArmRange -> Bool
< :: ArmRange -> ArmRange -> Bool
$c< :: ArmRange -> ArmRange -> Bool
compare :: ArmRange -> ArmRange -> Ordering
$ccompare :: ArmRange -> ArmRange -> Ordering
$cp1Ord :: Eq ArmRange
Ord, Int -> ArmRange -> ShowS
[ArmRange] -> ShowS
ArmRange -> String
(Int -> ArmRange -> ShowS)
-> (ArmRange -> String) -> ([ArmRange] -> ShowS) -> Show ArmRange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArmRange] -> ShowS
$cshowList :: [ArmRange] -> ShowS
show :: ArmRange -> String
$cshow :: ArmRange -> String
showsPrec :: Int -> ArmRange -> ShowS
$cshowsPrec :: Int -> ArmRange -> ShowS
Show)

makeClassy ''ArmRange

(.->.) ::
  ArmRangeLower
  -> ArmRangeUpper
  -> ArmRange
.->. :: ArmRangeLower -> ArmRangeUpper -> ArmRange
(.->.) =
  ArmRangeLower -> ArmRangeUpper -> ArmRange
ArmRange

infixl 2 .->. 

class HasArmRanges a where
  armRanges ::
    Traversal'
      a
      ArmRange

instance HasArmRanges ArmRange where
  armRanges :: (ArmRange -> f ArmRange) -> ArmRange -> f ArmRange
armRanges =
    (ArmRange -> f ArmRange) -> ArmRange -> f ArmRange
forall c. HasArmRange c => Lens' c ArmRange
armRange

class SetArmRange a where
  setArmRange ::
    Setter'
      a
      ArmRange

instance SetArmRange ArmRange where
  setArmRange :: (ArmRange -> f ArmRange) -> ArmRange -> f ArmRange
setArmRange =
    (ArmRange -> f ArmRange) -> ArmRange -> f ArmRange
forall c. HasArmRange c => Lens' c ArmRange
armRange

instance HasArmRangeLower ArmRange where
  armRangeLower :: (ArmRangeLower -> f ArmRangeLower) -> ArmRange -> f ArmRange
armRangeLower =
    (ArmRange -> ArmRangeLower)
-> (ArmRange -> ArmRangeLower -> ArmRange)
-> Lens' ArmRange ArmRangeLower
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens
      (\(ArmRange ArmRangeLower
lower ArmRangeUpper
_) -> ArmRangeLower
lower)
      (\(ArmRange ArmRangeLower
_ ArmRangeUpper
upper) ArmRangeLower
lower -> ArmRangeLower -> ArmRangeUpper -> ArmRange
ArmRange ArmRangeLower
lower ArmRangeUpper
upper)

instance HasArmRangeUpper ArmRange where
  armRangeUpper :: (ArmRangeUpper -> f ArmRangeUpper) -> ArmRange -> f ArmRange
armRangeUpper =
    (ArmRange -> ArmRangeUpper)
-> (ArmRange -> ArmRangeUpper -> ArmRange)
-> Lens' ArmRange ArmRangeUpper
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens
      (\(ArmRange ArmRangeLower
_ ArmRangeUpper
upper) -> ArmRangeUpper
upper)
      (\(ArmRange ArmRangeLower
lower ArmRangeUpper
_) ArmRangeUpper
upper -> ArmRangeLower -> ArmRangeUpper -> ArmRange
ArmRange ArmRangeLower
lower ArmRangeUpper
upper)

instance HasArmRangeLowers ArmRange where
  armRangeLowers :: (ArmRangeLower -> f ArmRangeLower) -> ArmRange -> f ArmRange
armRangeLowers =
    (ArmRangeLower -> f ArmRangeLower) -> ArmRange -> f ArmRange
forall c. HasArmRangeLower c => Lens' c ArmRangeLower
armRangeLower
    
instance HasArmRangeUppers ArmRange where
  armRangeUppers :: (ArmRangeUpper -> f ArmRangeUpper) -> ArmRange -> f ArmRange
armRangeUppers =
    (ArmRangeUpper -> f ArmRangeUpper) -> ArmRange -> f ArmRange
forall c. HasArmRangeUpper c => Lens' c ArmRangeUpper
armRangeUpper

instance SetArmRangeLower ArmRange where
  setArmRangeLower :: (ArmRangeLower -> f ArmRangeLower) -> ArmRange -> f ArmRange
setArmRangeLower =
    (ArmRangeLower -> f ArmRangeLower) -> ArmRange -> f ArmRange
forall c. HasArmRangeLower c => Lens' c ArmRangeLower
armRangeLower
    
instance SetArmRangeUpper ArmRange where
  setArmRangeUpper :: (ArmRangeUpper -> f ArmRangeUpper) -> ArmRange -> f ArmRange
setArmRangeUpper =
    (ArmRangeUpper -> f ArmRangeUpper) -> ArmRange -> f ArmRange
forall c. HasArmRangeUpper c => Lens' c ArmRangeUpper
armRangeUpper

class HasArmRange0 a where
  armRange0 ::
    Lens'
      a
      (Maybe ArmRange)