packages feed

uhc-light-1.1.9.4: src/UHC/Light/Compiler/Core/FvS.hs


-- UUAGC 0.9.52.1 (build/103/lib-ehc/UHC/Light/Compiler/Core/FvS.ag)
module UHC.Light.Compiler.Core.FvS(cexprFvS) where

import qualified Data.Set as Set
import qualified Data.Map as Map
import UHC.Light.Compiler.Base.Common
import UHC.Light.Compiler.Base.HsName.Builtin
import UHC.Light.Compiler.Core
import UHC.Light.Compiler.Ty







cexprFvS :: CExpr -> FvS
cexprFvS e
  =  let  t = wrap_CodeAGItf (sem_CodeAGItf (CodeAGItf_AGItf (mkCMod e))) Inh_CodeAGItf
     in   fvS_Syn_CodeAGItf t

-- CAlt --------------------------------------------------------
{-
   visit 0:
      synthesized attribute:
         fvS                  : FvS
   alternatives:
      alternative Alt:
         child pat            : CPat 
         child expr           : CExpr 
         visit 0:
            local fvS         : _
-}
-- cata
sem_CAlt :: CAlt ->
            T_CAlt
sem_CAlt (CAlt_Alt _pat _expr) =
    (sem_CAlt_Alt (sem_CPat _pat) (sem_CExpr _expr))
-- semantic domain
type T_CAlt = ( FvS)
sem_CAlt_Alt :: T_CPat ->
                T_CExpr ->
                T_CAlt
sem_CAlt_Alt pat_ expr_ =
    (case (expr_) of
     { ( _exprIfvS) ->
         (case (pat_) of
          { ( _patIfldNmL,_patIfvS,_patInmL) ->
              (case (_exprIfvS `Set.difference` Set.fromList _patInmL) of
               { _fvS ->
               (case (_fvS) of
                { _lhsOfvS ->
                ( _lhsOfvS) }) }) }) })
-- CAltL -------------------------------------------------------
{-
   visit 0:
      synthesized attribute:
         fvS                  : FvS
   alternatives:
      alternative Cons:
         child hd             : CAlt 
         child tl             : CAltL 
      alternative Nil:
-}
-- cata
sem_CAltL :: CAltL ->
             T_CAltL
sem_CAltL list =
    (Prelude.foldr sem_CAltL_Cons sem_CAltL_Nil (Prelude.map sem_CAlt list))
-- semantic domain
type T_CAltL = ( FvS)
sem_CAltL_Cons :: T_CAlt ->
                  T_CAltL ->
                  T_CAltL
sem_CAltL_Cons hd_ tl_ =
    (case (tl_) of
     { ( _tlIfvS) ->
         (case (hd_) of
          { ( _hdIfvS) ->
              (case (_hdIfvS `Set.union` _tlIfvS) of
               { _lhsOfvS ->
               ( _lhsOfvS) }) }) })
sem_CAltL_Nil :: T_CAltL
sem_CAltL_Nil =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
-- CBind -------------------------------------------------------
{-
   visit 0:
      synthesized attributes:
         fvS                  : FvS
         fvSMp                : FvSMp
         nm                   : HsName
         nmL                  : [HsName]
   alternatives:
      alternative Bind:
         child nm             : {HsName}
         child bindAspects    : CBoundL 
-}
-- cata
sem_CBind :: CBind ->
             T_CBind
sem_CBind (CBind_Bind _nm _bindAspects) =
    (sem_CBind_Bind _nm (sem_CBoundL _bindAspects))
-- semantic domain
type T_CBind = ( FvS,FvSMp,HsName,([HsName]))
sem_CBind_Bind :: HsName ->
                  T_CBoundL ->
                  T_CBind
sem_CBind_Bind nm_ bindAspects_ =
    (case (nm_) of
     { _bindAspectsOnm ->
     (case (bindAspects_ _bindAspectsOnm) of
      { ( _bindAspectsIfvS,_bindAspectsIfvSMp,_bindAspectsInmL) ->
          (case (_bindAspectsIfvS) of
           { _lhsOfvS ->
           (case (Map.singleton nm_ _bindAspectsIfvS) of
            { _lhsOfvSMp ->
            (case (nm_) of
             { _lhsOnm ->
             (case ([nm_]) of
              { _lhsOnmL ->
              ( _lhsOfvS,_lhsOfvSMp,_lhsOnm,_lhsOnmL) }) }) }) }) }) })
-- CBindAnn ----------------------------------------------------
{-
   visit 0:
      synthesized attributes:
         fvS                  : FvS
         nmL                  : [HsName]
   alternatives:
      alternative Coe:
         child coe            : {()}
-}
-- cata
sem_CBindAnn :: CBindAnn ->
                T_CBindAnn
sem_CBindAnn (CBindAnn_Coe _coe) =
    (sem_CBindAnn_Coe _coe)
-- semantic domain
type T_CBindAnn = ( FvS,([HsName]))
sem_CBindAnn_Coe :: (()) ->
                    T_CBindAnn
sem_CBindAnn_Coe coe_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     (case ([]) of
      { _lhsOnmL ->
      ( _lhsOfvS,_lhsOnmL) }) })
-- CBindAnnL ---------------------------------------------------
{-
   visit 0:
      synthesized attributes:
         fvS                  : FvS
         nmL                  : [HsName]
   alternatives:
      alternative Cons:
         child hd             : CBindAnn 
         child tl             : CBindAnnL 
      alternative Nil:
-}
-- cata
sem_CBindAnnL :: CBindAnnL ->
                 T_CBindAnnL
