{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
module Reflex.Bulmex.Form.FormTypes
( FormAction(..)
, FormState(..)
, _PostDefault
, _Loading
, _FormRest
) where
import Control.Lens
import Data.Generics.Sum
import GHC.Generics (Generic)
data FormAction
= PostDefault
| Loading
| FormRest
deriving (Generic)
_PostDefault :: Prism' FormAction ()
_PostDefault = _Ctor @"PostDefault"
_Loading :: Prism' FormAction ()
_Loading = _Ctor @"Loading"
_FormRest :: Prism' FormAction ()
_FormRest = _Ctor @"FormRest"
data FormState
= FormStateRest
| FormStateSpinning
deriving (Show)
instance Semigroup FormState where
(<>) FormStateRest FormStateRest = FormStateRest
(<>) _ _ = FormStateSpinning
instance Monoid FormState where
mempty = FormStateRest