merge master

This commit is contained in:
goolord 2019-06-03 11:28:26 -04:00
commit 5e5273777f
7 changed files with 34 additions and 34 deletions

View File

@ -17,7 +17,7 @@ library
exposed-modules: exposed-modules:
Text.Blaze.Colonnade Text.Blaze.Colonnade
build-depends: build-depends:
base >= 4.9 && < 5 base >= 4.8 && < 5
, colonnade >= 1.1 && < 1.3 , colonnade >= 1.1 && < 1.3
, blaze-markup >= 0.7 && < 0.9 , blaze-markup >= 0.7 && < 0.9
, blaze-html >= 0.8 && < 0.10 , blaze-html >= 0.8 && < 0.10

7
build
View File

@ -3,13 +3,14 @@ set -e
# To use this script on Ubuntu, you will need to first run the following: # To use this script on Ubuntu, you will need to first run the following:
# #
# sudo apt install ghc-8.0.2 ghc-8.2.2 ghc-8.4.3 # sudo apt install ghc-7.4.2 ghc-7.6.3 ghc-7.8.4 ghc-7.10.3 ghc-8.0.2 ghc-8.2.2 ghc-8.4.3 ghc-8.6.1
declare -a ghcs=("8.0.2" "8.2.2" "8.4.3") declare -a ghcs=("7.10.3" "8.0.2" "8.2.2" "8.4.4" "8.6.5")
## now loop through the above array ## now loop through the above array
for g in "${ghcs[@]}" for g in "${ghcs[@]}"
do do
cabal new-build --project-file "projects/cabal-$g.project" --builddir "dist-$g" -w "/opt/ghc/bin/ghc-$g" ./colonnade cabal new-build --builddir "dist-$g" -w "/opt/ghc/bin/ghc-$g" colonnade
cabal new-build --builddir "dist-$g" -w "/opt/ghc/bin/ghc-$g" siphon
done done

View File

@ -1,5 +1,4 @@
packages: ./colonnade packages: ./colonnade
./blaze-colonnade ./blaze-colonnade
./lucid-colonnade ./lucid-colonnade
./yesod-colonnade
./siphon ./siphon

View File

@ -1,6 +1,6 @@
name: colonnade name: colonnade
version: 1.2.0.1 version: 1.2.0.2
synopsis: Generic types and functions for columnar encoding and decoding synopsis: Generic types and functions for columnar encoding and decoding
description: description:
The `colonnade` package provides a way to talk about The `colonnade` package provides a way to talk about
columnar encodings and decodings of data. This package provides columnar encodings and decodings of data. This package provides
@ -19,15 +19,15 @@ description:
* <https://hackage.haskell.org/package/yesod-colonnade yesod-colonnade> for `yesod` widgets * <https://hackage.haskell.org/package/yesod-colonnade yesod-colonnade> for `yesod` widgets
. .
* <http://hackage.haskell.org/package/siphon siphon> for encoding and decoding CSVs * <http://hackage.haskell.org/package/siphon siphon> for encoding and decoding CSVs
homepage: https://github.com/andrewthad/colonnade#readme homepage: https://github.com/andrewthad/colonnade#readme
license: BSD3 license: BSD3
license-file: LICENSE license-file: LICENSE
author: Andrew Martin author: Andrew Martin
maintainer: andrew.thaddeus@gmail.com maintainer: andrew.thaddeus@gmail.com
copyright: 2016 Andrew Martin copyright: 2016 Andrew Martin
category: web category: web
build-type: Simple build-type: Simple
cabal-version: >=1.10 cabal-version: >=1.10
library library
hs-source-dirs: src hs-source-dirs: src
@ -35,19 +35,20 @@ library
Colonnade Colonnade
Colonnade.Encode Colonnade.Encode
build-depends: build-depends:
base >= 4.9 && < 5 base >= 4.8 && < 5
, contravariant >= 1.2 && < 1.6 , contravariant >= 1.2 && < 1.6
, vector >= 0.10 && < 0.13 , vector >= 0.10 && < 0.13
, text >= 1.0 && < 1.3 , text >= 1.0 && < 1.3
, bytestring >= 0.10 && < 0.11 , bytestring >= 0.10 && < 0.11
, profunctors >= 5.0 && < 5.4 , profunctors >= 5.0 && < 5.4
, semigroups >= 0.18.2 && < 0.20
default-language: Haskell2010 default-language: Haskell2010
ghc-options: -Wall ghc-options: -Wall
test-suite test test-suite test
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
hs-source-dirs: test hs-source-dirs: test
main-is: Main.hs main-is: Main.hs
build-depends: build-depends:
base >= 4.7 && <= 5 base >= 4.7 && <= 5
, colonnade , colonnade

View File

@ -17,7 +17,7 @@ library
exposed-modules: exposed-modules:
Lucid.Colonnade Lucid.Colonnade
build-depends: build-depends:
base >= 4.9 && < 5 base >= 4.8 && < 5
, colonnade >= 1.1.1 && < 1.3 , colonnade >= 1.1.1 && < 1.3
, lucid >= 2.9 && < 3.0 , lucid >= 2.9 && < 3.0
, text >= 1.2 && < 1.3 , text >= 1.2 && < 1.3

View File

