packages feed

managed-functions-json (empty) → 1.0.0

raw patch · 6 files changed

+105/−0 lines, 6 filesdep +aesondep +basedep +managed-functionssetup-changed

Dependencies added: aeson, base, managed-functions

Files

+ LICENSE view
@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2022 Martin Bednář++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.
+ README.md view
@@ -0,0 +1,5 @@+# managed-functions-json++_JSON Support for the Managed Functions Framework_++Provides the `JSON` Encoding for Managed Functions, as well as some `ToJSON` and `FromJSON` instances. 
+ Setup.hs view
@@ -0,0 +1,3 @@+import Distribution.Simple++main = defaultMain
+ managed-functions-json.cabal view
@@ -0,0 +1,40 @@+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.34.4.+--+-- see: https://github.com/sol/hpack++name:           managed-functions-json+version:        1.0.0+synopsis:       JSON Support for the Managed Functions Framework+description:    Please see the README on GitHub at <https://github.com/martin-bednar/managed-functions#readme>+category:       Remote Management, JSON+homepage:       https://github.com/martin-bednar/managed-functions#readme+bug-reports:    https://github.com/martin-bednar/managed-functions/issues+author:         Martin Bednar+maintainer:     bednam17@fit.cvut.cz+copyright:      2022 Martin Bednar+license:        MIT+license-file:   LICENSE+build-type:     Simple+extra-source-files:+    README.md++source-repository head+  type: git+  location: https://github.com/martin-bednar/managed-functions++library+  exposed-modules:+      Data.Managed.Encodings.JSON+      Data.Managed.Instances.JSON+  other-modules:+      Paths_managed_functions_json+  hs-source-dirs:+      src+  ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wpartial-fields -Wmonomorphism-restriction -Wmissing-home-modules -Widentities -Wredundant-constraints+  build-depends:+      aeson+    , base >=4.7 && <5+    , managed-functions+  default-language: Haskell2010
+ src/Data/Managed/Encodings/JSON.hs view
@@ -0,0 +1,24 @@+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE StarIsType #-}+{-# LANGUAGE TypeFamilies #-}++module Data.Managed.Encodings.JSON where++import Data.Aeson (FromJSON, Result(..), ToJSON, Value, fromJSON, toJSON)+import Data.Managed.Encoding++data JSON++instance Encoding JSON where+  type In JSON = Value+  type Out JSON = Value++instance (ToJSON a) => Encode a JSON where+  encode = toJSON++instance (FromJSON a) => Decode a JSON where+  decode v =+    case fromJSON v of+      Error _ -> Nothing+      Success x -> x
+ src/Data/Managed/Instances/JSON.hs view
@@ -0,0 +1,12 @@+module Data.Managed.Instances.JSON where++import Data.Aeson (FromJSON, ToJSON)+import Managed++instance ToJSON ProbeDescription++instance FromJSON ProbeDescription++instance ToJSON AgentException++instance FromJSON AgentException