sem_CBindAnnL list =
    (Prelude.foldr sem_CBindAnnL_Cons sem_CBindAnnL_Nil (Prelude.map sem_CBindAnn list))
-- semantic domain
type T_CBindAnnL = ( FvS,([HsName]))
sem_CBindAnnL_Cons :: T_CBindAnn ->
                      T_CBindAnnL ->
                      T_CBindAnnL
sem_CBindAnnL_Cons hd_ tl_ =
    (case (tl_) of
     { ( _tlIfvS,_tlInmL) ->
         (case (hd_) of
          { ( _hdIfvS,_hdInmL) ->
              (case (_hdIfvS `Set.union` _tlIfvS) of
               { _lhsOfvS ->
               (case (_hdInmL ++ _tlInmL) of
                { _lhsOnmL ->
                ( _lhsOfvS,_lhsOnmL) }) }) }) })
sem_CBindAnnL_Nil :: T_CBindAnnL
sem_CBindAnnL_Nil =
    (case (Set.empty) of
     { _lhsOfvS ->
     (case ([]) of
      { _lhsOnmL ->
      ( _lhsOfvS,_lhsOnmL) }) })
-- CBindL ------------------------------------------------------
{-
   visit 0:
      synthesized attributes:
         fvS                  : FvS
         fvSMp                : FvSMp
         nmL                  : [HsName]
   alternatives:
      alternative Cons:
         child hd             : CBind 
         child tl             : CBindL 
      alternative Nil:
-}
-- cata
sem_CBindL :: CBindL ->
              T_CBindL
sem_CBindL list =
    (Prelude.foldr sem_CBindL_Cons sem_CBindL_Nil (Prelude.map sem_CBind list))
-- semantic domain
type T_CBindL = ( FvS,FvSMp,([HsName]))
sem_CBindL_Cons :: T_CBind ->
                   T_CBindL ->
                   T_CBindL
sem_CBindL_Cons hd_ tl_ =
    (case (tl_) of
     { ( _tlIfvS,_tlIfvSMp,_tlInmL) ->
         (case (hd_) of
          { ( _hdIfvS,_hdIfvSMp,_hdInm,_hdInmL) ->
              (case (_hdIfvS `Set.union` _tlIfvS) of
               { _lhsOfvS ->
               (case (_hdIfvSMp `Map.union` _tlIfvSMp) of
                { _lhsOfvSMp ->
                (case (_hdInmL ++ _tlInmL) of
                 { _lhsOnmL ->
                 ( _lhsOfvS,_lhsOfvSMp,_lhsOnmL) }) }) }) }) })
sem_CBindL_Nil :: T_CBindL
sem_CBindL_Nil =
    (case (Set.empty) of
     { _lhsOfvS ->
     (case (Map.empty) of
      { _lhsOfvSMp ->
      (case ([]) of
       { _lhsOnmL ->
       ( _lhsOfvS,_lhsOfvSMp,_lhsOnmL) }) }) })
-- CBound ------------------------------------------------------
{-
   visit 0:
      inherited attribute:
         nm                   : HsName
      synthesized attributes:
         fvS                  : FvS
         fvSMp                : FvSMp
         nmL                  : [HsName]
   alternatives:
      alternative Bind:
         child expr           : CExpr 
      alternative Val:
         child aspectKeyS     : {ACoreBindAspectKeyS}
         child mlev           : {MetaLev}
         child lbl            : {CLbl}
         child expr           : CExpr 
      alternative Ty:
         child aspectKeyS     : {ACoreBindAspectKeyS}
         child ty             : {Ty}
      alternative FFE:
         child callconv       : {FFIWay}
         child expEnt         : {ForeignEnt}
         child expr           : CExpr 
         child ty             : {Ty}
-}
-- cata
sem_CBound :: CBound ->
              T_CBound
sem_CBound (CBound_Bind _expr) =
    (sem_CBound_Bind (sem_CExpr _expr))
sem_CBound (CBound_Val _aspectKeyS _mlev _lbl _expr) =
    (sem_CBound_Val _aspectKeyS _mlev _lbl (sem_CExpr _expr))
sem_CBound (CBound_Ty _aspectKeyS _ty) =
    (sem_CBound_Ty _aspectKeyS _ty)
sem_CBound (CBound_FFE _callconv _expEnt _expr _ty) =
    (sem_CBound_FFE _callconv _expEnt (sem_CExpr _expr) _ty)
-- semantic domain
type T_CBound = HsName ->
                ( FvS,FvSMp,([HsName]))
sem_CBound_Bind :: T_CExpr ->
                   T_CBound
sem_CBound_Bind expr_ =
    (\ _lhsInm ->
         (case (expr_) of
          { ( _exprIfvS) ->
              (case (_exprIfvS) of
               { _lhsOfvS ->
               (case (Map.empty) of
                { _lhsOfvSMp ->
                (case ([]) of
                 { _lhsOnmL ->
                 ( _lhsOfvS,_lhsOfvSMp,_lhsOnmL) }) }) }) }))
sem_CBound_Val :: ACoreBindAspectKeyS ->
                  MetaLev ->
                  CLbl ->
                  T_CExpr ->
                  T_CBound
sem_CBound_Val aspectKeyS_ mlev_ lbl_ expr_ =
    (\ _lhsInm ->
         (case (expr_) of
          { ( _exprIfvS) ->
              (case (_exprIfvS) of
               { _lhsOfvS ->
               (case (Map.empty) of
                { _lhsOfvSMp ->
                (case ([]) of
                 { _lhsOnmL ->
                 ( _lhsOfvS,_lhsOfvSMp,_lhsOnmL) }) }) }) }))
