packages feed

concrete-haskell 0.1.0.0 → 0.1.0.1

raw patch · 2 files changed

+26/−3 lines, 2 filesdep +aesondep +containers

Dependencies added: aeson, containers

Files

concrete-haskell.cabal view
@@ -1,5 +1,5 @@ name:                concrete-haskell-version:             0.1.0.0+version:             0.1.0.1 synopsis:            Library for the Concrete data format. description:         Library for the Concrete data format. homepage:            https://github.com/hltcoe@@ -14,7 +14,7 @@  library   hs-source-dirs:     src-  exposed-modules:    Data.Concrete+  exposed-modules:    Data.Concrete, Data.Concrete.Utils   other-modules:      Communication_Types                     , Access_Types                     , Annotate_Types@@ -47,5 +47,7 @@                      , vector                      , hashable                      , bytestring-+                     , aeson+                     , containers+                        default-language:    Haskell2010
+ src/Data/Concrete/Utils.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE DeriveGeneric #-}+module Data.Concrete.Utils+       (+         jsonToCommunication+       ) where++import GHC.Generics+import qualified Data.Concrete as C+import Data.Concrete (Communication)+import Data.Text+import Data.Aeson+import Data.ByteString.Lazy+import Data.Map++instance FromJSON Communication where+  parseJSON (Object v) = return C.default_Communication++jsonToCommunication :: ByteString -> IO (Maybe Communication)+jsonToCommunication t = do+  return $ (decode t :: Maybe Communication)+