greskell-core 0.1.0.0 → 0.1.1.0
raw patch · 3 files changed
+19/−6 lines, 3 filesdep +semigroupsdep ~basedep ~doctestPVP ok
version bump matches the API change (PVP)
Dependencies added: semigroups
Dependency ranges changed: base, doctest
API changes (from Hackage documentation)
+ Data.Greskell.Greskell: instance Data.String.IsString a => Data.Semigroup.Semigroup (Data.Greskell.Greskell.Greskell a)
Files
- ChangeLog.md +6/−0
- greskell-core.cabal +5/−4
- src/Data/Greskell/Greskell.hs +8/−2
ChangeLog.md view
@@ -1,5 +1,11 @@ # Revision history for greskell-core +## 0.1.1.0 -- 2018-04-08++* Add Semigroup instance to Greskell.+* Confirmed test with base-4.11.++ ## 0.1.0.0 -- 2018-03-12 * First version. Released on an unsuspecting world.
greskell-core.cabal view
@@ -1,5 +1,5 @@ name: greskell-core-version: 0.1.0.0+version: 0.1.1.0 author: Toshio Ito <debug.ito@gmail.com> maintainer: Toshio Ito <debug.ito@gmail.com> license: BSD3@@ -25,11 +25,12 @@ exposed-modules: Data.Greskell.Greskell, Data.Greskell.GraphSON -- other-modules: - build-depends: base >=4.9.0.0 && <4.11,+ build-depends: base >=4.9.0.0 && <4.12, aeson >=0.11.2.1 && <1.4, unordered-containers >=0.2.7.1 && <0.3, scientific >=0.3.4.9 && <0.4,- text >=1.2.2.1 && <1.3+ text >=1.2.2.1 && <1.3,+ semigroups >=0.18.2 && <0.19 test-suite spec type: exitcode-stdio-1.0@@ -53,7 +54,7 @@ ghc-options: -Wall -fno-warn-unused-imports "-with-rtsopts=-M512m" main-is: DocTest.hs build-depends: base,- doctest >=0.11 && <0.15,+ doctest >=0.11 && <0.16, doctest-discover >=0.1.0.7 && <0.2
src/Data/Greskell/Greskell.hs view
@@ -35,9 +35,10 @@ import Data.Bifunctor (bimap) import Data.Foldable (toList) import qualified Data.HashMap.Lazy as HM-import Data.Monoid (Monoid(..), (<>))+import Data.Monoid (Monoid(..)) import Data.Ratio (numerator, denominator, Rational) import Data.Scientific (Scientific, coefficient, base10Exponent)+import Data.Semigroup (Semigroup(..)) import Data.String (IsString(..)) import Data.List (intersperse) import Data.Text (Text, pack, unpack)@@ -83,12 +84,17 @@ where scriptOf accessor = TL.pack $ show $ accessor rat +-- | Semigroup operator '(<>)' on 'Greskell' assumes @String@+-- concatenation on Gremlin.+instance IsString a => Semigroup (Greskell a) where+ (<>) = biOp "+"+ -- | Monoidal operations on 'Greskell' assumes @String@ operations in -- Gremlin. 'mempty' is the empty String, and 'mappend' is String -- concatenation. instance IsString a => Monoid (Greskell a) where mempty = fromString ""- mappend = biOp "+"+ mappend = (<>) -- | Something that can convert to 'Greskell'. class ToGreskell a where