sem_CBound_Ty :: ACoreBindAspectKeyS ->
                 Ty ->
                 T_CBound
sem_CBound_Ty aspectKeyS_ ty_ =
    (\ _lhsInm ->
         (case (Set.empty) of
          { _lhsOfvS ->
          (case (Map.empty) of
           { _lhsOfvSMp ->
           (case ([]) of
            { _lhsOnmL ->
            ( _lhsOfvS,_lhsOfvSMp,_lhsOnmL) }) }) }))
sem_CBound_FFE :: FFIWay ->
                  ForeignEnt ->
                  T_CExpr ->
                  Ty ->
                  T_CBound
sem_CBound_FFE callconv_ expEnt_ expr_ ty_ =
    (\ _lhsInm ->
         (case (expr_) of
          { ( _exprIfvS) ->
              (case (_exprIfvS) of
               { _lhsOfvS ->
               (case (Map.empty) of
                { _lhsOfvSMp ->
                (case ([]) of
                 { _lhsOnmL ->
                 ( _lhsOfvS,_lhsOfvSMp,_lhsOnmL) }) }) }) }))
-- CBoundL -----------------------------------------------------
{-
   visit 0:
      inherited attribute:
         nm                   : HsName
      synthesized attributes:
         fvS                  : FvS
         fvSMp                : FvSMp
         nmL                  : [HsName]
   alternatives:
      alternative Cons:
         child hd             : CBound 
         child tl             : CBoundL 
      alternative Nil:
-}
-- cata
sem_CBoundL :: CBoundL ->
               T_CBoundL
sem_CBoundL list =
    (Prelude.foldr sem_CBoundL_Cons sem_CBoundL_Nil (Prelude.map sem_CBound list))
-- semantic domain
type T_CBoundL = HsName ->
                 ( FvS,FvSMp,([HsName]))
sem_CBoundL_Cons :: T_CBound ->
                    T_CBoundL ->
                    T_CBoundL
sem_CBoundL_Cons hd_ tl_ =
    (\ _lhsInm ->
         (case (_lhsInm) of
          { _tlOnm ->
          (case (tl_ _tlOnm) of
           { ( _tlIfvS,_tlIfvSMp,_tlInmL) ->
               (case (_lhsInm) of
                { _hdOnm ->
                (case (hd_ _hdOnm) of
                 { ( _hdIfvS,_hdIfvSMp,_hdInmL) ->
                     (case (_hdIfvS `Set.union` _tlIfvS) of
                      { _lhsOfvS ->
                      (case (_hdIfvSMp `Map.union` _tlIfvSMp) of
                       { _lhsOfvSMp ->
                       (case (_hdInmL ++ _tlInmL) of
                        { _lhsOnmL ->
                        ( _lhsOfvS,_lhsOfvSMp,_lhsOnmL) }) }) }) }) }) }) }))
sem_CBoundL_Nil :: T_CBoundL
sem_CBoundL_Nil =
    (\ _lhsInm ->
         (case (Set.empty) of
          { _lhsOfvS ->
          (case (Map.empty) of
           { _lhsOfvSMp ->
           (case ([]) of
            { _lhsOnmL ->
            ( _lhsOfvS,_lhsOfvSMp,_lhsOnmL) }) }) }))
-- CDataCon ----------------------------------------------------
{-
   alternatives:
      alternative Con:
         child conNm          : {HsName}
         child tagNr          : {Int}
         child arity          : {Int}
-}
-- cata
sem_CDataCon :: CDataCon ->
                T_CDataCon
sem_CDataCon (CDataCon_Con _conNm _tagNr _arity) =
    (sem_CDataCon_Con _conNm _tagNr _arity)
-- semantic domain
type T_CDataCon = ( )
sem_CDataCon_Con :: HsName ->
                    Int ->
                    Int ->
                    T_CDataCon
sem_CDataCon_Con conNm_ tagNr_ arity_ =
    ( )
-- CDataConL ---------------------------------------------------
{-
   alternatives:
      alternative Cons:
         child hd             : CDataCon 
         child tl             : CDataConL 
      alternative Nil:
-}
-- cata
sem_CDataConL :: CDataConL ->
                 T_CDataConL
sem_CDataConL list =
    (Prelude.foldr sem_CDataConL_Cons sem_CDataConL_Nil (Prelude.map sem_CDataCon list))
-- semantic domain
type T_CDataConL = ( )
sem_CDataConL_Cons :: T_CDataCon ->
                      T_CDataConL ->
                      T_CDataConL
sem_CDataConL_Cons hd_ tl_ =
    ( )
sem_CDataConL_Nil :: T_CDataConL
sem_CDataConL_Nil =
    ( )
-- CDeclMeta ---------------------------------------------------
{-
   alternatives:
      alternative Data:
         child tyNm           : {HsName}
         child dataCons       : CDataConL 
-}
-- cata
sem_CDeclMeta :: CDeclMeta ->
                 T_CDeclMeta
sem_CDeclMeta (CDeclMeta_Data _tyNm _dataCons) =
    (sem_CDeclMeta_Data _tyNm (sem_CDataConL _dataCons))
-- semantic domain
type T_CDeclMeta = ( )
sem_CDeclMeta_Data :: HsName ->
                      T_CDataConL ->
                      T_CDeclMeta
sem_CDeclMeta_Data tyNm_ dataCons_ =
    ( )
-- CDeclMetaL --------------------------------------------------
{-
   alternatives:
      alternative Cons:
         child hd             : CDeclMeta 
         child tl             : CDeclMetaL 
      alternative Nil:
-}
-- cata
sem_CDeclMetaL :: CDeclMetaL ->
                  T_CDeclMetaL
