<commit_before>{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}

-----------------------------------------------------------------------------
-- |
-- Module      :  XMonad.Layout.ThreeColumns
-- Copyright   :  (c) <NAME> <<EMAIL>>
-- License     :  BSD3-style (see LICENSE)
-- 
-- Maintainer  :  ?
-- Stability   :  unstable
-- Portability :  unportable
--
-- A layout similar to tall but with three columns.
--
-----------------------------------------------------------------------------

module XMonad.Layout.ThreeColumns (
                              -- * Usage
                              -- $usage
                              ThreeCol(..)
                             ) where

import XMonad
import qualified XMonad.StackSet as W
import XMonad.Layouts ( Resize(..), IncMasterN(..), splitVertically, splitHorizontallyBy )

import Data.Ratio

--import Control.Monad.State
import Control.Monad.Reader

import Graphics.X11.Xlib

-- $usage
--
-- You can use this module with the following in your Config.hs file:
--
-- > import XMonad.Layout.ThreeColumns
--
--  and add, to the list of layouts:
--
-- > ThreeCol nmaster delta ratio

-- %import XMonad.Layout.ThreeColumns
-- %layout , ThreeCol nmaster delta ratio

data ThreeCol a = ThreeCol Int Rational Rational deriving (Show,Read)

instance LayoutClass ThreeCol a where
    doLayout (ThreeCol nmaster _ frac) r =
        return . (\x->(x,Nothing)) .
        ap zip (tile3 frac r nmaster . length) . W.integrate
    handleMessage (ThreeCol nmaster delta frac) m =
        return $ msum [fmap resize     (fromMessage m)
                      ,fmap incmastern (fromMessage m)]<commit_msg>ThreeColumns: haddock docs<commit_after>{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}

-----------------------------------------------------------------------------
-- |
-- Module      :  XMonad.Layout.ThreeColumns
-- Copyright   :  (c) <NAME> <<EMAIL>>
-- License     :  BSD3-style (see LICENSE)
-- 
-- Maintainer  :  ?
-- Stability   :  unstable
-- Portability :  unportable
--
-- A layout similar to tall but with three columns.
--
-----------------------------------------------------------------------------

module XMonad.Layout.ThreeColumns (
                              -- * Usage
                              -- $usage
                              ThreeCol(..)
                             ) where

import XMonad
import qualified XMonad.StackSet as W
import XMonad.Layouts ( Resize(..), IncMasterN(..), splitVertically, splitHorizontallyBy )

import Data.Ratio

--import Control.Monad.State
import Control.Monad.Reader

import Graphics.X11.Xlib

-- $usage
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
--
-- > import XMonad.Layout.ThreeColumns
--
-- Then edit your @layoutHook@ by adding the ThreeCol layout:
--
-- > myLayouts = ThreeCol 1 (3/100) (1/2) False ||| etc..
-- > main = xmonad dafaultConfig { layoutHook = myLayouts }
--
-- Use @True@ as the last argument to get a wide layout.
--
-- For more detailed instructions on editing the layoutHook see:
--
-- "XMonad.Doc.Extending#Editing_the_layout_hook"

data ThreeCol a = ThreeCol Int Rational Rational deriving (Show,Read)

instance LayoutClass ThreeCol a where
    doLayout (ThreeCol nmaster _ frac) r =
        return . (\x->(x,Nothing)) .
        ap zip (tile3 frac r nmaster . length) . W.integrate
    handleMessage (ThreeCol nmaster delta frac) m =
        return $ msum [fmap resize     (fromMessage m)
                      ,fmap incmastern (fromMessage m)]
{'fraction_non_alphanumeric': 0.18919683257918551, 'fraction_numerical': 0.004242081447963801, 'mean_word_length': 1.6876899696048633, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1437235', 'n_tokens_mistral': 1005, 'n_tokens_neox': 982, 'n_words': 290}