{-|
Module      : KMonad.Args.Types
Description : The basic types of configuration parsing.
Copyright   : (c) David Janssen, 2019
License     : MIT

Maintainer  : janssen.dhj@gmail.com
Stability   : experimental
Portability : non-portable (MPTC with FD, FFI to Linux-only c-code)

-}
module KMonad.Args.Types
  (
    -- * $cfg
    CfgToken(..)

    -- * $but
  , DefButton(..)
  , ImplArnd(..)

    -- * $tls
  , DefSetting(..)
  , DefSettings
  , DefAlias
  , DefLayerSetting(..)
  , DefLayer(..)
  , DefSrc(..)
  , KExpr(..)

    -- * $defio
  , IToken(..)
  , OToken(..)

    -- * $lenses
  , AsKExpr(..)
  , AsDefSetting(..)
  , HasDefSrc(..)
  , AsDefLayerSetting(..)
) where


import KMonad.Prelude

import KMonad.Model.Button
import KMonad.Keyboard
import KMonad.Keyboard.IO
import KMonad.Util

--------------------------------------------------------------------------------
-- $but
--
-- Tokens representing different types of buttons

-- FIXME: This is really broken: why are there 2 lists of 'DefButton's? There is
-- one here, and one in Parser/Types.hs

-- | Button ADT
data DefButton
  = KRef Text                              -- ^ Reference a named button
  | KEmit Keycode                          -- ^ Emit a keycode
  | KPressOnly Keycode                     -- ^ Emit only the press of a keycode
  | KReleaseOnly Keycode                   -- ^ Emit only the release of a keycode
  | KLayerToggle Text                      -- ^ Toggle to a layer when held
  | KLayerSwitch Text                      -- ^ Switch base-layer when pressed
  | KLayerAdd Text                         -- ^ Add a layer when pressed
  | KLayerRem Text                         -- ^ Remove top instance of a layer when pressed
  | KTapNext DefButton DefButton           -- ^ Do 2 things based on behavior
  | KTapHold Int DefButton DefButton       -- ^ Do 2 things based on behavior and delay
  | KTapHoldNext Int DefButton DefButton (Maybe DefButton)
    -- ^ Mixture between KTapNext and KTapHold
  | KTapNextRelease DefButton DefButton    -- ^ Do 2 things based on behavior
  | KTapHoldNextRelease Int DefButton DefButton (Maybe DefButton)
    -- ^ Like KTapNextRelease but with a timeout
  | KTapNextPress DefButton DefButton      -- ^ Like KTapNextRelease but also hold on presses
  | KTapHoldNextPress Int DefButton DefButton (Maybe DefButton)
    -- ^ Like KTapNextPress but with a timeout
  | KAroundNext DefButton                  -- ^ Surround a future button
  | KAroundNextSingle DefButton            -- ^ Surround a future button
  | KMultiTap [(Int, DefButton)] DefButton -- ^ Do things depending on tap-count
  | KStepped [DefButton]                   -- ^ Do different things, one-by-one
  | KAround DefButton DefButton            -- ^ Wrap 1 button around another
  | KAroundOnly DefButton DefButton        -- ^ Wrap 1 button only around another
  | KAroundWhenAlone DefButton DefButton   -- ^ Wrap 1 button around another when it's "alone"
  | KAroundImplicit DefButton DefButton    -- ^ Wrap 1 button around another
  | KAroundNextTimeout Int DefButton DefButton
  | KTapMacro [DefButton] (Maybe Int)
    -- ^ Sequence of buttons to tap, possible delay between each press
  | KTapMacroRelease [DefButton] (Maybe Int)
    -- ^ Sequence of buttons to tap, tap last on release, possible delay between each press
  | KComposeSeq [DefButton]                -- ^ Compose-key sequence
  | KPause Milliseconds                    -- ^ Pause for a period of time
  | KLayerDelay Int LayerTag               -- ^ Switch to a layer for a period of time
  | KLayerNext LayerTag                    -- ^ Perform next button in different layer
  | KCommand Text (Maybe Text)             -- ^ Execute a shell command on press, as well
                                           --   as possibly on release
  | KStickyKey Int DefButton               -- ^ Act as if a button is pressed for a period of time
  | KBeforeAfterNext DefButton DefButton   -- ^ Surround a future button in a before and after tap
  | KTrans                                 -- ^ Transparent button that does nothing
  | KBlock                                 -- ^ Button that catches event
  deriving (Int -> DefButton -> ShowS
[DefButton] -> ShowS
DefButton -> String
(Int -> DefButton -> ShowS)
-> (DefButton -> String)
-> ([DefButton] -> ShowS)
-> Show DefButton
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DefButton -> ShowS
showsPrec :: Int -> DefButton -> ShowS
$cshow :: DefButton -> String
show :: DefButton -> String
$cshowList :: [DefButton] -> ShowS
showList :: [DefButton] -> ShowS
Show, DefButton -> DefButton -> Bool
(DefButton -> DefButton -> Bool)
-> (DefButton -> DefButton -> Bool) -> Eq DefButton
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DefButton -> DefButton -> Bool
== :: DefButton -> DefButton -> Bool
$c/= :: DefButton -> DefButton -> Bool
/= :: DefButton -> DefButton -> Bool
Eq, Typeable, Typeable DefButton
Typeable DefButton =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> DefButton -> c DefButton)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c DefButton)
-> (DefButton -> Constr)
-> (DefButton -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c DefButton))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DefButton))
-> ((forall b. Data b => b -> b) -> DefButton -> DefButton)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DefButton -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DefButton -> r)
-> (forall u. (forall d. Data d => d -> u) -> DefButton -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> DefButton -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> DefButton -> m DefButton)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DefButton -> m DefButton)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DefButton -> m DefButton)
-> Data DefButton
DefButton -> Constr
DefButton -> DataType
(forall b. Data b => b -> b) -> DefButton -> DefButton
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> DefButton -> u
forall u. (forall d. Data d => d -> u) -> DefButton -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefButton -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefButton -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DefButton -> m DefButton
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DefButton -> m DefButton
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DefButton
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefButton -> c DefButton
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DefButton)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DefButton)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefButton -> c DefButton
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefButton -> c DefButton
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DefButton
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DefButton
$ctoConstr :: DefButton -> Constr
toConstr :: DefButton -> Constr
$cdataTypeOf :: DefButton -> DataType
dataTypeOf :: DefButton -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DefButton)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DefButton)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DefButton)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DefButton)
$cgmapT :: (forall b. Data b => b -> b) -> DefButton -> DefButton
gmapT :: (forall b. Data b => b -> b) -> DefButton -> DefButton
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefButton -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefButton -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefButton -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefButton -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DefButton -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> DefButton -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DefButton -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DefButton -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DefButton -> m DefButton
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DefButton -> m DefButton
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DefButton -> m DefButton
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DefButton -> m DefButton
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DefButton -> m DefButton
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DefButton -> m DefButton
Data)