sem_CDeclMetaL list =
    (Prelude.foldr sem_CDeclMetaL_Cons sem_CDeclMetaL_Nil (Prelude.map sem_CDeclMeta list))
-- semantic domain
type T_CDeclMetaL = ( )
sem_CDeclMetaL_Cons :: T_CDeclMeta ->
                       T_CDeclMetaL ->
                       T_CDeclMetaL
sem_CDeclMetaL_Cons hd_ tl_ =
    ( )
sem_CDeclMetaL_Nil :: T_CDeclMetaL
sem_CDeclMetaL_Nil =
    ( )
-- CExport -----------------------------------------------------
{-
   alternatives:
      alternative Export:
         child nm             : {HsName}
      alternative ExportData:
         child nm             : {HsName}
         child mbConNmL       : {Maybe [HsName]}
-}
-- cata
sem_CExport :: CExport ->
               T_CExport
sem_CExport (CExport_Export _nm) =
    (sem_CExport_Export _nm)
sem_CExport (CExport_ExportData _nm _mbConNmL) =
    (sem_CExport_ExportData _nm _mbConNmL)
-- semantic domain
type T_CExport = ( )
sem_CExport_Export :: HsName ->
                      T_CExport
sem_CExport_Export nm_ =
    ( )
sem_CExport_ExportData :: HsName ->
                          (Maybe [HsName]) ->
                          T_CExport
sem_CExport_ExportData nm_ mbConNmL_ =
    ( )
-- CExportL ----------------------------------------------------
{-
   alternatives:
      alternative Cons:
         child hd             : CExport 
         child tl             : CExportL 
      alternative Nil:
-}
-- cata
sem_CExportL :: CExportL ->
                T_CExportL
sem_CExportL list =
    (Prelude.foldr sem_CExportL_Cons sem_CExportL_Nil (Prelude.map sem_CExport list))
-- semantic domain
type T_CExportL = ( )
sem_CExportL_Cons :: T_CExport ->
                     T_CExportL ->
                     T_CExportL
sem_CExportL_Cons hd_ tl_ =
    ( )
sem_CExportL_Nil :: T_CExportL
sem_CExportL_Nil =
    ( )
-- CExpr -------------------------------------------------------
{-
   visit 0:
      synthesized attribute:
         fvS                  : FvS
   alternatives:
      alternative Var:
         child ref            : {ACoreBindRef}
         visit 0:
            local nm          : {HsName}
      alternative Int:
         child int            : {Int}
      alternative Char:
         child char           : {Char}
      alternative String:
         child str            : {String}
      alternative Integer:
         child integer        : {Integer}
      alternative Tup:
         child tag            : {CTag}
      alternative Let:
         child categ          : {CBindCateg}
         child binds          : CBindL 
         child body           : CExpr 
         visit 0:
            local fvS         : _
      alternative App:
         child func           : CExpr 
         child arg            : CBound 
         visit 0:
            local fvS         : _
      alternative Lam:
         child bind           : CBind 
         child body           : CExpr 
         visit 0:
            local argNm       : _
            local fvS         : _
      alternative Case:
         child expr           : CExpr 
         child alts           : CAltL 
         child dflt           : CExpr 
      alternative CaseAltFail:
         child failReason     : {CaseAltFailReason}
         child errorExpr      : CExpr 
      alternative TupDel:
         child expr           : CExpr 
         child tag            : {CTag}
         child nm             : {HsName}
         child offset         : CExpr 
      alternative TupIns:
         child expr           : CExpr 
         child tag            : {CTag}
         child nm             : {HsName}
         child offset         : CExpr 
         child fldExpr        : CExpr 
      alternative TupUpd:
         child expr           : CExpr 
         child tag            : {CTag}
         child nm             : {HsName}
         child offset         : CExpr 
         child fldExpr        : CExpr 
      alternative FFI:
         child callconv       : {FFIWay}
         child safety         : {String}
         child impEnt         : {ForeignEnt}
         child ty             : {Ty}
      alternative Dbg:
         child info           : {String}
      alternative Hole:
         child uid            : {UID}
      alternative HoleLet:
         child bindsUid       : {UID}
         child body           : CExpr 
      alternative CoeArg:
      alternative ImplsApp:
         child func           : CExpr 
         child uid            : {ImplsVarId}
      alternative ImplsLam:
         child uid            : {ImplsVarId}
         child body           : CExpr 
      alternative Ann:
         child ann            : CExprAnn 
         child expr           : CExpr 
-}
-- cata
sem_CExpr :: CExpr ->
             T_CExpr
sem_CExpr (CExpr_Var _ref) =
    (sem_CExpr_Var _ref)
sem_CExpr (CExpr_Int _int) =
    (sem_CExpr_Int _int)
sem_CExpr (CExpr_Char _char) =
    (sem_CExpr_Char _char)
sem_CExpr (CExpr_String _str) =
    (sem_CExpr_String _str)
sem_CExpr (CExpr_Integer _integer) =
    (sem_CExpr_Integer _integer)
sem_CExpr (CExpr_Tup _tag) =
    (sem_CExpr_Tup _tag)
sem_CExpr (CExpr_Let _categ _binds _body) =
    (sem_CExpr_Let _categ (sem_CBindL _binds) (sem_CExpr _body))
sem_CExpr (CExpr_App _func _arg) =
    (sem_CExpr_App (sem_CExpr _func) (sem_CBound _arg))
sem_CExpr (CExpr_Lam _bind _body) =
    (sem_CExpr_Lam (sem_CBind _bind) (sem_CExpr _body))
