-- | Adds to the DGEdgeType list style options for each type
edgeTypes :: HetcatsOpts
          -> [( DGEdgeType -- Edgetype
              , EdgePattern GA.EdgeValue -- Lineformat
              , String -- Color
              , Bool -- has conservativity
              )]
edgeTypes opts = map
  ( (\ (e, l, c) -> case edgeTypeModInc e of -- Add menu options
      ThmType { thmEdgeType = GlobalOrLocalThm _ _ } -> (e, l, c, True)
      GlobalDef -> (e, l, c, True)
      HetDef -> (e, l, c, True)
      LocalDef -> (e, l, c, True)
      _ -> (e, l, c, False)
    )
  . (\ (e, l) -> case edgeTypeModInc e of -- Add colors
      HidingDef -> (e, l, getColor opts Blue True $ not $ isInc e)
      FreeOrCofreeDef _ -> (e, l, getColor opts Blue False $ not $ isInc e)
      ThmType { thmEdgeType = thmType
              , isProvenEdge = False } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Coral True $ not $ isInc e)
        HidingThm -> (e, l, getColor opts Yellow False $ not $ isInc e)
        _ -> (e, l, getColor opts Coral False $ not $ isInc e)
      ThmType { thmEdgeType = thmType
              , isConservativ = False } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Yellow True $ not $ isInc e)
        _ -> (e, l, getColor opts Yellow False $ not $ isInc e)
      ThmType { thmEdgeType = thmType
              , isPending = True } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Yellow True $ not $ isInc e)
        _ -> (e, l, getColor opts Yellow False $ not $ isInc e)
      ThmType { thmEdgeType = thmType } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Green True $ not $ isInc e)
        HidingThm -> (e, l, getColor opts Green True $ not $ isInc e)
        _ -> (e, l, getColor opts Green False $ not $ isInc e)
      _ -> (e, l, getColor opts Black False $ not $ isInc e)
    )
  . (\ e -> case edgeTypeModInc e of -- Add lineformat
      ThmType { thmEdgeType = GlobalOrLocalThm { thmScope = Local
                                               , isHomThm = True } }
                   -> (e, Dashed)
      ThmType { thmEdgeType = GlobalOrLocalThm { isHomThm = False } }
                   -> (e, Double)
      LocalDef -> (e, Dashed)
      HetDef -> (e, Double)
      _ -> (e, Solid)
    )
  ) listDGEdgeTypes
edgeTypes :: HetcatsOpts
          -> [( DGEdgeType -- Edgetype
              , EdgePattern GA.EdgeValue -- Lineformat
              , String -- Color
              , Bool -- has conservativity
              )]
edgeTypes opts = map
  ( (\ (e, l, c) -> case edgeTypeModInc e of -- Add menu options
      ThmType { thmEdgeType = GlobalOrLocalThm _ _ } -> (e, l, c, True)
      GlobalDef -> (e, l, c, True)
      HetDef -> (e, l, c, True)
      LocalDef -> (e, l, c, True)
      _ -> (e, l, c, False)
    )
  . (\ (e, l) -> case edgeTypeModInc e of -- Add colors
      HidingDef -> (e, l, getColor opts Blue True $ not $ isInc e)
      FreeOrCofreeDef _ -> (e, l, getColor opts Blue False $ not $ isInc e)
      ThmType { thmEdgeType = thmType
              , isProvenEdge = False } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Coral True $ not $ isInc e)
        HidingThm -> (e, l, getColor opts Yellow False $ not $ isInc e)
        _ -> (e, l, getColor opts Coral False $ not $ isInc e)
      ThmType { thmEdgeType = thmType
              , isConservativ = False } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Yellow True $ not $ isInc e)
        _ -> (e, l, getColor opts Yellow False $ not $ isInc e)
      ThmType { thmEdgeType = thmType
              , isPending = True } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Yellow True $ not $ isInc e)
        _ -> (e, l, getColor opts Yellow False $ not $ isInc e)
      ThmType { thmEdgeType = thmType } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Green True $ not $ isInc e)
        HidingThm -> (e, l, getColor opts Green True $ not $ isInc e)
        _ -> (e, l, getColor opts Green False $ not $ isInc e)
      _ -> (e, l, getColor opts Black False $ not $ isInc e)
    )
  . (\ e -> case edgeTypeModInc e of -- Add lineformat
      ThmType { thmEdgeType = GlobalOrLocalThm { thmScope = Local
                                               , isHomThm = True } }
                   -> (e, Dashed)
      ThmType { thmEdgeType = GlobalOrLocalThm { isHomThm = False } }
                   -> (e, Double)
      LocalDef -> (e, Dashed)
      HetDef -> (e, Double)
      _ -> (e, Solid)
    )
  ) listDGEdgeTypes
edgeTypes opts = map
  ( (\ (e, l, c) -> case edgeTypeModInc e of -- Add menu options
      ThmType { thmEdgeType = GlobalOrLocalThm _ _ } -> (e, l, c, True)
      GlobalDef -> (e, l, c, True)
      HetDef -> (e, l, c, True)
      LocalDef -> (e, l, c, True)
      _ -> (e, l, c, False)
    )
  . (\ (e, l) -> case edgeTypeModInc e of -- Add colors
      HidingDef -> (e, l, getColor opts Blue True $ not $ isInc e)
      FreeOrCofreeDef _ -> (e, l, getColor opts Blue False $ not $ isInc e)
      ThmType { thmEdgeType = thmType
              , isProvenEdge = False } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Coral True $ not $ isInc e)
        HidingThm -> (e, l, getColor opts Yellow False $ not $ isInc e)
        _ -> (e, l, getColor opts Coral False $ not $ isInc e)
      ThmType { thmEdgeType = thmType
              , isConservativ = False } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Yellow True $ not $ isInc e)
        _ -> (e, l, getColor opts Yellow False $ not $ isInc e)
      ThmType { thmEdgeType = thmType
              , isPending = True } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Yellow True $ not $ isInc e)
        _ -> (e, l, getColor opts Yellow False $ not $ isInc e)
      ThmType { thmEdgeType = thmType } -> case thmType of
        GlobalOrLocalThm { thmScope = Local, isHomThm = False }
                      -> (e, l, getColor opts Green True $ not $ isInc e)
        HidingThm -> (e, l, getColor opts Green True $ not $ isInc e)
        _ -> (e, l, getColor opts Green False $ not $ isInc e)
      _ -> (e, l, getColor opts Black False $ not $ isInc e)
    )
  . (\ e -> case edgeTypeModInc e of -- Add lineformat
      ThmType { thmEdgeType = GlobalOrLocalThm { thmScope = Local
                                               , isHomThm = True } }
                   -> (e, Dashed)
      ThmType { thmEdgeType = GlobalOrLocalThm { isHomThm = False } }
                   -> (e, Double)
      LocalDef -> (e, Dashed)
      HetDef -> (e, Double)
      _ -> (e, Solid)
    )
  ) listDGEdgeTypes