instance Plated DefButton

-- | Possible values for implicit around
data ImplArnd
  = IADisabled
  | IAAround
  | IAAroundOnly
  | IAAroundWhenAlone
  deriving (Int -> ImplArnd -> ShowS
[ImplArnd] -> ShowS
ImplArnd -> String
(Int -> ImplArnd -> ShowS)
-> (ImplArnd -> String) -> ([ImplArnd] -> ShowS) -> Show ImplArnd
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ImplArnd -> ShowS
showsPrec :: Int -> ImplArnd -> ShowS
$cshow :: ImplArnd -> String
show :: ImplArnd -> String
$cshowList :: [ImplArnd] -> ShowS
showList :: [ImplArnd] -> ShowS
Show, ImplArnd -> ImplArnd -> Bool
(ImplArnd -> ImplArnd -> Bool)
-> (ImplArnd -> ImplArnd -> Bool) -> Eq ImplArnd
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ImplArnd -> ImplArnd -> Bool
== :: ImplArnd -> ImplArnd -> Bool
$c/= :: ImplArnd -> ImplArnd -> Bool
/= :: ImplArnd -> ImplArnd -> Bool
Eq)

--------------------------------------------------------------------------------
-- $cfg
--
-- The Cfg token that can be extracted from a config-text without ever entering
-- IO. This will then directly be translated to a DaemonCfg
--

-- | The 'CfgToken' contains all the data needed to construct an
-- 'KMonad.App.AppCfg'.
data CfgToken = CfgToken
  { CfgToken -> LogFunc -> IO (Acquire KeySource)
_src   :: LogFunc -> IO (Acquire KeySource) -- ^ How to grab the source keyboard
  , CfgToken -> LogFunc -> IO (Acquire KeySink)
_snk   :: LogFunc -> IO (Acquire KeySink)   -- ^ How to construct the out keybboard
  , CfgToken -> LMap Button
_km    :: LMap Button                       -- ^ An 'LMap' of 'Button' actions
  , CfgToken -> Text
_fstL  :: LayerTag                          -- ^ Name of initial layer
  , CfgToken -> Bool
_flt   :: Bool                              -- ^ How to deal with unhandled events
  , CfgToken -> Bool
_allow :: Bool                              -- ^ Whether to allow shell commands
  , CfgToken -> Maybe Int
_ksd   :: Maybe Int                         -- ^ Output delay between keys
  }