sem_CExpr (CExpr_Case _expr _alts _dflt) =
    (sem_CExpr_Case (sem_CExpr _expr) (sem_CAltL _alts) (sem_CExpr _dflt))
sem_CExpr (CExpr_CaseAltFail _failReason _errorExpr) =
    (sem_CExpr_CaseAltFail _failReason (sem_CExpr _errorExpr))
sem_CExpr (CExpr_TupDel _expr _tag _nm _offset) =
    (sem_CExpr_TupDel (sem_CExpr _expr) _tag _nm (sem_CExpr _offset))
sem_CExpr (CExpr_TupIns _expr _tag _nm _offset _fldExpr) =
    (sem_CExpr_TupIns (sem_CExpr _expr) _tag _nm (sem_CExpr _offset) (sem_CExpr _fldExpr))
sem_CExpr (CExpr_TupUpd _expr _tag _nm _offset _fldExpr) =
    (sem_CExpr_TupUpd (sem_CExpr _expr) _tag _nm (sem_CExpr _offset) (sem_CExpr _fldExpr))
sem_CExpr (CExpr_FFI _callconv _safety _impEnt _ty) =
    (sem_CExpr_FFI _callconv _safety _impEnt _ty)
sem_CExpr (CExpr_Dbg _info) =
    (sem_CExpr_Dbg _info)
sem_CExpr (CExpr_Hole _uid) =
    (sem_CExpr_Hole _uid)
sem_CExpr (CExpr_HoleLet _bindsUid _body) =
    (sem_CExpr_HoleLet _bindsUid (sem_CExpr _body))
sem_CExpr (CExpr_CoeArg) =
    (sem_CExpr_CoeArg)
sem_CExpr (CExpr_ImplsApp _func _uid) =
    (sem_CExpr_ImplsApp (sem_CExpr _func) _uid)
sem_CExpr (CExpr_ImplsLam _uid _body) =
    (sem_CExpr_ImplsLam _uid (sem_CExpr _body))
sem_CExpr (CExpr_Ann _ann _expr) =
    (sem_CExpr_Ann (sem_CExprAnn _ann) (sem_CExpr _expr))
-- semantic domain
type T_CExpr = ( FvS)
sem_CExpr_Var :: ACoreBindRef ->
                 T_CExpr
sem_CExpr_Var ref_ =
    (case (acbrefNm ref_) of
     { _nm ->
     (case (Set.singleton _nm) of
      { _lhsOfvS ->
      ( _lhsOfvS) }) })
sem_CExpr_Int :: Int ->
                 T_CExpr
sem_CExpr_Int int_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
sem_CExpr_Char :: Char ->
                  T_CExpr
sem_CExpr_Char char_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
sem_CExpr_String :: String ->
                    T_CExpr
sem_CExpr_String str_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
sem_CExpr_Integer :: Integer ->
                     T_CExpr
sem_CExpr_Integer integer_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
sem_CExpr_Tup :: CTag ->
                 T_CExpr
sem_CExpr_Tup tag_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
sem_CExpr_Let :: CBindCateg ->
                 T_CBindL ->
                 T_CExpr ->
                 T_CExpr
sem_CExpr_Let categ_ binds_ body_ =
    (case (body_) of
     { ( _bodyIfvS) ->
         (case (binds_) of
          { ( _bindsIfvS,_bindsIfvSMp,_bindsInmL) ->
              (case ((_bodyIfvS `Set.union` _bindsIfvS) `Set.difference` Set.fromList _bindsInmL) of
               { _fvS ->
               (case (_fvS) of
                { _lhsOfvS ->
                ( _lhsOfvS) }) }) }) })
sem_CExpr_App :: T_CExpr ->
                 T_CBound ->
                 T_CExpr
sem_CExpr_App func_ arg_ =
    (case (hsnUnknown) of
     { _argOnm ->
     (case (arg_ _argOnm) of
      { ( _argIfvS,_argIfvSMp,_argInmL) ->
          (case (func_) of
           { ( _funcIfvS) ->
               (case (_funcIfvS `Set.union` _argIfvS) of
                { _fvS ->
                (case (_fvS) of
                 { _lhsOfvS ->
                 ( _lhsOfvS) }) }) }) }) })
sem_CExpr_Lam :: T_CBind ->
                 T_CExpr ->
                 T_CExpr
sem_CExpr_Lam bind_ body_ =
    (case (bind_) of
     { ( _bindIfvS,_bindIfvSMp,_bindInm,_bindInmL) ->
         (case (_bindInm) of
          { _argNm ->
          (case (body_) of
           { ( _bodyIfvS) ->
               (case (_argNm `Set.delete` _bodyIfvS) of
                { _fvS ->
                (case (_fvS) of
                 { _lhsOfvS ->
                 ( _lhsOfvS) }) }) }) }) })
sem_CExpr_Case :: T_CExpr ->
                  T_CAltL ->
                  T_CExpr ->
                  T_CExpr
sem_CExpr_Case expr_ alts_ dflt_ =
    (case (dflt_) of
     { ( _dfltIfvS) ->
         (case (alts_) of
          { ( _altsIfvS) ->
              (case (expr_) of
               { ( _exprIfvS) ->
                   (case (_exprIfvS `Set.union` _altsIfvS `Set.union` _dfltIfvS) of
                    { _lhsOfvS ->
                    ( _lhsOfvS) }) }) }) })
sem_CExpr_CaseAltFail :: CaseAltFailReason ->
                         T_CExpr ->
                         T_CExpr
sem_CExpr_CaseAltFail failReason_ errorExpr_ =
    (case (errorExpr_) of
     { ( _errorExprIfvS) ->
         (case (_errorExprIfvS) of
          { _lhsOfvS ->
          ( _lhsOfvS) }) })
