tabl 1.0.1 → 1.0.2
raw patch · 5 files changed
+1/−126 lines, 5 filesdep −randomdep −splitdep −tabldep ~base
Dependencies removed: random, split, tabl, unix
Dependency ranges changed: base
Files
- examples/Constants.hs +0/−17
- examples/Multiply.hs +0/−28
- examples/TicTacToe.hs +0/−22
- examples/Users.hs +0/−22
- tabl.cabal +1/−37
− examples/Constants.hs
@@ -1,17 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}--import Text.Tabl--import qualified Data.Text.IO as T---- | Table containing few physics constants.-main :: IO ()-main = T.putStrLn $ tabl EnvAscii hdecor vdecor aligns cells - where- hdecor = DecorUnion [DecorOuter, DecorOnly [1]]- vdecor = DecorAll- aligns = [AlignLeft, AlignLeft, AlignRight]- cells = [ ["Name", "SI Unit", "Value"]- , ["Speed of light", "m/s", "299792458"]- , ["Atmosphere", "Pa", "101325"]- , ["Absolute zero", "C", "-273.15"] ]
− examples/Multiply.hs
@@ -1,28 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}--import System.Environment-import Text.Tabl--import qualified Data.Text as T-import qualified Data.Text.IO as T---- | Create the multiplication table.-numbers :: Int -- ^ table side size- -> [[T.Text]] -- ^ multiplication table-numbers n = header : zipWith (:) digits content- where- header = " " : digits- digits = map (T.pack . show) [1..n]- content = map (map (T.pack . show)) mults- mults = map (flip map [1..n] . (*)) [1..n]---- | Table containing basic integer products.-main :: IO ()-main = do- [n] <- getArgs- let cells = numbers (read n)- T.putStrLn $ tabl EnvAscii hdecor vdecor aligns cells- where- hdecor = DecorOnly [1]- vdecor = DecorOnly [1]- aligns = repeat AlignRight
− examples/TicTacToe.hs
@@ -1,22 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}--import Control.Monad-import Data.List.Split-import Data.Word-import Safe-import System.Random-import Text.Tabl--import qualified Data.Text.IO as T---- | Table containing the play grid of tic-tac-toe.-main :: IO ()-main = do- xs <- replicateM 9 randomIO :: IO [Word8]- let cells = chunksOf 3 $ map (mark . (`mod` 3)) xs- T.putStrLn $ tabl EnvAscii hdecor vdecor aligns cells- where- mark x = lookupJust x [(0, " "), (1, "X"), (2, "O")]- hdecor = DecorAll- vdecor = DecorAll- aligns = []
− examples/Users.hs
@@ -1,22 +0,0 @@-import System.Posix.User-import Text.Tabl--import qualified Data.Text as T-import qualified Data.Text.IO as T---- | Create a table row for one user entry.-createRow :: UserEntry -- ^ user- -> [T.Text] -- ^ table row-createRow ue = map T.pack [show $ userID ue, userName ue, userGecos ue]---- | Table containing all system users and their respective basic--- information.-main :: IO ()-main = do- users <- getAllUserEntries- let cells = map createRow users- T.putStrLn $ tabl EnvAscii hdecor vdecor aligns cells- where- hdecor = DecorNone- vdecor = DecorNone- aligns = [AlignRight]
tabl.cabal view
@@ -1,5 +1,5 @@ name: tabl-version: 1.0.1+version: 1.0.2 synopsis: Table layout description: Text.Tabl arranges multiple Text instances into a table layout while providing means of alignment@@ -25,42 +25,6 @@ , Text.Tabl.Util build-depends: base >= 4.7 && < 5 , safe- , text- default-language: Haskell2010--executable tabl-example-users- hs-source-dirs: examples- main-is: Users.hs- build-depends: base- , unix- , tabl- , text- default-language: Haskell2010--executable tabl-example-multiply- hs-source-dirs: examples- main-is: Multiply.hs- build-depends: base- , tabl- , text- default-language: Haskell2010--executable tabl-example-tictactoe- hs-source-dirs: examples- main-is: TicTacToe.hs- build-depends: base- , random- , safe- , split- , tabl- , text- default-language: Haskell2010--executable tabl-example-constants- hs-source-dirs: examples- main-is: Constants.hs- build-depends: base- , tabl , text default-language: Haskell2010