liblawless 0.23.1 → 0.24.0
raw patch · 6 files changed
+83/−5 lines, 6 filesdep +lifted-basePVP ok
version bump matches the API change (PVP)
Dependencies added: lifted-base
API changes (from Hackage documentation)
+ Random: random :: (Random a, MonadBase IO m) => m a
+ Random: randomR :: (Random a, MonadBase IO m) => (a, a) -> m a
Files
- Source/IO.hs +1/−0
- Source/Printer.hs +11/−0
- Source/Random.hs +25/−0
- Source/Textual.hs +4/−3
- Tests/TestSTMHub.hs +37/−0
- liblawless.cabal +5/−2
Source/IO.hs view
@@ -64,6 +64,7 @@ import qualified Text.IO as TIO import Text import Textual+import Printer import Path import qualified System.Path.PartClass as PC import Exception
+ Source/Printer.hs view
@@ -0,0 +1,11 @@+module Printer+ (+ module Text.Printer,+ module Text.Printer.Integral,+ module Text.Printer.Fractional+ ) where+++import Text.Printer+import Text.Printer.Integral+import Text.Printer.Fractional
+ Source/Random.hs view
@@ -0,0 +1,25 @@+{-|+Module: Random+Description: Lifted random value functions using the system random number generator.+Copyright: © 2017 All rights reserved.+License: GPL-3+Maintainer: Evan Cofsky <evan@theunixman.com>+Stability: experimental+Portability: POSIX+-}++module Random (randomR, random) where++import Unicode+import System.IO (IO)+import IO.Base+import qualified System.Random as R++-- | Generate an endless range of random numbers between @[a, a]@+-- inclusive. (This is 'R.randomRIO' lifted.)+randomR ∷ (R.Random a, MonadBase IO m) ⇒ (a, a) → m a+randomR = liftBase ∘ R.randomRIO++-- | Generate an endless stream of values. (This is 'R.randomIO' lifted.)+random ∷ (R.Random a, MonadBase IO m) ⇒ m a+random = liftBase R.randomIO
Source/Textual.hs view
@@ -1,10 +1,11 @@-{-# LANGUAGE DeriveFoldable #-} module Textual ( module Data.Textual,- module Text.Printer+ module Data.Textual.Integral,+ module Data.Textual.Fractional ) where import Data.Textual-import Text.Printer hiding ((<>))+import Data.Textual.Integral+import Data.Textual.Fractional
+ Tests/TestSTMHub.hs view
@@ -0,0 +1,37 @@+{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}+{-# OPTIONS_GHC -Wno-orphans #-}++{-|+Module: TestSTMHub+Description: Test reading lines from text files.+Copyright: © 2017 All rights reserved.+License: GPL-3+Maintainer: Evan Cofsky <evan@theunixman.com>+Stability: experimental+Portability: POSIX+-}++module TestSTMHub where++import Lawless+import Text hiding (text)+import STM++import Arbitrary()+import Test.Framework+import Test.Framework.TH+import Test.Framework.Providers.QuickCheck2 (testProperty)+import Test.QuickCheck+import Test.QuickCheck.Monadic+import Line++default (Text)++prop_CheckSingle ∷ [Line] → Property+prop_CheckSingle lns = monadicIO $ do+ + m ← run $ readWriteLines lns+ assert (lns == m)++properties ∷ Test+properties = $(testGroupGenerator)
liblawless.cabal view
@@ -1,5 +1,5 @@ name: liblawless-version: 0.23.1+version: 0.24.0 synopsis: Prelude based on protolude for GHC 8 and beyond. license: GPL-3 license-file: LICENSE@@ -29,7 +29,7 @@ source-repository this type: git location: https://gitlab.com/theunixman/liblawless.git- tag: v0.23.1+ tag: v0.24.0 library ghc-options: -Wall -Wno-redundant-constraints -Wno-type-defaults -O2@@ -48,7 +48,9 @@ Map Networking Parser+ Printer Path+ Random Set STM STM.Base@@ -103,6 +105,7 @@ hjsonschema >= 1.6.2 && < 1.7, lens >= 4.14 && < 4.16, lifted-async >= 0.9.1.1 && < 0.10,+ lifted-base >= 0.2.3 && < 0.3, machines >= 0.6.1 && < 0.7, managed >= 1.0.5 && < 1.1, monad-control >= 1.0.1.0 && < 1.1,