sem_CExpr_TupDel :: T_CExpr ->
                    CTag ->
                    HsName ->
                    T_CExpr ->
                    T_CExpr
sem_CExpr_TupDel expr_ tag_ nm_ offset_ =
    (case (offset_) of
     { ( _offsetIfvS) ->
         (case (expr_) of
          { ( _exprIfvS) ->
              (case (_exprIfvS `Set.union` _offsetIfvS) of
               { _lhsOfvS ->
               ( _lhsOfvS) }) }) })
sem_CExpr_TupIns :: T_CExpr ->
                    CTag ->
                    HsName ->
                    T_CExpr ->
                    T_CExpr ->
                    T_CExpr
sem_CExpr_TupIns expr_ tag_ nm_ offset_ fldExpr_ =
    (case (fldExpr_) of
     { ( _fldExprIfvS) ->
         (case (offset_) of
          { ( _offsetIfvS) ->
              (case (expr_) of
               { ( _exprIfvS) ->
                   (case (_exprIfvS `Set.union` _offsetIfvS `Set.union` _fldExprIfvS) of
                    { _lhsOfvS ->
                    ( _lhsOfvS) }) }) }) })
sem_CExpr_TupUpd :: T_CExpr ->
                    CTag ->
                    HsName ->
                    T_CExpr ->
                    T_CExpr ->
                    T_CExpr
sem_CExpr_TupUpd expr_ tag_ nm_ offset_ fldExpr_ =
    (case (fldExpr_) of
     { ( _fldExprIfvS) ->
         (case (offset_) of
          { ( _offsetIfvS) ->
              (case (expr_) of
               { ( _exprIfvS) ->
                   (case (_exprIfvS `Set.union` _offsetIfvS `Set.union` _fldExprIfvS) of
                    { _lhsOfvS ->
                    ( _lhsOfvS) }) }) }) })
sem_CExpr_FFI :: FFIWay ->
                 String ->
                 ForeignEnt ->
                 Ty ->
                 T_CExpr
sem_CExpr_FFI callconv_ safety_ impEnt_ ty_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
sem_CExpr_Dbg :: String ->
                 T_CExpr
sem_CExpr_Dbg info_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
sem_CExpr_Hole :: UID ->
                  T_CExpr
sem_CExpr_Hole uid_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
sem_CExpr_HoleLet :: UID ->
                     T_CExpr ->
                     T_CExpr
sem_CExpr_HoleLet bindsUid_ body_ =
    (case (body_) of
     { ( _bodyIfvS) ->
         (case (_bodyIfvS) of
          { _lhsOfvS ->
          ( _lhsOfvS) }) })
sem_CExpr_CoeArg :: T_CExpr
sem_CExpr_CoeArg =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
sem_CExpr_ImplsApp :: T_CExpr ->
                      ImplsVarId ->
                      T_CExpr
sem_CExpr_ImplsApp func_ uid_ =
    (case (func_) of
     { ( _funcIfvS) ->
         (case (_funcIfvS) of
          { _lhsOfvS ->
          ( _lhsOfvS) }) })
sem_CExpr_ImplsLam :: ImplsVarId ->
                      T_CExpr ->
                      T_CExpr
sem_CExpr_ImplsLam uid_ body_ =
    (case (body_) of
     { ( _bodyIfvS) ->
         (case (_bodyIfvS) of
          { _lhsOfvS ->
          ( _lhsOfvS) }) })
sem_CExpr_Ann :: T_CExprAnn ->
                 T_CExpr ->
                 T_CExpr
sem_CExpr_Ann ann_ expr_ =
    (case (expr_) of
     { ( _exprIfvS) ->
         (case (ann_) of
          { ( _annIfvS) ->
              (case (_annIfvS `Set.union` _exprIfvS) of
               { _lhsOfvS ->
               ( _lhsOfvS) }) }) })
-- CExprAnn ----------------------------------------------------
{-
   visit 0:
      synthesized attribute:
         fvS                  : FvS
   alternatives:
      alternative Ty:
         child ty             : {Ty}
      alternative Debug:
         child info           : {String}
-}
-- cata
sem_CExprAnn :: CExprAnn ->
                T_CExprAnn
sem_CExprAnn (CExprAnn_Ty _ty) =
    (sem_CExprAnn_Ty _ty)
sem_CExprAnn (CExprAnn_Debug _info) =
    (sem_CExprAnn_Debug _info)
-- semantic domain
type T_CExprAnn = ( FvS)
sem_CExprAnn_Ty :: Ty ->
                   T_CExprAnn
sem_CExprAnn_Ty ty_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
sem_CExprAnn_Debug :: String ->
                      T_CExprAnn
sem_CExprAnn_Debug info_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     ( _lhsOfvS) })
-- CImport -----------------------------------------------------
{-
   alternatives:
      alternative Import:
         child nm             : {HsName}
-}
-- cata
sem_CImport :: CImport ->
               T_CImport
sem_CImport (CImport_Import _nm) =
    (sem_CImport_Import _nm)
-- semantic domain
type T_CImport = ( )
sem_CImport_Import :: HsName ->
                      T_CImport
sem_CImport_Import nm_ =
    ( )
-- CImportL ----------------------------------------------------
{-
   alternatives:
      alternative Cons:
         child hd             : CImport 
         child tl             : CImportL 
      alternative Nil:
-}
-- cata
sem_CImportL :: CImportL ->
                T_CImportL
sem_CImportL list =
    (Prelude.foldr sem_CImportL_Cons sem_CImportL_Nil (Prelude.map sem_CImport list))
