sql-words 0.1.6.0 → 0.1.6.1
raw patch · 3 files changed
+11/−2 lines, 3 files
Files
- sql-words.cabal +1/−1
- src/Language/SQL/Keyword/Concat.hs +1/−0
- test/monoidLaw.hs +9/−1
sql-words.cabal view
@@ -1,5 +1,5 @@ name: sql-words-version: 0.1.6.0+version: 0.1.6.1 synopsis: SQL keywords data constructors into OverloadedString description: This package contiains SQL keywords constructors defined as OverloadedString literals and helper functions to concate these.
src/Language/SQL/Keyword/Concat.hs view
@@ -158,6 +158,7 @@ in' :: Keyword -> Keyword -> Keyword in' = defineBinOp IN +infixr 6 <++> infixr 5 .||. infixr 4 .=., .<., .<=., .>., .>=., .<>. infix 4 `in'`
test/monoidLaw.hs view
@@ -1,6 +1,7 @@ {-# OPTIONS -fno-warn-orphans #-} -import Language.SQL.Keyword (Keyword, DString)+import Language.SQL.Keyword+ (Keyword (Sequence), DString, (<++>)) import Data.Monoid (Monoid, mempty, (<>)) import Data.String (fromString)@@ -44,6 +45,12 @@ instance Arbitrary Keyword where arbitrary = fmap fromString arbitrary +concatCommutative :: DString -> DString -> Bool+concatCommutative x y =+ Sequence x <++> Sequence y+ ==+ Sequence (x <> y)+ tests :: [Test] tests = [ prop "DString left Id" dsLeftId , prop "DString right Id" dsRightId@@ -51,6 +58,7 @@ , prop "Keyword left Id" kwLeftId , prop "Keyword right Id" kwRightId , prop "Keyword associativity" kwAssoc+ , prop "concat commutative" concatCommutative ] main :: IO ()