follow-0.1.0.0: Haskell library to follow content published on any subject.

Safe HaskellNone
LanguageHaskell2010

Follow.Types

Description

This module defines the types used in the whole application.

Synopsis

Documentation

data Recipe m Source #

A recipe is a specification of a complete strategy to create the content to follow a subject.

Constructors

Recipe 

Fields

Instances
(MonadThrow m, MonadHttp m) => FromJSON (Recipe m) #
  subject: # See Subject instance
  steps:
    -
      - # See Fetched instance
      -
        - # See Middleware instance
  middlewares:"
    - # See Middleware instance
 
Instance details

Defined in Follow.Parser

data Subject Source #

Subject being followed. The whole idea of Follow is being able to build strategies to gather URIs for the content published about any subject.

Constructors

Subject 

Fields

Instances
Eq Subject Source # 
Instance details

Defined in Follow.Types

Methods

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

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

Show Subject Source # 
Instance details

Defined in Follow.Types

FromJSON Subject #
  title: Title
  description: Description
  tags: [tag_1, tag_2]
  
Instance details

Defined in Follow.Parser

data Entry Source #

An item of content that has been published somewhere.

Constructors

Entry 

Fields

Instances
Eq Entry Source # 
Instance details

Defined in Follow.Types

Methods

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

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

Show Entry Source # 
Instance details

Defined in Follow.Types

Methods

showsPrec :: Int -> Entry -> ShowS #

show :: Entry -> String #

showList :: [Entry] -> ShowS #

FromJSON ComparisonFunction #
  type: by_field
  options:
    field: title
  
Instance details

Defined in Follow.Parser

FromJSON Predicate #
  type: equal
  options:
    field: title
    value: Title
  

or

  type: less
  options:
    field: publish_date
    value: 2018-08-08 00:00:00
  

or

  type: greater
  options:
    field: publish_date
    value: 2018-08-08 00:00:00
  

or

  type: infix
  options:
    field: title
    value: something
  

or

  type: prefix
  options:
    field: title
    value: The
  

or

  type: suffix
  options:
    field: title
    value: end
  

or

  type: not
  options:
    operator: # See Predicate instance
  

or

  type: and
  options:
    operator1: # See Predicate instance
    operator2: # See Predicate instance
  

or

  type: or
  options:
    operator1: # See Predicate instance
    operator2: # See Predicate instance
  
Instance details

Defined in Follow.Parser

(MonadThrow m, MonadHttp m) => FromJSON (Fetched m) #
  type: feed
  options:
    url: http://someurl.com
  

or

  type: webscraping
  options:
    url: http://someurl.com
    selector: # See Selector instance
  
Instance details

Defined in Follow.Parser

type Fetched m = m [Entry] Source #

Entries fetched usually from the outside world.

type EntryGetter a = Entry -> Maybe a Source #

Function that returns a field from an Entry. They are the - automatically generated methods for the Entry record.

data Directory Source #

Gathering of Item published for some Subject.

Constructors

Directory 

Fields

Instances
Eq Directory Source # 
Instance details

Defined in Follow.Types

Show Directory Source # 
Instance details

Defined in Follow.Types

FromJSON Middleware #
  type: decode
  options:
    encoding: # See Encoding instance
 

or

  type: sort
  options:
    function: # See ComparisonInstance instance
 

or

  type: filter
  options:
    operation: # See Predicate instance
 
Instance details

Defined in Follow.Parser

type Step m = (Fetched m, [Middleware]) Source #

A list of middlewares to be applied to some fetched entries.

type Middleware = Directory -> Directory Source #

Middleware does something to a directory.

type Digester a = Directory -> a Source #

Digesters are strategies to transform a directory into something to be consumed by an end user.