-- semantic domain
type T_CImportL = ( )
sem_CImportL_Cons :: T_CImport ->
                     T_CImportL ->
                     T_CImportL
sem_CImportL_Cons hd_ tl_ =
    ( )
sem_CImportL_Nil :: T_CImportL
sem_CImportL_Nil =
    ( )
-- CModule -----------------------------------------------------
{-
   visit 0:
      synthesized attribute:
         fvS                  : FvS
   alternatives:
      alternative Mod:
         child moduleNm       : {HsName}
         child exports        : CExportL 
         child imports        : CImportL 
         child declMetas      : CDeclMetaL 
         child expr           : CExpr 
-}
-- cata
sem_CModule :: CModule ->
               T_CModule
sem_CModule (CModule_Mod _moduleNm _exports _imports _declMetas _expr) =
    (sem_CModule_Mod _moduleNm (sem_CExportL _exports) (sem_CImportL _imports) (sem_CDeclMetaL _declMetas) (sem_CExpr _expr))
-- semantic domain
type T_CModule = ( FvS)
sem_CModule_Mod :: HsName ->
                   T_CExportL ->
                   T_CImportL ->
                   T_CDeclMetaL ->
                   T_CExpr ->
                   T_CModule
sem_CModule_Mod moduleNm_ exports_ imports_ declMetas_ expr_ =
    (case (expr_) of
     { ( _exprIfvS) ->
         (case (_exprIfvS) of
          { _lhsOfvS ->
          ( _lhsOfvS) }) })
-- CPat --------------------------------------------------------
{-
   visit 0:
      synthesized attributes:
         fldNmL               : [HsName]
         fvS                  : FvS
         nmL                  : [HsName]
   alternatives:
      alternative Var:
         child pnm            : {HsName}
      alternative Con:
         child tag            : {CTag}
         child rest           : CPatRest 
         child binds          : CPatFldL 
      alternative Int:
         child int            : {Int}
      alternative Char:
         child char           : {Char}
      alternative BoolExpr:
         child cexpr          : {CExpr}
-}
-- cata
sem_CPat :: CPat ->
            T_CPat
sem_CPat (CPat_Var _pnm) =
    (sem_CPat_Var _pnm)
sem_CPat (CPat_Con _tag _rest _binds) =
    (sem_CPat_Con _tag (sem_CPatRest _rest) (sem_CPatFldL _binds))
sem_CPat (CPat_Int _int) =
    (sem_CPat_Int _int)
sem_CPat (CPat_Char _char) =
    (sem_CPat_Char _char)
sem_CPat (CPat_BoolExpr _cexpr) =
    (sem_CPat_BoolExpr _cexpr)
-- semantic domain
type T_CPat = ( ([HsName]),FvS,([HsName]))
sem_CPat_Var :: HsName ->
                T_CPat
sem_CPat_Var pnm_ =
    (case ([]) of
     { _lhsOfldNmL ->
     (case (Set.empty) of
      { _lhsOfvS ->
      (case ([pnm_]) of
       { _lhsOnmL ->
       ( _lhsOfldNmL,_lhsOfvS,_lhsOnmL) }) }) })
sem_CPat_Con :: CTag ->
                T_CPatRest ->
                T_CPatFldL ->
                T_CPat
sem_CPat_Con tag_ rest_ binds_ =
    (case (binds_) of
     { ( _bindsIfldNmL,_bindsIfvS,_bindsInmL) ->
         (case (_bindsIfldNmL) of
          { _lhsOfldNmL ->
          (case (rest_) of
           { ( _restIfvS,_restInmL) ->
               (case (_restIfvS `Set.union` _bindsIfvS) of
                { _lhsOfvS ->
                (case (_restInmL ++ _bindsInmL) of
                 { _lhsOnmL ->
                 ( _lhsOfldNmL,_lhsOfvS,_lhsOnmL) }) }) }) }) })
sem_CPat_Int :: Int ->
                T_CPat
sem_CPat_Int int_ =
    (case ([]) of
     { _lhsOfldNmL ->
     (case (Set.empty) of
      { _lhsOfvS ->
      (case ([]) of
       { _lhsOnmL ->
       ( _lhsOfldNmL,_lhsOfvS,_lhsOnmL) }) }) })
sem_CPat_Char :: Char ->
                 T_CPat
sem_CPat_Char char_ =
    (case ([]) of
     { _lhsOfldNmL ->
     (case (Set.empty) of
      { _lhsOfvS ->
      (case ([]) of
       { _lhsOnmL ->
       ( _lhsOfldNmL,_lhsOfvS,_lhsOnmL) }) }) })
sem_CPat_BoolExpr :: CExpr ->
                     T_CPat
sem_CPat_BoolExpr cexpr_ =
    (case ([]) of
     { _lhsOfldNmL ->
     (case (Set.empty) of
      { _lhsOfvS ->
      (case ([]) of
       { _lhsOnmL ->
       ( _lhsOfldNmL,_lhsOfvS,_lhsOnmL) }) }) })
-- CPatFld -----------------------------------------------------
{-
   visit 0:
      synthesized attributes:
         fldNmL               : [HsName]
         fvS                  : FvS
         nmL                  : [HsName]
   alternatives:
      alternative Fld:
         child lbl            : {HsName}
         child offset         : CExpr 
         child bind           : CBind 
         child fldAnns        : CBindAnnL 
         visit 0:
            local fldNm       : _
-}
-- cata
sem_CPatFld :: CPatFld ->
               T_CPatFld
