<commit_before>{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  XMonad.hs
-- Copyright   :  (c) <NAME> 2007
-- License     :  BSD3-style (see LICENSE)
--
-- Maintainer  :  <EMAIL>
-- Stability   :  unstable
-- Portability :  not portable, uses cunning newtype deriving
--
-----------------------------------------------------------------------------
--
-- The X monad, a state monad transformer over IO, for the window
-- manager state, and support routines.
--

module XMonad (
    X, WindowSet, WorkspaceId(..), ScreenId(..), XState(..), XConf(..), Layout(..),
    LayoutDesc(..), runX, io, withDisplay, isRoot, spawn, trace, whenJust, rotateLayout
  ) where

import StackSet (StackSet)

import Control.Monad.State
import Control.Monad.Reader
import System.IO
import System.Posix.Process (executeFile, forkProcess, getProcessStatus)
import System.Exit
import Graphics.X11.Xlib

import qualified Data.Map as M

-- | XState, the window manager state.
-- Just the display, width, height and a window list
data XState = XState
    { workspace         :: !WindowSet                      -- ^ workspace list
    , layoutDescs       :: !(M.Map WorkspaceId LayoutDesc) -- ^ mapping of workspaces 
                                                           -- to descriptions of their layouts
    }

data XConf = XConf
    { display           :: Display                         -- ^ the X11 display

    , theRoot           :: !Window                         -- ^ the root window
    , wmdelete          :: !Atom                           -- ^ window deletion atom
    , wmprotocols       :: !Atom                           -- ^ wm protocols atom
    , dimensions        :: !(Int,Int)                      -- ^ dimensions of the screen, 
                                                           -- used for hiding windows

    , xineScreens       :: ![Rectangle]                    -- ^ dimensions of each screen
    , defaultLayoutDesc :: !LayoutDesc                     -- ^ default layout
    , normalBorder      :: !Color                         -- ^ border color of unfocused windows
    , focusedBorder     :: !Color                         -- ^ border color of the focused window
    }

type WindowSet = StackSet WorkspaceId ScreenId Window

-- | Virtual workspace indicies
newtype WorkspaceId = W Int deriving (Eq,Ord,Show,Enum,Num,Integral,Real)

-- | Physical screen indicies
newtype ScreenId    = S Int deriving (Eq,Ord,Show,Enum,Num,Integral,Real)<commit_msg>Comment only<commit_after>{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  XMonad.hs
-- Copyright   :  (c) <NAME> 2007
-- License     :  BSD3-style (see LICENSE)
--
-- Maintainer  :  <EMAIL>
-- Stability   :  unstable
-- Portability :  not portable, uses cunning newtype deriving
--
-----------------------------------------------------------------------------
--
-- The X monad, a state monad transformer over IO, for the window
-- manager state, and support routines.
--

module XMonad (
    X, WindowSet, WorkspaceId(..), ScreenId(..), XState(..), XConf(..), Layout(..),
    LayoutDesc(..), runX, io, withDisplay, isRoot, spawn, trace, whenJust, rotateLayout
  ) where

import StackSet (StackSet)

import Control.Monad.State
import Control.Monad.Reader
import System.IO
import System.Posix.Process (executeFile, forkProcess, getProcessStatus)
import System.Exit
import Graphics.X11.Xlib

import qualified Data.Map as M

-- | XState, the window manager state.
-- Just the display, width, height and a window list
data XState = XState
    { workspace         :: !WindowSet                      -- ^ workspace list
    , layoutDescs       :: !(M.Map WorkspaceId LayoutDesc) -- ^ mapping of workspaces 
                                                           -- to descriptions of their layouts
    }

data XConf = XConf
    { display           :: Display      -- ^ the X11 display

    , theRoot           :: !Window      -- ^ the root window
    , wmdelete          :: !Atom        -- ^ window deletion atom
    , wmprotocols       :: !Atom        -- ^ wm protocols atom
    , dimensions        :: !(Int,Int)   -- ^ dimensions of the screen,
                                        -- used for hiding windows

    , xineScreens       :: ![Rectangle] -- ^ dimensions of each screen
    , defaultLayoutDesc :: !LayoutDesc  -- ^ default layout
    , normalBorder      :: !Color       -- ^ border color of unfocused windows
    , focusedBorder     :: !Color       -- ^ border color of the focused window
    }

type WindowSet = StackSet WorkspaceId ScreenId Window

-- | Virtual workspace indicies
newtype WorkspaceId = W Int deriving (Eq,Ord,Show,Enum,Num,Integral,Real)

-- | Physical screen indicies
newtype ScreenId    = S Int deriving (Eq,Ord,Show,Enum,Num,Integral,Real)
{'fraction_non_alphanumeric': 0.1621841890790546, 'fraction_numerical': 0.003667481662591687, 'mean_word_length': 1.5823250920568122, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6828338', 'n_tokens_mistral': 1291, 'n_tokens_neox': 1233, 'n_words': 396}