backend-0.1.0.0
LicenseAGPL-3
Maintainerstu235271@mail.uni-kiel.de stu236925@mail.uni-kiel.de
Safe HaskellNone
LanguageHaskell2010

Docs.Comment

Description

This module contains schemas and utility functions for comments.

Synopsis

Documentation

newtype CommentID Source #

Unique identifier for a comment

Constructors

CommentID 

Fields

Instances

Instances details
FromJSON CommentID Source # 
Instance details

Defined in Docs.Comment

Methods

parseJSON :: Value -> Parser CommentID

parseJSONList :: Value -> Parser [CommentID]

omittedField :: Maybe CommentID

ToJSON CommentID Source # 
Instance details

Defined in Docs.Comment

Methods

toJSON :: CommentID -> Value

toEncoding :: CommentID -> Encoding

toJSONList :: [CommentID] -> Value

toEncodingList :: [CommentID] -> Encoding

omitField :: CommentID -> Bool

Show CommentID Source # 
Instance details

Defined in Docs.Comment

Eq CommentID Source # 
Instance details

Defined in Docs.Comment

Ord CommentID Source # 
Instance details

Defined in Docs.Comment

FromHttpApiData CommentID Source # 
Instance details

Defined in Docs.Comment

ToParamSchema CommentID Source # 
Instance details

Defined in Docs.Comment

Methods

toParamSchema :: Proxy CommentID -> Schema

ToSchema CommentID Source # 
Instance details

Defined in Docs.Comment

Methods

declareNamedSchema :: Proxy CommentID -> Declare (Definitions Schema) NamedSchema

data Status Source #

Wether a comment is still open or resolved

Constructors

Open 
Resolved UTCTime 

Instances

Instances details
FromJSON Status Source # 
Instance details

Defined in Docs.Comment

Methods

parseJSON :: Value -> Parser Status

parseJSONList :: Value -> Parser [Status]

omittedField :: Maybe Status

ToJSON Status Source # 
Instance details

Defined in Docs.Comment

Methods

toJSON :: Status -> Value

toEncoding :: Status -> Encoding

toJSONList :: [Status] -> Value

toEncodingList :: [Status] -> Encoding

omitField :: Status -> Bool

Generic Status Source # 
Instance details

Defined in Docs.Comment

Associated Types

type Rep Status 
Instance details

Defined in Docs.Comment

