net-spider-pangraph 0.1.1.1 → 0.2.0.0
raw patch · 3 files changed
+15/−10 lines, 3 filesdep ~greskelldep ~net-spider
Dependency ranges changed: greskell, net-spider
Files
- ChangeLog.md +6/−0
- net-spider-pangraph.cabal +3/−3
- src/NetSpider/Pangraph.hs +6/−7
ChangeLog.md view
@@ -1,5 +1,11 @@ # Revision history for net-spider-pangraph +## 0.2.0.0 -- 2019-12-28++* Remove `ToAttributes` instance of `PropertyMap`s, because they are+ now deprecated.+* Add `ToAttributes` instance to `PMap`.+ ## 0.1.1.1 -- 2019-10-04 * Confirm test with `hashable-1.3.0.0`.
net-spider-pangraph.cabal view
@@ -1,5 +1,5 @@ name: net-spider-pangraph-version: 0.1.1.1+version: 0.2.0.0 author: Toshio Ito <debug.ito@gmail.com> maintainer: Toshio Ito <debug.ito@gmail.com> license: BSD3@@ -23,12 +23,12 @@ NetSpider.Pangraph.Atom -- other-modules: build-depends: base >=4.11.1.0 && <4.13,- net-spider >=0.3.1.0 && <0.4,+ net-spider >=0.4.0.0 && <0.5, bytestring >=0.10.8.2 && <0.11, text >=1.2.3.1 && <1.3, pangraph >=0.2.1 && <0.3, time >=1.8.0.2 && <1.10,- greskell >=0.2.3.0 && <0.3+ greskell >=1.0.0.0 && <1.1 -- executable net-spider-pangraph -- default-language: Haskell2010
src/NetSpider/Pangraph.hs view
@@ -6,8 +6,7 @@ -- -- Conversion of NetSpider data model into Pangraph data model. This -- module allows you to export a snapshot graph ('SnapshotNode's and--- 'SnapshotLink's) to 'P.Pangraph'. Then you can export it to a--- GraphML file so that external tools can handle it.+-- 'SnapshotLink's) to 'P.Pangraph'. module NetSpider.Pangraph ( -- * Converters makePangraph,@@ -30,7 +29,8 @@ import Data.ByteString (ByteString) import qualified Data.ByteString as BS-import Data.Greskell.Graph (PropertyMap(allProperties), Property(..))+import Data.Foldable (Foldable)+import Data.Greskell.PMap (PMap, pMapToList) import Data.Text (pack) import Data.Text.Encoding (encodeUtf8) import Data.Time.LocalTime (TimeZone(..))@@ -119,10 +119,9 @@ instance (ToAtom k, ToAtom v) => ToAttributes [(k,v)] where toAttributes = map (\(k, v) -> (toAtom k, toAtom v)) -instance (PropertyMap m, Property p, ToAtom v) => ToAttributes (m p v) where- toAttributes = toAttributes . map toPair . allProperties- where- toPair p = (propertyKey p, propertyValue p)+-- | @since 0.2.0.0+instance (Foldable c, ToAtom v) => ToAttributes (PMap c v) where+ toAttributes = toAttributes . pMapToList -- | 'Nothing' is mapped to empty attributes. instance ToAttributes a => ToAttributes (Maybe a) where