makeClassy ''CfgToken


--------------------------------------------------------------------------------
-- $tls
--
-- A collection of all the different top-level statements possible in a config
-- file.

-- | A list of keycodes describing the ordering used by all other layers
-- | which is associated with a name.
data DefSrc = DefSrc
  { DefSrc -> Maybe Text
_srcName  :: Maybe Text -- ^ A unique name used to refer to this layer.
  , DefSrc -> [Keycode]
_keycodes :: [Keycode]  -- ^ Layer settings containing also the buttons.
  }
  deriving (Int -> DefSrc -> ShowS
[DefSrc] -> ShowS
DefSrc -> String
(Int -> DefSrc -> ShowS)
-> (DefSrc -> String) -> ([DefSrc] -> ShowS) -> Show DefSrc
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DefSrc -> ShowS
showsPrec :: Int -> DefSrc -> ShowS
$cshow :: DefSrc -> String
show :: DefSrc -> String
$cshowList :: [DefSrc] -> ShowS
showList :: [DefSrc] -> ShowS
Show, DefSrc -> DefSrc -> Bool
(DefSrc -> DefSrc -> Bool)
-> (DefSrc -> DefSrc -> Bool) -> Eq DefSrc
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DefSrc -> DefSrc -> Bool
== :: DefSrc -> DefSrc -> Bool
$c/= :: DefSrc -> DefSrc -> Bool
/= :: DefSrc -> DefSrc -> Bool
Eq)
makeClassy ''DefSrc

-- | A mapping from names to button tokens
type DefAlias = [(Text, DefButton)]

data DefLayerSetting
  = LSrcName Text
  | LImplArnd ImplArnd
  | LButton DefButton
  deriving (Int -> DefLayerSetting -> ShowS
[DefLayerSetting] -> ShowS
DefLayerSetting -> String
(Int -> DefLayerSetting -> ShowS)
-> (DefLayerSetting -> String)
-> ([DefLayerSetting] -> ShowS)
-> Show DefLayerSetting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DefLayerSetting -> ShowS
showsPrec :: Int -> DefLayerSetting -> ShowS
$cshow :: DefLayerSetting -> String
show :: DefLayerSetting -> String
$cshowList :: [DefLayerSetting] -> ShowS
showList :: [DefLayerSetting] -> ShowS
Show, DefLayerSetting -> DefLayerSetting -> Bool
(DefLayerSetting -> DefLayerSetting -> Bool)
-> (DefLayerSetting -> DefLayerSetting -> Bool)
-> Eq DefLayerSetting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DefLayerSetting -> DefLayerSetting -> Bool
== :: DefLayerSetting -> DefLayerSetting -> Bool
$c/= :: DefLayerSetting -> DefLayerSetting -> Bool
/= :: DefLayerSetting -> DefLayerSetting -> Bool
Eq)
makeClassyPrisms ''DefLayerSetting

-- | A layer of buttons
data DefLayer = DefLayer
  { DefLayer -> Text
_layerName :: Text
  , DefLayer -> [DefLayerSetting]
_layerSettings :: [DefLayerSetting]
  }
  deriving (Int -> DefLayer -> ShowS
[DefLayer] -> ShowS
DefLayer -> String
(Int -> DefLayer -> ShowS)
-> (DefLayer -> String) -> ([DefLayer] -> ShowS) -> Show DefLayer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DefLayer -> ShowS
showsPrec :: Int -> DefLayer -> ShowS
$cshow :: DefLayer -> String
show :: DefLayer -> String
$cshowList :: [DefLayer] -> ShowS
showList :: [DefLayer] -> ShowS
Show, DefLayer -> DefLayer -> Bool
(DefLayer -> DefLayer -> Bool)
-> (DefLayer -> DefLayer -> Bool) -> Eq DefLayer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DefLayer -> DefLayer -> Bool
== :: DefLayer -> DefLayer -> Bool
$c/= :: DefLayer -> DefLayer -> Bool
/= :: DefLayer -> DefLayer -> Bool
Eq)


