tabular 0.2.2.7 → 0.2.2.8
raw patch · 4 files changed
+29/−35 lines, 4 filesdep ~mtlsetup-changednew-uploader
Dependency ranges changed: mtl
Files
- Setup.hs +3/−0
- Setup.lhs +0/−3
- Text/Tabular.hs +5/−23
- tabular.cabal +21/−9
+ Setup.hs view
@@ -0,0 +1,3 @@+#!/usr/bin/env runhaskell+import Distribution.Simple+main = defaultMain
− Setup.lhs
@@ -1,3 +0,0 @@-#!/usr/bin/env runhaskell-> import Distribution.Simple-> main = defaultMain
Text/Tabular.hs view
@@ -9,7 +9,9 @@ import Control.Monad.State (evalState, State, get, put) data Properties = NoLine | SingleLine | DoubleLine+ deriving (Show) data Header h = Header h | Group Properties [Header h]+ deriving (Show) -- | -- > example = Table@@ -39,28 +41,7 @@ -- > -- B 2 || better | no chance || crawling | amazing -- > -- B 3 || meh | well... || worst ever | ok data Table rh ch a = Table (Header rh) (Header ch) [[a]]---- ---------------------------------------------------------------------------- ------------------------------------------------------------------------{---- | A 'Table' of "FancyCell"-type FancyTable d a = Table (FancyCell d a)---- | 'FancyCell' @decorations a@ is a table cell that is associated with--- decorations of your choosing (for example, a cell colour) as well as--- instructions to merge that cell with its neighbours down or to the--- right. We include special versions of the rendering functions that--- recognise the merge instructions, but you will have to supply the--- code that deals with the decorations.-type FancyCell decorations a = (a, Maybe decorations, Maybe MergeInfo)---data MergeInfo = MergeInfo { mergeDown :: Int- , mergeRight :: Int- }--}+ deriving (Show) -- ---------------------------------------------------------------------- -- * Helper functions for rendering@@ -147,6 +128,7 @@ -- > +.+ row "B 2" ["better", "no chance", "crawling", "amazing"] -- > +.+ row "B 3" ["meh", "well...", "worst ever", "ok"] data SemiTable h a = SemiTable (Header h) [a]+ deriving (Show) empty :: Table rh ch a empty = Table (Group NoLine []) (Group NoLine []) []@@ -168,7 +150,7 @@ beside prop (Table rows cols1 data1) (SemiTable cols2 data2) = Table rows (Group prop [cols1, cols2])- (zipWith (++) data1 [data2])+ (zipWith (\xs x -> xs ++ [x]) data1 data2) below :: Properties -> Table rh ch a -> SemiTable rh a -> Table rh ch a below prop (Table rows1 cols data1)
tabular.cabal view
@@ -1,5 +1,5 @@ name: tabular-version: 0.2.2.7+version: 0.2.2.8 synopsis: Two-dimensional data tables with rendering functions description: Tabular provides a Haskell representation of two-dimensional data tables, the kind that you might find in a spreadsheet or@@ -24,19 +24,30 @@ license: BSD3 license-file: LICENSE author: Eric Kow-maintainer: Eric Kow <eric.kow@gmail.com>-homepage: http://hub.darcs.net/kowey/tabular-cabal-version: >= 1.8+maintainer: Ben Gamari <bgamari@well-typed.com>+homepage: https://github.com/bgamari/tabular+cabal-version: 1.18 build-type: Simple-extra-doc-files: example/sample1.hs,- example/sample1.tex+extra-doc-files: example/sample1.hs,+ example/sample1.tex+tested-with: GHC==8.10.2,+ GHC==8.8.4,+ GHC==8.6.5,+ GHC==8.4.4,+ GHC==8.2.2,+ GHC==8.0.2,+ GHC==7.10.3,+ GHC==7.8.4,+ GHC==7.6.3 + source-repository head- type: darcs- location: http://hub.darcs.net/kowey/tabular+ type: git+ location: https://github.com/bgamari/tabular library- build-Depends: base >= 2.1 && < 5, mtl >= 1 && < 2.3,+ build-Depends: base >= 2.1 && < 5,+ mtl >= 1 && < 2.3, csv >= 0.1 && < 0.2, html >= 1.0 && < 2.0 exposed-modules: Text.Tabular,@@ -45,3 +56,4 @@ Text.Tabular.Csv, Text.Tabular.Html, Text.Tabular.Latex+ default-language: Haskell2010