@ -182,7 +182,7 @@ encodeBodySized ::
-> f a -> f a
-> Html () -> Html ()
encodeBodySized trAttrs tbodyAttrs colonnade collection = tbody_ tbodyAttrs $ do encodeBodySized trAttrs tbodyAttrs colonnade collection = tbody_ tbodyAttrs $ do
flip foldMap collection $ \a -> tr_ (trAttrs a) $ do for_ collection $ \a -> tr_ (trAttrs a) $ do
E.rowMonoidalHeader E.rowMonoidalHeader
colonnade colonnade
(\(E.Sized sz _) (Cell cattr content) -> (\(E.Sized sz _) (Cell cattr content) ->
@ -207,7 +207,7 @@ encodeTableSized mtheadAttrs tbodyAttrs trAttrs wrapContent tableAttrs colonnade
Just extractForall -> do Just extractForall -> do
let (theadAttrs,theadTrAttrs) = extract mtheadAttrs let (theadAttrs,theadTrAttrs) = extract mtheadAttrs
thead_ theadAttrs $ tr_ theadTrAttrs $ do thead_ theadAttrs $ tr_ theadTrAttrs $ do
foldlMapM' traverse_
(wrapContent th_ . extract . (wrapContent th_ . extract .
(\(E.Sized i h) -> case E.headednessExtract of (\(E.Sized i h) -> case E.headednessExtract of
Just f -> Just f ->
@ -224,7 +224,6 @@ encodeTableSized mtheadAttrs tbodyAttrs trAttrs wrapContent tableAttrs colonnade
extract :: forall y. h y -> y extract :: forall y. h y -> y
extract = E.runExtractForall extractForall extract = E.runExtractForall extractForall
encodeBodySized trAttrs tbodyAttrs colonnade xs encodeBodySized trAttrs tbodyAttrs colonnade xs
pure ()
setColspanOrHide :: Int -> [Attribute] -> [Attribute] setColspanOrHide :: Int -> [Attribute] -> [Attribute]
setColspanOrHide i attrs setColspanOrHide i attrs
@ -279,16 +278,15 @@ sectioned ::
-> f (b, g a) -- ^ Collection of data -> f (b, g a) -- ^ Collection of data
-> Html () -> Html ()
sectioned tableAttrs mheadAttrs bodyAttrs trAttrs dividerContent colonnade@(E.Colonnade v) collection = do sectioned tableAttrs mheadAttrs bodyAttrs trAttrs dividerContent colonnade@(E.Colonnade v) collection = do
pure ()
let vlen = V.length v let vlen = V.length v
table_ tableAttrs $ do table_ tableAttrs $ do
for_ mheadAttrs $ \(headAttrs,headTrAttrs) -> for_ mheadAttrs $ \(headAttrs,headTrAttrs) ->
thead_ headAttrs . tr_ headTrAttrs $ thead_ headAttrs . tr_ headTrAttrs $
E.headerMonadicGeneral_ colonnade (htmlFromCell th_) E.headerMonadicGeneral_ colonnade (htmlFromCell th_)
tbody_ bodyAttrs $ forM_ collection $ \(b,as) -> do tbody_ bodyAttrs $ for_ collection $ \(b,as) -> do
let Cell attrs contents = dividerContent b let Cell attrs contents = dividerContent b
tr_ [] $ do tr_ [] $ do
td_ ((colspan_ $ T.pack (show vlen)): attrs) contents td_ ((colspan_ $ T.pack (show vlen)): attrs) contents
flip foldlMapM' as $ \a -> do flip traverse_ as $ \a -> do
tr_ (trAttrs a) $ E.rowMonadic colonnade (htmlFromCell td_) a tr_ (trAttrs a) $ E.rowMonadic colonnade (htmlFromCell td_) a

View File

@ -1,5 +1,5 @@
name: siphon name: siphon
version: 0.8.1 version: 0.8.1.1
synopsis: Encode and decode CSV files synopsis: Encode and decode CSV files
description: Please see README.md description: Please see README.md
homepage: https://github.com/andrewthad/colonnade#readme homepage: https://github.com/andrewthad/colonnade#readme
@ -13,20 +13,21 @@ build-type: Simple
cabal-version: >=1.10 cabal-version: >=1.10
library library
hs-source-dirs: src hs-source-dirs: src
exposed-modules: exposed-modules:
Siphon Siphon
Siphon.Types Siphon.Types
build-depends: build-depends:
base >= 4.9 && < 5 base >= 4.8 && < 5
, colonnade >= 1.2 && < 1.3 , colonnade >= 1.2 && < 1.3
, text >= 1.0 && < 1.3 , text >= 1.0 && < 1.3
, bytestring , bytestring
, vector , vector
, streaming >= 0.1.4 && < 0.3 , streaming >= 0.1.4 && < 0.3
, attoparsec , attoparsec
, transformers >= 0.5 && < 0.6 , transformers >= 0.4.2 && < 0.6
default-language: Haskell2010 , semigroups >= 0.18.2 && < 0.20
default-language: Haskell2010
test-suite doctest test-suite doctest
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
@ -36,7 +37,7 @@ test-suite doctest
base base
, siphon , siphon
, doctest >= 0.10 , doctest >= 0.10
default-language: Haskell2010 default-language: Haskell2010
test-suite test test-suite test
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0