--------------------------------------------------------------------------------
-- $defcfg
--
-- Different settings

-- | All different input-tokens KMonad can take
data IToken
  = KDeviceSource FilePath
  | KLowLevelHookSource
  | KIOKitSource (Maybe Text)
  deriving (Int -> IToken -> ShowS
[IToken] -> ShowS
IToken -> String
(Int -> IToken -> ShowS)
-> (IToken -> String) -> ([IToken] -> ShowS) -> Show IToken
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IToken -> ShowS
showsPrec :: Int -> IToken -> ShowS
$cshow :: IToken -> String
show :: IToken -> String
$cshowList :: [IToken] -> ShowS
showList :: [IToken] -> ShowS
Show)

-- | All different output-tokens KMonad can take
data OToken
  = KUinputSink Text (Maybe Text)
  | KSendEventSink (Maybe (Int, Int))
  | KKextSink
  deriving (Int -> OToken -> ShowS
[OToken] -> ShowS
OToken -> String
(Int -> OToken -> ShowS)
-> (OToken -> String) -> ([OToken] -> ShowS) -> Show OToken
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OToken -> ShowS
showsPrec :: Int -> OToken -> ShowS
$cshow :: OToken -> String
show :: OToken -> String
$cshowList :: [OToken] -> ShowS
showList :: [OToken] -> ShowS
Show)

-- | All possible single settings
data DefSetting
  = SIToken      IToken
  | SOToken      OToken
  | SCmpSeq      DefButton
  | SFallThrough Bool
  | SAllowCmd    Bool
  | SCmpSeqDelay Int
  | SKeySeqDelay Int
  | SImplArnd    ImplArnd
  deriving (Int -> DefSetting -> ShowS
[DefSetting] -> ShowS
DefSetting -> String
(Int -> DefSetting -> ShowS)
-> (DefSetting -> String)
-> ([DefSetting] -> ShowS)
-> Show DefSetting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DefSetting -> ShowS
showsPrec :: Int -> DefSetting -> ShowS
$cshow :: DefSetting -> String
show :: DefSetting -> String
$cshowList :: [DefSetting] -> ShowS
showList :: [DefSetting] -> ShowS
Show)
makeClassyPrisms ''DefSetting

-- | 'Eq' instance for a 'DefSetting'. Because every one of these options may be
-- given at most once, we only need to check the outermost constructor in order
-- to test for equality
instance Eq DefSetting where
  SIToken{}      == :: DefSetting -> DefSetting -> Bool
== SIToken{}      = Bool
True
  SOToken{}      == SOToken{}      = Bool
True
  SCmpSeq{}      == SCmpSeq{}      = Bool
True
  SFallThrough{} == SFallThrough{} = Bool
True
  SAllowCmd{}    == SAllowCmd{}    = Bool
True
  SImplArnd{}    == SImplArnd{}    = Bool
True
  SCmpSeqDelay{} == SCmpSeqDelay{} = Bool
True
  SKeySeqDelay{} == SKeySeqDelay{} = Bool
True
  DefSetting
_              == DefSetting
_              = Bool
False

-- | A list of different 'DefSetting' values
type DefSettings = [DefSetting]

--------------------------------------------------------------------------------
-- $tkn

-- | Any statement in a config-file must parse to a 'KExpr'
data KExpr
  = KDefCfg   DefSettings
  | KDefSrc   DefSrc
  | KDefLayer DefLayer
  | KDefAlias DefAlias
  deriving (Int -> KExpr -> ShowS
[KExpr] -> ShowS
KExpr -> String
(Int -> KExpr -> ShowS)
-> (KExpr -> String) -> ([KExpr] -> ShowS) -> Show KExpr
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> KExpr -> ShowS
showsPrec :: Int -> KExpr -> ShowS
$cshow :: KExpr -> String
show :: KExpr -> String
$cshowList :: [KExpr] -> ShowS
showList :: [KExpr] -> ShowS
Show, KExpr -> KExpr -> Bool
(KExpr -> KExpr -> Bool) -> (KExpr -> KExpr -> Bool) -> Eq KExpr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: KExpr -> KExpr -> Bool
== :: KExpr -> KExpr -> Bool
$c/= :: KExpr -> KExpr -> Bool
/= :: KExpr -> KExpr -> Bool
Eq)
makeClassyPrisms ''KExpr


--------------------------------------------------------------------------------
-- $act