{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
module Potato.Flow.Cmd (
PFCmdTag(..)
, PFCmd
) where
import Relude
import Potato.Flow.Math
import Potato.Flow.Types
import Data.Constraint.Extras.TH
import qualified Data.Dependent.Sum as DS
import Data.GADT.Compare.TH
import Data.GADT.Show.TH
import qualified Text.Show
data PFCmdTag a where
PFCNewElts :: PFCmdTag [SuperSEltLabel]
PFCDeleteElts :: PFCmdTag [SuperSEltLabel]
PFCMove :: PFCmdTag ([LayerPos], LayerPos)
PFCManipulate :: PFCmdTag ControllersWithId
PFCResizeCanvas :: PFCmdTag DeltaLBox
instance Text.Show.Show (PFCmdTag a) where
show :: PFCmdTag a -> String
show PFCmdTag a
PFCNewElts = String
"PFCNewElts"
show PFCmdTag a
PFCDeleteElts = String
"PFCDeleteElts"
show PFCmdTag a
PFCMove = String
"PFCMove"
show PFCmdTag a
PFCManipulate = String
"PFCManipulate"
show PFCmdTag a
PFCResizeCanvas = String
"PFCResize"
type PFCmd = DS.DSum PFCmdTag Identity
instance NFData PFCmd where
rnf :: PFCmd -> ()
rnf (PFCmdTag a
PFCNewElts DS.:=> Identity a
a) = forall a. NFData a => a -> ()
rnf a
a
rnf (PFCmdTag a
PFCDeleteElts DS.:=> Identity a
a) = forall a. NFData a => a -> ()
rnf a
a
rnf (PFCmdTag a
PFCMove DS.:=> Identity a
a) = forall a. NFData a => a -> ()
rnf a
a
rnf (PFCmdTag a
PFCManipulate DS.:=> Identity a
a) = forall a. NFData a => a -> ()
rnf a
a
rnf (PFCmdTag a
PFCResizeCanvas DS.:=> Identity a
a) = forall a. NFData a => a -> ()
rnf a
a
deriveGEq ''PFCmdTag
deriveGCompare ''PFCmdTag
deriveGShow ''PFCmdTag
deriveArgDict ''PFCmdTag