1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2025-03-20 04:46:22 +09:00

Allow actor public key to be in a separate document

This commit is contained in:
fr33domlover 2019-02-03 23:39:56 +00:00
parent 8db38c087f
commit c336d56036
5 changed files with 88 additions and 43 deletions
src/Data/Aeson

View file

@ -14,7 +14,8 @@
-}
module Data.Aeson.Local
( frg
( Either' (..)
, frg
, parseHttpsURI
, renderURI
, (.=?)
@ -23,6 +24,7 @@ where
import Prelude
import Control.Applicative ((<|>))
import Data.Aeson
import Data.Aeson.Types (Parser)
import Data.Text (Text)
@ -30,6 +32,11 @@ import Network.URI
import qualified Data.Text as T (unpack)
data Either' a b = Left' a | Right' b
instance (FromJSON a, FromJSON b) => FromJSON (Either' a b) where
parseJSON v = Left' <$> parseJSON v <|> Right' <$> parseJSON v
frg :: Text
frg = "https://forgefed.angeley.es/ns#"