{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TupleSections #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  XMonad.Layout.Simplest
-- Description :  A very simple layout.
-- Copyright   :  (c) 2007 Andrea Rossato
-- License     :  BSD-style (see xmonad/LICENSE)
--
-- Maintainer  :  andrea.rossato@unibz.it
-- Stability   :  unstable
-- Portability :  unportable
--
-- A very simple layout. The simplest, afaik.
-----------------------------------------------------------------------------

module XMonad.Layout.Simplest
    ( -- * Usage:
      -- $usage
      Simplest (..)
    ) where

import XMonad
import qualified XMonad.StackSet as S

-- $usage
-- You can use this module with the following in your
-- @xmonad.hs@:
--
-- > import XMonad.Layout.Simplest
--
-- Then edit your @layoutHook@ by adding the Simplest layout:
--
-- > myLayout = Simplest ||| Full ||| etc..
-- > main = xmonad def { layoutHook = myLayout }
--
-- For more detailed instructions on editing the layoutHook see
-- <https://xmonad.org/TUTORIAL.html#customizing-xmonad the tutorial> and
-- "XMonad.Doc.Extending#Editing_the_layout_hook".

data Simplest a = Simplest deriving (Int -> Simplest a -> ShowS
[Simplest a] -> ShowS
Simplest a -> String
(Int -> Simplest a -> ShowS)
-> (Simplest a -> String)
-> ([Simplest a] -> ShowS)
-> Show (Simplest a)
forall a. Int -> Simplest a -> ShowS
forall a. [Simplest a] -> ShowS
forall a. Simplest a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Int -> Simplest a -> ShowS
showsPrec :: Int -> Simplest a -> ShowS
$cshow :: forall a. Simplest a -> String
show :: Simplest a -> String
$cshowList :: forall a. [Simplest a] -> ShowS
showList :: [Simplest a] -> ShowS
Show, ReadPrec [Simplest a]
ReadPrec (Simplest a)
Int -> ReadS (Simplest a)
ReadS [Simplest a]
(Int -> ReadS (Simplest a))
-> ReadS [Simplest a]
-> ReadPrec (Simplest a)
-> ReadPrec [Simplest a]
-> Read (Simplest a)
forall a. ReadPrec [Simplest a]
forall a. ReadPrec (Simplest a)
forall a. Int -> ReadS (Simplest a)
forall a. ReadS [Simplest a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: forall a. Int -> ReadS (Simplest a)
readsPrec :: Int -> ReadS (Simplest a)
$creadList :: forall a. ReadS [Simplest a]
readList :: ReadS [Simplest a]
$creadPrec :: forall a. ReadPrec (Simplest a)
readPrec :: ReadPrec (Simplest a)
$creadListPrec :: forall a. ReadPrec [Simplest a]
readListPrec :: ReadPrec [Simplest a]
Read)
instance LayoutClass Simplest a where
    pureLayout :: Simplest a -> Rectangle -> Stack a -> [(a, Rectangle)]
pureLayout Simplest a
Simplest Rectangle
rec (S.Stack a
w [a]
l [a]
r) = (a -> (a, Rectangle)) -> [a] -> [(a, Rectangle)]
forall a b. (a -> b) -> [a] -> [b]
map (, Rectangle
rec) (a
w a -> [a] -> [a]
forall a. a -> [a] -> [a]
: [a] -> [a]
forall a. [a] -> [a]
reverse [a]
l [a] -> [a] -> [a]
forall a. [a] -> [a] -> [a]
++ [a]
r)