type Rep Status = D1 ('MetaData "Status" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "Open" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Resolved" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime)))

Methods

from :: Status -> Rep Status x #

to :: Rep Status x -> Status #

ToSchema Status Source # 
Instance details

Defined in Docs.Comment

Methods

declareNamedSchema :: Proxy Status -> Declare (Definitions Schema) NamedSchema

type Rep Status Source # 
Instance details

Defined in Docs.Comment

type Rep Status = D1 ('MetaData "Status" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "Open" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Resolved" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime)))

data Comment Source #

An existing comment present in the database

Constructors

Comment 

Instances

Instances details
FromJSON Comment Source # 
Instance details

Defined in Docs.Comment

Methods

parseJSON :: Value -> Parser Comment

parseJSONList :: Value -> Parser [Comment]

omittedField :: Maybe Comment

ToJSON Comment Source # 
Instance details

Defined in Docs.Comment

Methods

toJSON :: Comment -> Value

toEncoding :: Comment -> Encoding

toJSONList :: [Comment] -> Value

toEncodingList :: [Comment] -> Encoding

omitField :: Comment -> Bool

Generic Comment Source # 
Instance details

Defined in Docs.Comment

Associated Types

type Rep Comment 
Instance details

Defined in Docs.Comment

type Rep Comment = D1 ('MetaData "Comment" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "Comment" 'PrefixI 'True) ((S1 ('MetaSel ('Just "identifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommentID) :*: S1 ('MetaSel ('Just "status") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Status)) :*: (S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Message) :*: S1 ('MetaSel ('Just "replies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector Message)))))

Methods

from :: Comment -> Rep Comment x #

to :: Rep Comment x -> Comment #

ToSchema Comment Source # 
Instance details

Defined in Docs.Comment

Methods

declareNamedSchema :: Proxy Comment -> Declare (Definitions Schema) NamedSchema

type Rep Comment Source # 
Instance details

Defined in Docs.Comment

type Rep Comment = D1 ('MetaData "Comment" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "Comment" 'PrefixI 'True) ((S1 ('MetaSel ('Just "identifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommentID) :*: S1 ('MetaSel ('Just "status") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Status)) :*: (S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Message) :*: S1 ('MetaSel ('Just "replies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector Message)))))

data Message Source #

The message of a comment or a reply

Constructors

Message 

Instances

Instances details
FromJSON Message Source # 
Instance details

Defined in Docs.Comment

Methods

parseJSON :: Value -> Parser Message

parseJSONList :: Value -> Parser [Message]

omittedField :: Maybe Message

ToJSON Message Source # 
Instance details

Defined in Docs.Comment

Methods

toJSON :: Message -> Value

toEncoding :: Message -> Encoding

toJSONList :: [Message] -> Value

toEncodingList :: [Message] -> Encoding

omitField :: Message -> Bool

Generic Message Source # 
Instance details

Defined in Docs.Comment

Associated Types

type Rep Message 
Instance details

Defined in Docs.Comment

type Rep Message = D1 ('MetaData "Message" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "Message" 'PrefixI 'True) (S1 ('MetaSel ('Just "author") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UserRef) :*: (S1 ('MetaSel ('Just "timestamp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "content") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))

Methods

from :: Message -> Rep Message x #

to :: Rep Message x -> Message #

ToSchema Message Source # 
Instance details

Defined in Docs.Comment

Methods

declareNamedSchema :: Proxy Message -> Declare (Definitions Schema) NamedSchema

type Rep Message Source # 
Instance details

Defined in Docs.Comment

type Rep Message = D1 ('MetaData "Message" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "Message" 'PrefixI 'True) (S1 ('MetaSel ('Just "author") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UserRef) :*: (S1 ('MetaSel ('Just "timestamp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "content") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))

data CommentRef Source #

References a comment of a TextElement

Instances

Instances details
FromJSON CommentRef Source # 
Instance details

Defined in Docs.Comment

Methods

parseJSON :: Value -> Parser CommentRef

parseJSONList :: Value -> Parser [CommentRef]

omittedField :: Maybe CommentRef

ToJSON CommentRef Source # 
Instance details

Defined in Docs.Comment

Methods

toJSON :: CommentRef -> Value

toEncoding :: CommentRef -> Encoding

toJSONList :: [CommentRef] -> Value

toEncodingList :: [CommentRef] -> Encoding

omitField :: CommentRef -> Bool

Generic CommentRef Source # 
Instance details

Defined in Docs.Comment

Associated Types

type Rep CommentRef 
Instance details

Defined in Docs.Comment

type Rep CommentRef = D1 ('MetaData "CommentRef" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "CommentRef" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TextElementRef) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommentID)))
ToSchema CommentRef Source # 
Instance details

Defined in Docs.Comment

Methods

declareNamedSchema :: Proxy CommentRef -> Declare (Definitions Schema) NamedSchema

type Rep CommentRef Source # 
Instance details

Defined in Docs.Comment

type Rep CommentRef = D1 ('MetaData "CommentRef" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "CommentRef" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TextElementRef) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommentID)))

data CommentAnchor Source #

Ties a comment to a specific text passage

Constructors

CommentAnchor 

Fields

Instances

Instances details
FromJSON CommentAnchor Source # 
Instance details

Defined in Docs.Comment

Methods

parseJSON :: Value -> Parser CommentAnchor

parseJSONList :: Value -> Parser [CommentAnchor]

omittedField :: Maybe CommentAnchor

ToJSON CommentAnchor Source # 
Instance details

Defined in Docs.Comment

Generic CommentAnchor Source # 
Instance details

Defined in Docs.Comment

Associated Types

type Rep CommentAnchor 
Instance details

Defined in Docs.Comment

type Rep CommentAnchor = D1 ('MetaData "CommentAnchor" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "CommentAnchor" 'PrefixI 'True) (S1 ('MetaSel ('Just "comment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommentID) :*: S1 ('MetaSel ('Just "anchor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range)))
Eq CommentAnchor Source # 
Instance details

Defined in Docs.Comment

Ord CommentAnchor Source # 
Instance details

Defined in Docs.Comment

ToSchema CommentAnchor Source # 
Instance details

Defined in Docs.Comment

Methods

declareNamedSchema :: Proxy CommentAnchor -> Declare (Definitions Schema) NamedSchema

type Rep CommentAnchor Source # 
Instance details

Defined in Docs.Comment

type Rep CommentAnchor = D1 ('MetaData "CommentAnchor" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "CommentAnchor" 'PrefixI 'True) (S1 ('MetaSel ('Just "comment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommentID) :*: S1 ('MetaSel ('Just "anchor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range)))

data Range Source #

Text passage

Instances

Instances details
FromJSON Range Source # 
Instance details

Defined in Docs.Comment

Methods

parseJSON :: Value -> Parser Range

parseJSONList :: Value -> Parser [Range]

omittedField :: Maybe Range

ToJSON Range Source # 
Instance details

Defined in Docs.Comment

Methods

toJSON :: Range -> Value

toEncoding :: Range -> Encoding

toJSONList :: [Range] -> Value

toEncodingList :: [Range] -> Encoding

omitField :: Range -> Bool

Generic Range Source # 
Instance details

Defined in Docs.Comment

Associated Types

type Rep Range 
Instance details

Defined in Docs.Comment

type Rep Range = D1 ('MetaData "Range" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "Range" 'PrefixI 'True) (S1 ('MetaSel ('Just "start") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Anchor) :*: S1 ('MetaSel ('Just "end") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Anchor)))

Methods

from :: Range -> Rep Range x #

to :: Rep Range x -> Range #

Eq Range Source # 
Instance details

Defined in Docs.Comment

Methods

(==) :: Range -> Range -> Bool #

(/=) :: Range -> Range -> Bool #

Ord Range Source # 
Instance details

Defined in Docs.Comment

Methods

compare :: Range -> Range -> Ordering #

(<) :: Range -> Range -> Bool #

(<=) :: Range -> Range -> Bool #

(>) :: Range -> Range -> Bool #

(>=) :: Range -> Range -> Bool #

max :: Range -> Range -> Range #

min :: Range -> Range -> Range #

ToSchema Range Source # 
Instance details

Defined in Docs.Comment

Methods

declareNamedSchema :: Proxy Range -> Declare (Definitions Schema) NamedSchema

type Rep Range Source # 
Instance details

Defined in Docs.Comment

type Rep Range = D1 ('MetaData "Range" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "Range" 'PrefixI 'True) (S1 ('MetaSel ('Just "start") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Anchor) :*: S1 ('MetaSel ('Just "end") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Anchor)))

data Anchor Source #

Text location

Constructors

Anchor 

Fields

Instances

Instances details
FromJSON Anchor Source # 
Instance details

Defined in Docs.Comment

Methods

parseJSON :: Value -> Parser Anchor

parseJSONList :: Value -> Parser [Anchor]

omittedField :: Maybe Anchor

ToJSON Anchor Source # 
Instance details

Defined in Docs.Comment

Methods

toJSON :: Anchor -> Value

toEncoding :: Anchor -> Encoding

toJSONList :: [Anchor] -> Value

toEncodingList :: [Anchor] -> Encoding

omitField :: Anchor -> Bool

Generic Anchor Source # 
Instance details

Defined in Docs.Comment

Associated Types

type Rep Anchor 
Instance details

Defined in Docs.Comment

type Rep Anchor = D1 ('MetaData "Anchor" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "Anchor" 'PrefixI 'True) (S1 ('MetaSel ('Just "col") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64) :*: S1 ('MetaSel ('Just "row") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

Methods

from :: Anchor -> Rep Anchor x #

to :: Rep Anchor x -> Anchor #

Eq Anchor Source # 
Instance details

Defined in Docs.Comment

Methods

(==) :: Anchor -> Anchor -> Bool #

(/=) :: Anchor -> Anchor -> Bool #

Ord Anchor Source # 
Instance details

Defined in Docs.Comment

ToSchema Anchor Source # 
Instance details

Defined in Docs.Comment

Methods

declareNamedSchema :: Proxy Anchor -> Declare (Definitions Schema) NamedSchema

type Rep Anchor Source # 
Instance details

Defined in Docs.Comment

type Rep Anchor = D1 ('MetaData "Anchor" "Docs.Comment" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "Anchor" 'PrefixI 'True) (S1 ('MetaSel ('Just "col") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64) :*: S1 ('MetaSel ('Just "row") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

range :: Anchor -> Anchor -> Range Source #

Constructor for Range. Order of anchors does not matter.

prettyPrintCommentRef :: CommentRef -> String Source #

Obtain a human readable representation of a CommentRef