sem_CPatFld (CPatFld_Fld _lbl _offset _bind _fldAnns) =
    (sem_CPatFld_Fld _lbl (sem_CExpr _offset) (sem_CBind _bind) (sem_CBindAnnL _fldAnns))
-- semantic domain
type T_CPatFld = ( ([HsName]),FvS,([HsName]))
sem_CPatFld_Fld :: HsName ->
                   T_CExpr ->
                   T_CBind ->
                   T_CBindAnnL ->
                   T_CPatFld
sem_CPatFld_Fld lbl_ offset_ bind_ fldAnns_ =
    (case (bind_) of
     { ( _bindIfvS,_bindIfvSMp,_bindInm,_bindInmL) ->
         (case (_bindInm) of
          { _fldNm ->
          (case ([_fldNm]) of
           { _lhsOfldNmL ->
           (case (fldAnns_) of
            { ( _fldAnnsIfvS,_fldAnnsInmL) ->
                (case (offset_) of
                 { ( _offsetIfvS) ->
                     (case (_offsetIfvS `Set.union` _bindIfvS `Set.union` _fldAnnsIfvS) of
                      { _lhsOfvS ->
                      (case ([_fldNm]) of
                       { _lhsOnmL ->
                       ( _lhsOfldNmL,_lhsOfvS,_lhsOnmL) }) }) }) }) }) }) })
-- CPatFldL ----------------------------------------------------
{-
   visit 0:
      synthesized attributes:
         fldNmL               : [HsName]
         fvS                  : FvS
         nmL                  : [HsName]
   alternatives:
      alternative Cons:
         child hd             : CPatFld 
         child tl             : CPatFldL 
      alternative Nil:
-}
-- cata
sem_CPatFldL :: CPatFldL ->
                T_CPatFldL
sem_CPatFldL list =
    (Prelude.foldr sem_CPatFldL_Cons sem_CPatFldL_Nil (Prelude.map sem_CPatFld list))
-- semantic domain
type T_CPatFldL = ( ([HsName]),FvS,([HsName]))
sem_CPatFldL_Cons :: T_CPatFld ->
                     T_CPatFldL ->
                     T_CPatFldL
sem_CPatFldL_Cons hd_ tl_ =
    (case (tl_) of
     { ( _tlIfldNmL,_tlIfvS,_tlInmL) ->
         (case (hd_) of
          { ( _hdIfldNmL,_hdIfvS,_hdInmL) ->
              (case (_hdIfldNmL ++ _tlIfldNmL) of
               { _lhsOfldNmL ->
               (case (_hdIfvS `Set.union` _tlIfvS) of
                { _lhsOfvS ->
                (case (_hdInmL ++ _tlInmL) of
                 { _lhsOnmL ->
                 ( _lhsOfldNmL,_lhsOfvS,_lhsOnmL) }) }) }) }) })
sem_CPatFldL_Nil :: T_CPatFldL
sem_CPatFldL_Nil =
    (case ([]) of
     { _lhsOfldNmL ->
     (case (Set.empty) of
      { _lhsOfvS ->
      (case ([]) of
       { _lhsOnmL ->
       ( _lhsOfldNmL,_lhsOfvS,_lhsOnmL) }) }) })
-- CPatRest ----------------------------------------------------
{-
   visit 0:
      synthesized attributes:
         fvS                  : FvS
         nmL                  : [HsName]
   alternatives:
      alternative Var:
         child nm             : {HsName}
      alternative Empty:
-}
-- cata
sem_CPatRest :: CPatRest ->
                T_CPatRest
sem_CPatRest (CPatRest_Var _nm) =
    (sem_CPatRest_Var _nm)
sem_CPatRest (CPatRest_Empty) =
    (sem_CPatRest_Empty)
-- semantic domain
type T_CPatRest = ( FvS,([HsName]))
sem_CPatRest_Var :: HsName ->
                    T_CPatRest
sem_CPatRest_Var nm_ =
    (case (Set.empty) of
     { _lhsOfvS ->
     (case ([nm_]) of
      { _lhsOnmL ->
      ( _lhsOfvS,_lhsOnmL) }) })
sem_CPatRest_Empty :: T_CPatRest
sem_CPatRest_Empty =
    (case (Set.empty) of
     { _lhsOfvS ->
     (case ([]) of
      { _lhsOnmL ->
      ( _lhsOfvS,_lhsOnmL) }) })
-- CodeAGItf ---------------------------------------------------
{-
   visit 0:
      synthesized attribute:
         fvS                  : FvS
   alternatives:
      alternative AGItf:
         child module         : CModule 
-}
-- cata
sem_CodeAGItf :: CodeAGItf ->
                 T_CodeAGItf
sem_CodeAGItf (CodeAGItf_AGItf _module) =
    (sem_CodeAGItf_AGItf (sem_CModule _module))
-- semantic domain
type T_CodeAGItf = ( FvS)
data Inh_CodeAGItf = Inh_CodeAGItf {}
data Syn_CodeAGItf = Syn_CodeAGItf {fvS_Syn_CodeAGItf :: !(FvS)}
wrap_CodeAGItf :: T_CodeAGItf ->
                  Inh_CodeAGItf ->
                  Syn_CodeAGItf
wrap_CodeAGItf sem (Inh_CodeAGItf) =
    (let ( _lhsOfvS) = sem
     in  (Syn_CodeAGItf _lhsOfvS))
sem_CodeAGItf_AGItf :: T_CModule ->
                       T_CodeAGItf
sem_CodeAGItf_AGItf module_ =
    (case (module_) of
     { ( _moduleIfvS) ->
         (case (_moduleIfvS) of
          { _lhsOfvS ->
          ( _lhsOfvS) }) })