mkEffector :: [OptDesc]                           -- ^ option field list
           -> String                              -- ^ getopt_th name
           -> Q [Dec]

mkEffector optdescs getoptName = do
  let effectorSig = tsArrows [ pclv_typename getoptName
                             , appTIO (AppT (AppT (ConT ''Either)
                                                  (AppT ListT
                                                        (ConT ''NFException)))
                                            (ov_typename getoptName))
                             ]
  pclv    <- newName "pclv" -- name of the parameter to the effector; which is
                            -- a PCLV record
  effectorBody <- mkEffectorBody optdescs getoptName pclv
  return $ mk_effector effectorSig (effect_name getoptName) pclv effectorBody

-- mk_effector -----------------------------------------------------------------

-- | create effector fn, inc. type signature
--
--   (getoptsx_effect :: Getoptsx__ -> IO (Either [NFException] Getoptsx)
--    getoptsx_effect g = do { ... }
--    above)
mkEffector :: [OptDesc]                           -- ^ option field list
           -> String                              -- ^ getopt_th name
           -> Q [Dec]
mkEffector optdescs getoptName = do
  let effectorSig = tsArrows [ pclv_typename getoptName
                             , appTIO (AppT (AppT (ConT ''Either)
                                                  (AppT ListT
                                                        (ConT ''NFException)))
                                            (ov_typename getoptName))
                             ]
  pclv    <- newName "pclv" -- name of the parameter to the effector; which is
                            -- a PCLV record
  effectorBody <- mkEffectorBody optdescs getoptName pclv
  return $ mk_effector effectorSig (effect_name getoptName) pclv effectorBody

-- mk_effector -----------------------------------------------------------------

-- | create effector fn, inc. type signature
--
--   (getoptsx_effect :: Getoptsx__ -> IO (Either [NFException] Getoptsx)
--    getoptsx_effect g = do { ... }
--    above)
mkEffector optdescs getoptName = do
  let effectorSig = tsArrows [ pclv_typename getoptName
                             , appTIO (AppT (AppT (ConT ''Either)
                                                  (AppT ListT
                                                        (ConT ''NFException)))
                                            (ov_typename getoptName))
                             ]
  pclv    <- newName "pclv" -- name of the parameter to the effector; which is
                            -- a PCLV record
  effectorBody <- mkEffectorBody optdescs getoptName pclv
  return $ mk_effector effectorSig (effect_name getoptName) pclv effectorBody

-- mk_effector -----------------------------------------------------------------

-- | create effector fn, inc. type signature
--
--   (getoptsx_effect :: Getoptsx__ -> IO (Either [NFException] Getoptsx)
--    getoptsx_effect g = do { ... }
--    above)