evaluateCreate evaluates parsed CreateExpr to create a new table and add columns to it.
+ First argument is parsed CreateExpr
+ Second argument is databse instance
\ No newline at end of file
diff --git a/docs/Database.html b/docs/Database.html
new file mode 100644
index 0000000..faa9723
--- /dev/null
+++ b/docs/Database.html
@@ -0,0 +1,65 @@
+Database
containsColumn returns True if table within database contains a column, o/w false
+ First argument is column name
+ Second argument is database (Maybe Database)
+ Third argument is table name
getColumn returns column in specific table of a database (Maybe Column)
+ First argument is name of column (String)
+ Second argument is table (Maybe Table)
addNewTable adds an empty table to database and returns new database (Maybe Database)
+ First argument is tableName (String)
+ Second argument is database (Maybe Database)
addColumnToTable adds a column to a table and returns new table (Table)
+ First argument is column name (String)
+ Second argument is column datatype (Datatype)
+ Third argumenr is old table (Table)
addColumn adds a column to specific table in database and returns new database (Maybe Database)
+ First argument is column name (String)
+ Second argumenr is column datatype (Datatype)
+ Third argumenr is database (Maybe Database)
+ Fourth argumenr is table name (String)
insertOne inserts one entry in one column of one table in a database
+ First argument is value (String)
+ Second argument is it's datatype (Datatype)
+ Third argument is old database (Maybe Database)
+ Fourth argument is table name (String)
+ Fifth argumenr is column name (String)
isValidDatatype checks if datatypes corresponding to column names list are in sync with the table in database or not. Returns true if they both conform
+ First argumenr is table (Maybe Table)
+ Second argument is list of column names [String]
+ Third argument is list of datatypes [Datatype]
insert inserts an entry (row) in database -> table and returns new database
+ First argumenr is list of colNames [String]
+ Second argument is corresponding list of values [String]
+ Third argumenr is corresponding list of datatypes [Datatype]
+ Fourth argument old database (Maybe Database)
+ Fifth argument is table name (String)
insertDefault inserts an entry in the default column order. This does not check for datatype as of now.
+ First argument is list of values
+ Second argument is old database
+ Third argument is tableName
findEntryAtIndex finds entry at index in table and returns as [tuples] where tuple = (col name, col type, col value)
+ First argument is tableName
+ Second argument is database
+ Third argument is index
find finds all entries in (db -> table) with value, datype and returns as [entries] where entry=[tuples] where tuple = (col name, col type, col value)
+ First argument is value (Right) ValueExpr that evaluates to true or false
+ Second argument is database (Maybe Database)
+ Third argument is table name
deleteEntryAtIndex deletes an entry from the table
+ First argument is the index in table for the entry to be deleted
+ Second argument is the database (Maybe Database)
+ Third argument is table name
deleteEntryAtIndices is used to delete multiple entries from a specific table of a database
+ First argument is list of indices [Int]
+ Second argument is database (Maybe Database)
+ Third argumenr is table name (String)
delete deletes all entries that follow a specific condition from a table
+ First argument is condition
+ Second argument is Maybe Database
+ Third argument is table name (String)
orderBy orders the entries given by find based on the value given by expression
+ First argument is the expression that gives the deciding value
+ Second argument is the entrylist returned by find / select
select selects specific columns from the output of find/orderBy and returns list of entries with those columns only
+ First argument is column alias (if new name of the columns is needed, then this is used). If this is empty, all columns with default names are returned
+ Second argument is output of find/orderBy
\ No newline at end of file
diff --git a/docs/DeleteParser.html b/docs/DeleteParser.html
new file mode 100644
index 0000000..e5021ca
--- /dev/null
+++ b/docs/DeleteParser.html
@@ -0,0 +1,3 @@
+DeleteParser
evaluateDelete evaluates parsed DeleteExpr to delete rows in database table
+ First argument is parsed DeleteExpr
+ Second argument is databse instance
\ No newline at end of file
diff --git a/docs/ExpressionParser.html b/docs/ExpressionParser.html
new file mode 100644
index 0000000..2c1b264
--- /dev/null
+++ b/docs/ExpressionParser.html
@@ -0,0 +1,11 @@
+ExpressionParser
evaluate evaluates a parsed ValueExpr to integer EvalType if possible otherwise Exception
+ First argument is map of variables and corresponding values.
+ Second argument is a parsed expression type.
evaluate2 evaluates a parsed ValueExpr to boolean EvalTypeif possible otherwise Exception
+ First argument is map of variables and corresponding values.
+ Second argument is a parsed expression type.
evaluateExpr evaluates a ValueExpr to Integer if possible otherwise Exception
+ First argument is map of variables and corresponding values.
+ Second argument is a parsed expression (ValueExpr) type.
evaluateExpr2 evaluates a ValueExpr to Bool if possible otherwise Exception
+ First argument is map of variables and corresponding values.
+ Second argument is a parsed expression (ValueExpr) type.
\ No newline at end of file
diff --git a/docs/Funcs.html b/docs/Funcs.html
new file mode 100644
index 0000000..95b5613
--- /dev/null
+++ b/docs/Funcs.html
@@ -0,0 +1,4 @@
+Funcs
\ No newline at end of file
diff --git a/docs/HaSSQL.haddock b/docs/HaSSQL.haddock
new file mode 100644
index 0000000..95cf0cb
Binary files /dev/null and b/docs/HaSSQL.haddock differ
diff --git a/docs/HaSSQL.txt b/docs/HaSSQL.txt
new file mode 100644
index 0000000..d5e50cd
--- /dev/null
+++ b/docs/HaSSQL.txt
@@ -0,0 +1,553 @@
+-- Hoogle documentation, generated by Haddock
+-- See Hoogle, http://www.haskell.org/hoogle/
+
+
+-- | Haskell Simple Structured Query Language
+--
+-- Please see the README on GitHub at
+-- https://github.com/shraiysh/hasql#readme
+@package HaSSQL
+@version 1.0.0
+
+
+module Funcs
+
+-- | The regularParse parses a expression regularlly
+regularParse :: Parser a -> String -> Either ParseError a
+
+-- | The parseWithEof is a wrapper that throws error if you haven’t
+-- consumed all the input
+parseWithEof :: Parser a -> String -> Either ParseError a
+
+-- | The parseWithLeftOver is wrapper that tell you what was not
+-- consumed from the input by input parser
+parseWithLeftOver :: Parser a -> String -> Either ParseError (a, String)
+
+-- | The parseWithWSEof wrapper allows parsing when input constains
+-- and leading whitespaces
+parseWithWSEof :: Parser a -> String -> Either ParseError a
+
+-- | The lexeme is wrapper parser that eats up any following
+-- whitespaces after parsing.
+lexeme :: Parser a -> Parser a
+
+-- | The integer parses a integer constant
+integer :: Parser Integer
+
+-- | The identifier parses a identifier string
+identifier :: Parser String
+
+-- | The symbol parses a single character symbol or operator It
+-- takes string as arguments and comapres it with parsed string.
+symbol :: String -> Parser String
+
+-- | The comma parses comma
+comma :: Parser Char
+
+-- | The openParen parses Opening paranthesis
+openParen :: Parser Char
+
+-- | The closeParen parses closing paranthesis
+closeParen :: Parser Char
+
+-- | The keyowrd parses a occurence of string given as input It
+-- takes a string to pe parsed as only input
+keyword :: String -> Parser String
+
+-- | The parens function parses anything between opening and closing
+-- paranthesis
+parens :: Parser a -> Parser a
+
+-- | The identifierBlacklist parses only that identifiers that are
+-- not in blacklist It takes a blacklist of type List as an argument
+identifierBlacklist :: [String] -> Parser String
+
+-- | The whitespace parses any number of any type of whiespaces
+whitespace :: Parser ()
+
+-- | The keyword_ parses keywords and ignores them
+keyword_ :: String -> Parser ()
+
+-- | The symbol_ parses symbol and ignores them
+symbol_ :: String -> Parser ()
+
+-- | The commaSep1 parses comma seperated items and returns a list
+commaSep1 :: Parser a -> Parser [a]
+
+-- | The stringToken parses a string literal in single quotes
+stringToken :: Parser String
+
+-- | The boolToken parses boolean constants True and
+-- False
+boolToken :: Parser Bool
+
+
+module ExpressionParser
+
+-- | ValueExpr represnts a expression
+data ValueExpr
+
+-- | NumLit type constructor for integer constants that takes
+-- integer as argument
+NumLit :: Integer -> ValueExpr
+
+-- | Iden type constructor for identifier that takes string as
+-- argument
+Iden :: String -> ValueExpr
+
+-- | PrefOp for prefix operators that takes operator(String) and a
+-- ValueExpr
+PrefOp :: String -> ValueExpr -> ValueExpr
+
+-- | BinOp for binary operators that takes operator(String) and two
+-- ValueExpr
+BinOp :: ValueExpr -> String -> ValueExpr -> ValueExpr
+
+-- | Parens type constructor that ValueExpr as argument that
+-- is ought to be in parenthesis.
+Parens :: ValueExpr -> ValueExpr
+
+-- | StringLit type constructor for string literals that takes
+-- string as argument
+StringLit :: String -> ValueExpr
+
+-- | Star for * symbol
+Star :: ValueExpr
+
+-- | BoolLit type constructor for boolean constants that takes bool
+-- as argument
+BoolLit :: Bool -> ValueExpr
+
+-- | EvalType represnts a return type of evaluator
+data EvalType
+
+-- | EvalType holds am integral return type
+Int :: Integer -> EvalType
+
+-- | Boolean holds a boolean return type
+Boolean :: Bool -> EvalType
+
+-- | Error holds a error string
+Error :: String -> EvalType
+
+-- | num wraps a parsed integer literal in ValueExpr datatype
+num :: Parser ValueExpr
+
+-- | iden wraps a parsed identifier literal in ValueExpr
+-- datatype Argument is a blacklist
+iden :: [String] -> Parser ValueExpr
+
+-- | bolean wraps a parsed boolean literal in ValueExpr
+-- datatype
+boolean :: Parser ValueExpr
+
+-- | parensValue wraps a parsed parenthesis expression in
+-- ValueExpr datatype
+parensValue :: Parser ValueExpr
+
+-- | term contains all possible expression types
+term :: [String] -> Parser ValueExpr
+
+-- | table contains precedence, associativity of integer and boolean
+-- operators
+table :: [[Operator Char () ValueExpr]]
+
+-- | valueExpr parses a given string to ValueExpr datatype
+-- Input is a blacklist
+valueExpr :: [String] -> Parser ValueExpr
+
+-- | stringLit wraps a parsed string literal in ValueExpr
+-- datatype
+stringLit :: Parser ValueExpr
+
+-- | star wraps a parsed * keyword in ValueExpr
+-- datatype
+star :: Parser ValueExpr
+
+-- | evaluate evaluates a parsed ValueExpr to integer
+-- EvalType if possible otherwise Exception First argument is map
+-- of variables and corresponding values. Second argument is a parsed
+-- expression type.
+evaluate :: Map String ValueExpr -> Either ParseError ValueExpr -> EvalType
+
+-- | evaluate2 evaluates a parsed ValueExpr to boolean
+-- EvalTypeif possible otherwise Exception First argument is map
+-- of variables and corresponding values. Second argument is a parsed
+-- expression type.
+evaluate2 :: Map String ValueExpr -> Either ParseError ValueExpr -> EvalType
+
+-- | evaluateExpr evaluates a ValueExpr to Integer if
+-- possible otherwise Exception First argument is map of variables and
+-- corresponding values. Second argument is a parsed expression
+-- (ValueExpr) type.
+evaluateExpr :: Map String ValueExpr -> ValueExpr -> Integer
+
+-- | evaluateExpr2 evaluates a ValueExpr to Bool if possible
+-- otherwise Exception First argument is map of variables and
+-- corresponding values. Second argument is a parsed expression
+-- (ValueExpr) type.
+evaluateExpr2 :: Map String ValueExpr -> ValueExpr -> Bool
+instance GHC.Show.Show ExpressionParser.EvalType
+instance GHC.Classes.Eq ExpressionParser.EvalType
+instance GHC.Show.Show ExpressionParser.ValueExpr
+instance GHC.Classes.Eq ExpressionParser.ValueExpr
+
+
+module Database
+
+-- | sampleCommands is for debugging purposes.
+sampleCommands :: IO Integer
+
+-- | Column stores a column in a table as a list of its values along
+-- with the datatype and name of column
+data Column
+Column :: String -> Datatype -> [String] -> Column
+[cName] :: Column -> String
+[cDatatype] :: Column -> Datatype
+[cValues] :: Column -> [String]
+
+-- | newColumn Returns new column (Maybe Column) First argument is
+-- name of column Second argument is datatype Third argument is list of
+-- values
+newColumn :: String -> Datatype -> [String] -> Maybe Column
+
+-- | Table stores a map of columns (key is column Name) with table
+-- name and list of names of columns
+data Table
+Table :: String -> [String] -> Map String Column -> [Int] -> Table
+[tName] :: Table -> String
+[tColNameList] :: Table -> [String]
+[tColumns] :: Table -> Map String Column
+[tPKeys] :: Table -> [Int]
+
+-- | newTable returns new table (Maybe Table) First argument is
+-- table name Second argument is (list of colNames, Map of those colnames
+-- -> Columns)
+newTable :: String -> ([String], Map String Column) -> [Int] -> Maybe Table
+
+-- | Database stores a database with a name and map of tables
+-- indexed by their names
+data Database
+Database :: String -> Map String Table -> Database
+[dName] :: Database -> String
+[dTables] :: Database -> Map String Table
+
+-- | newDatabase returns new database (Maybe Database) First
+-- argument is datbase name Second argument map of tables indexed by
+-- their names
+newDatabase :: String -> Map String Table -> Maybe Database
+
+-- | Datatype is for datatype in a column
+data Datatype
+INT :: Datatype
+STRING :: Datatype
+BOOL :: Datatype
+
+-- | containsTable is True if database contains table, o/w False
+-- First argument is tableName Second argument is database object (Maybe
+-- database)
+containsTable :: String -> Maybe Database -> Bool
+
+-- | containsColumn returns True if table within database contains a
+-- column, o/w false First argument is column name Second argument is
+-- database (Maybe Database) Third argument is table name
+containsColumn :: String -> Maybe Database -> String -> Bool
+
+-- | getTable returns table from database (Maybe Table) First
+-- argument is table name Second argument is database (Maybe Database)
+getTable :: String -> Maybe Database -> Maybe Table
+
+-- | count returns the number of entries in a table First argument
+-- is table (Maybe Table)
+count :: Maybe Table -> Int
+
+-- | getColumn returns column in specific table of a database (Maybe
+-- Column) First argument is name of column (String) Second argument is
+-- table (Maybe Table)
+getColumn :: String -> Maybe Table -> Maybe Column
+
+-- | addNewTable adds an empty table to database and returns new
+-- database (Maybe Database) First argument is tableName (String) Second
+-- argument is database (Maybe Database)
+addNewTable :: String -> Maybe Database -> Maybe Database
+
+-- | addColumnToTable adds a column to a table and returns new table
+-- (Table) First argument is column name (String) Second argument is
+-- column datatype (Datatype) Third argumenr is old table (Table)
+addColumnToTable :: String -> Datatype -> Table -> Table
+
+-- | addColumn adds a column to specific table in database and
+-- returns new database (Maybe Database) First argument is column name
+-- (String) Second argumenr is column datatype (Datatype) Third argumenr
+-- is database (Maybe Database) Fourth argumenr is table name (String)
+addColumn :: String -> Datatype -> Maybe Database -> String -> Maybe Database
+
+-- | insertOne inserts one entry in one column of one table in a
+-- database First argument is value (String) Second argument is it's
+-- datatype (Datatype) Third argument is old database (Maybe Database)
+-- Fourth argument is table name (String) Fifth argumenr is column name
+-- (String)
+insertOne :: String -> Datatype -> Maybe Database -> String -> String -> Maybe Database
+
+-- | isValidDatatype checks if datatypes corresponding to column
+-- names list are in sync with the table in database or not. Returns true
+-- if they both conform First argumenr is table (Maybe Table) Second
+-- argument is list of column names [String] Third argument is list of
+-- datatypes [Datatype]
+isValidDatatype :: Maybe Table -> [String] -> [Datatype] -> Bool
+
+-- | addPrimaryKeyToTable adds one primary key to a table First
+-- argument is a table (Table)
+addPrimaryKeyToTable :: Table -> Table
+
+-- | addPrimaryKey adds one primary key to table in database First
+-- argument is database (Maybe Database) Second argument is table name
+-- (String)
+addPrimaryKey :: Maybe Database -> String -> Maybe Database
+
+-- | insert inserts an entry (row) in database -> table and
+-- returns new database First argumenr is list of colNames [String]
+-- Second argument is corresponding list of values [String] Third
+-- argumenr is corresponding list of datatypes [Datatype] Fourth argument
+-- old database (Maybe Database) Fifth argument is table name (String)
+insert :: [String] -> [String] -> [Datatype] -> Maybe Database -> String -> Maybe Database
+
+-- | insertDefault inserts an entry in the default column order.
+-- This does not check for datatype as of now. First argument is list of
+-- values Second argument is old database Third argument is tableName
+insertDefault :: [String] -> Maybe Database -> String -> Maybe Database
+
+-- | getColList is a Utility function for find*
+getColList :: String -> Maybe Database -> [Column]
+
+-- | findEntryAtIndex finds entry at index in table and returns as
+-- [tuples] where tuple = (col name, col type, col value) First argument
+-- is tableName Second argument is database Third argument is index
+findEntryAtIndex :: String -> Maybe Database -> Int -> [(Int, String, Datatype, String)]
+
+-- | litValue is a utility function to support evaluation of
+-- ValueExpr on columns (which are stored as String)
+litValue :: String -> Datatype -> ValueExpr
+
+-- | find finds all entries in (db -> table) with value, datype
+-- and returns as [entries] where entry=[tuples] where tuple = (col name,
+-- col type, col value) First argument is value (Right) ValueExpr that
+-- evaluates to true or false Second argument is database (Maybe
+-- Database) Third argument is table name
+find :: Either ParseError ValueExpr -> Maybe Database -> String -> [[(Int, String, Datatype, String)]]
+
+-- | deleteFromList is a utility function to delete an entry from a
+-- list
+deleteFromList :: Int -> [a] -> [a]
+
+-- | deleteEntryAtIndex deletes an entry from the table First
+-- argument is the index in table for the entry to be deleted Second
+-- argument is the database (Maybe Database) Third argument is table name
+deleteEntryAtIndex :: Int -> Maybe Database -> String -> Maybe Database
+
+-- | deleteEntryAtIndices is used to delete multiple entries from a
+-- specific table of a database First argument is list of indices [Int]
+-- Second argument is database (Maybe Database) Third argumenr is table
+-- name (String)
+deleteEntryAtIndices :: [Int] -> Maybe Database -> String -> Maybe Database
+
+-- | delete deletes all entries that follow a specific condition
+-- from a table First argument is condition Second argument is Maybe
+-- Database Third argument is table name (String)
+delete :: Either ParseError ValueExpr -> Maybe Database -> String -> Maybe Database
+
+-- | orderBy orders the entries given by find based on the value
+-- given by expression First argument is the expression that gives the
+-- deciding value Second argument is the entrylist returned by find /
+-- select
+orderBy :: Either ParseError ValueExpr -> [[(Int, String, Datatype, String)]] -> [[(Int, String, Datatype, String)]]
+
+-- | select selects specific columns from the output of find/orderBy
+-- and returns list of entries with those columns only First argument is
+-- column alias (if new name of the columns is needed, then this is
+-- used). If this is empty, all columns with default names are returned
+-- Second argument is output of find/orderBy
+select :: [(String, String)] -> [[(Int, String, Datatype, String)]] -> [[(Int, String, Datatype, String)]]
+instance GHC.Classes.Eq Database.Database
+instance GHC.Show.Show Database.Database
+instance GHC.Classes.Eq Database.Table
+instance GHC.Show.Show Database.Table
+instance GHC.Classes.Eq Database.Column
+instance GHC.Show.Show Database.Column
+instance GHC.Classes.Eq Database.Datatype
+instance GHC.Show.Show Database.Datatype
+
+
+module DeleteParser
+
+-- | DeleteExpr is a constructor type for Delete Queries.
+data DeleteExpr
+Delete :: ValueExpr -> ValueExpr -> DeleteExpr
+
+-- | iTname is name of the table
+[dTname] :: DeleteExpr -> ValueExpr
+
+-- | iWhere contains where clause expression
+[dWhere] :: DeleteExpr -> ValueExpr
+
+-- | deleteExpr' aggerates all parsers to parse CREATE query
+deleteExpr :: Parser DeleteExpr
+
+-- | makeDelete creates empty DeleteExpr object
+makeDelete :: DeleteExpr
+
+-- | evaluateDelete evaluates parsed DeleteExpr to delete
+-- rows in database table First argument is parsed DeleteExpr
+-- Second argument is databse instance
+evaluateDelete :: Either ParseError DeleteExpr -> Maybe Database -> Maybe Database
+instance GHC.Show.Show DeleteParser.DeleteExpr
+instance GHC.Classes.Eq DeleteParser.DeleteExpr
+
+
+module CreateParser
+
+-- | CreateExpr is a constructor for Create Queries
+data CreateExpr
+Create :: ValueExpr -> [(ValueExpr, Datatype)] -> CreateExpr
+
+-- | iTname is name of the table
+[iTname] :: CreateExpr -> ValueExpr
+
+-- | iColLists contains list of column names and their dataype
+-- values
+[iColLists] :: CreateExpr -> [(ValueExpr, Datatype)]
+
+-- | createExpr aggerates all parsers to parse CREATE query
+createExpr :: Parser CreateExpr
+
+-- | makeCreate creates empty CreateExpr object
+makeCreate :: CreateExpr
+
+-- | evaluateCreate evaluates parsed CreateExpr to create a
+-- new table and add columns to it. First argument is parsed
+-- CreateExpr Second argument is databse instance
+evaluateCreate :: Either ParseError CreateExpr -> Maybe Database -> Maybe Database
+instance GHC.Show.Show CreateParser.CreateExpr
+instance GHC.Classes.Eq CreateParser.CreateExpr
+
+
+module InsertParser
+
+-- | InsertExpr is a constructor type for Insert Queries
+data InsertExpr
+Insert :: ValueExpr -> [ValueExpr] -> [ValueExpr] -> InsertExpr
+
+-- | iTname is name of the table
+[iTable] :: InsertExpr -> ValueExpr
+
+-- | iColumns are name of columns
+[iColumns] :: InsertExpr -> [ValueExpr]
+
+-- | iValues are values to insert (NumLit, StringLit, BoolLit)
+[iValues] :: InsertExpr -> [ValueExpr]
+
+-- | insertExpr aggerates all parsers to parse INSERT query
+insertExpr :: Parser InsertExpr
+
+-- | makeInsert creates empty InsertExpr object
+makeInsert :: InsertExpr
+
+-- | evaluateInsert evaluates insert expression ans insert values to
+-- table First argument is InserExpr Second argument is database instance
+evaluateInsert :: Either ParseError InsertExpr -> Maybe Database -> Maybe Database
+instance GHC.Show.Show InsertParser.InsertExpr
+instance GHC.Classes.Eq InsertParser.InsertExpr
+
+
+module QueryParser
+
+-- | QueryExpr represents a SELECT statement
+data QueryExpr
+Select :: [(ValueExpr, Maybe String)] -> ValueExpr -> Maybe ValueExpr -> [ValueExpr] -> Maybe ValueExpr -> [ValueExpr] -> QueryExpr
+
+-- | qeSelectList contains list of selected columns
+[qeSelectList] :: QueryExpr -> [(ValueExpr, Maybe String)]
+
+-- | qeFromClause contains table name
+[qefromClause] :: QueryExpr -> ValueExpr
+
+-- | qeWhere contains where clause expression
+[qeWhere] :: QueryExpr -> Maybe ValueExpr
+
+-- | qeGroupBy contains list of groupby expresions
+[qeGroupBy] :: QueryExpr -> [ValueExpr]
+
+-- | qeHaving contains havingby expression
+[qeHaving] :: QueryExpr -> Maybe ValueExpr
+
+-- | qeOrderBy contains list of orderby clause expressions
+[qeOrderBy] :: QueryExpr -> [ValueExpr]
+
+-- | queryExpr aggregates all parsers to parse a SELECT statement
+queryExpr :: Parser QueryExpr
+
+-- | makeSelect makes a empty QueryExpr object
+makeSelect :: QueryExpr
+
+-- | evaluateQuery evaluates a query expression First argument is
+-- parsed query expression Second argument is Maybe Database instance
+evaluateQuery :: Either ParseError QueryExpr -> Maybe Database -> [[(Int, String, Datatype, String)]]
+instance GHC.Show.Show QueryParser.QueryExpr
+instance GHC.Classes.Eq QueryParser.QueryExpr
+
+
+module SQLParser
+
+-- | SQLExpr is a wrapping type constructor for Select, Insert and
+-- Delete statements. 'SELECT QueryExpr' contains
+data SQLExpr
+
+-- | Parses a SELECT query
+SELECT :: QueryExpr -> SQLExpr
+
+-- | Parses a INSERT Query
+INSERT :: InsertExpr -> SQLExpr
+
+-- | Parses a CREATE Query
+CREATE :: CreateExpr -> SQLExpr
+
+-- | Parses a DELETE Query
+DELETE :: DeleteExpr -> SQLExpr
+
+-- | ResType is a wrapping type constructor for the response types
+-- of each of the above statements.
+data ResType
+
+-- | Database instance for insert, create and delete queries
+DB :: Maybe Database -> ResType
+
+-- | Return object for SELECT queries
+OUT :: [[(Int, String, Datatype, String)]] -> ResType
+ERROR :: String -> ResType
+
+-- | sqlExpr describes an SQL expression.
+sqlExpr :: Parser SQLExpr
+
+-- | evaluateSQL evaluates each Expression using individual case
+-- statements
+evaluateSQL :: Either ParseError SQLExpr -> ResType -> ResType
+
+-- | getHeader returns string of headers of table First argument
+-- is list of headers
+getHeaders :: [(Int, String, Datatype, String)] -> String
+
+-- | getHeader returns string of depicting one entire row First
+-- argument is a row
+getRow :: [(Int, String, Datatype, String)] -> String
+
+-- | getRows prints the rows which are the output of select query
+-- The argument is output of select parsed query
+getRows :: [[(Int, String, Datatype, String)]] -> IO ()
+
+-- | queryPrinter prints the Select query output in a tabular
+-- fashion The argument is output of select parsed query
+queryPrinter :: ResType -> IO ()
+instance GHC.Show.Show SQLParser.ResType
+instance GHC.Classes.Eq SQLParser.ResType
+instance GHC.Show.Show SQLParser.SQLExpr
+instance GHC.Classes.Eq SQLParser.SQLExpr
diff --git a/docs/InsertParser.html b/docs/InsertParser.html
new file mode 100644
index 0000000..d0c43d6
--- /dev/null
+++ b/docs/InsertParser.html
@@ -0,0 +1,3 @@
+InsertParser
evaluateInsert evaluates insert expression ans insert values to table
+ First argument is InserExpr
+ Second argument is database instance
\ No newline at end of file
diff --git a/docs/QueryParser.html b/docs/QueryParser.html
new file mode 100644
index 0000000..66f7e2c
--- /dev/null
+++ b/docs/QueryParser.html
@@ -0,0 +1,3 @@
+QueryParser
evaluateQuery evaluates a query expression
+ First argument is parsed query expression
+ Second argument is Maybe Database instance
\ No newline at end of file
diff --git a/docs/SQLParser.html b/docs/SQLParser.html
new file mode 100644
index 0000000..200612e
--- /dev/null
+++ b/docs/SQLParser.html
@@ -0,0 +1,6 @@
+SQLParser
queryPrinter prints the Select query output in a tabular fashion
+ The argument is output of select parsed query
\ No newline at end of file
diff --git a/docs/doc-index.html b/docs/doc-index.html
new file mode 100644
index 0000000..a8163f4
--- /dev/null
+++ b/docs/doc-index.html
@@ -0,0 +1 @@
+HaSSQL-1.0.0: Haskell Simple Structured Query Language (Index)
insert into <table_name> (<column_name>,<column_name> ...) values (<value>, <value> ...)
+
To add entries in columns by default:
insert into <table_name> values (<value>, <<>value> ...)
+
Delete records
+
insert into <table_name> (<column_name>,<column_name> ...) values (<value>, <value> ...)
+
Select records
+
select <column_name> as <alias>, <column_name> as <alias> ... from <table_name> where <value_expession> order by <value_expession>, <value_expession> ...
+
select <column_name> <alias>, <column_name> <alias> ... from <table_name> where <value_expession> order by <value_expession>, <value_expession> ...
+
To select all columns:
select * from <table_name> where <value_expession> order by <value_expession>, <value_expession> ...<
{-|
+Module : CreateParser
+Description : contains functions to parse CREATE query and evaluate it.
+-}
+moduleCreateParser(
+CreateExpr(..),
+createExpr,
+makeCreate,evaluateCreate)where
+
+importText.Parsec.String(Parser)
+importText.ParserCombinators.Parsec.Char
+importText.ParserCombinators.Parsec.Combinator
+importText.Parsec(parse,ParseError,try)
+importControl.Applicative((<*),(<$>),(*>),(<|>),(<$),(<*>))
+importControl.Monad
+importqualifiedText.ParserCombinators.Parsec.ExprasE
+
+importData.Maybe()
+importFuncs
+importExpressionParser
+importDatabase
+
+-- |'int' parses INTEGER datatype
+int::ParserDatatype
+int=INT<$keyword"INTEGER"
+
+-- |'str' parses STRING datatype
+str::ParserDatatype
+str=STRING<$keyword"STRING"
+
+-- |'bool' parses BOOL datatype
+bool::ParserDatatype
+bool=BOOL<$keyword"BOOL"
+
+-- |'dtypeExpr' parses Datatypes
+dtypeExpr::ParserDatatype
+dtypeExpr=int<|>str<|>bool
+
+-- | 'CreateExpr' is a constructor for Create Queries
+dataCreateExpr=Create
+{iTname::ValueExpr-- ^ 'iTname' is name of the table
+,iColLists::[(ValueExpr,Datatype)]-- ^ 'iColLists' contains list of column names and their dataype values
+}deriving(Eq,Show)
+
+-- |'makeCreate' creates empty 'CreateExpr' object
+makeCreate::CreateExpr
+makeCreate=Create{iTname=Iden""
+,iColLists=[]
+}
+
+-- |'tabeName' parses name of the table
+tableName::ParserValueExpr
+tableName=keyword_"create"*>keyword_"table"*>iden[]
+
+-- |'column' parses column name and datatype as a tuple
+column::Parser(ValueExpr,Datatype)
+column=(,)<$>iden[]<*>dtypeExpr
+
+-- |'columnList' parses comma seperated columns as list
+columnList::Parser[(ValueExpr,Datatype)]
+columnList=parens(commaSep1column)
+
+-- |'createExpr' aggerates all parsers to parse CREATE query
+createExpr::ParserCreateExpr
+createExpr=Create<$>tableName<*>columnList
+
+-- |'addColumnList' is a recursive function to add columns to table
+-- First argument is column list (Name, Datatype)
+-- Second argument is Maybe Database instance
+-- Third argument is string (table name)
+addColumnList::[(ValueExpr,Datatype)]->MaybeDatabase->String->MaybeDatabase
+addColumnList[]dbtb=db
+addColumnList(x:xs)dbtb=addColumnListxs(addColumn(eval(fstx))(sndx)dbtb)tb
+
+eval::ValueExpr->String
+eval(Idens)=s
+
+-- |'evaluateCreate' evaluates parsed 'CreateExpr' to create a new table and add columns to it.
+-- First argument is parsed 'CreateExpr'
+-- Second argument is databse instance
+evaluateCreate::EitherParseErrorCreateExpr->MaybeDatabase->MaybeDatabase
+evaluateCreate(Rightexpr)db=do
+letdb_1=addNewTable(eval(iTnameexpr))db
+addColumnList(iColListsexpr)db_1(eval(iTnameexpr))
+
+
\ No newline at end of file
diff --git a/docs/src/Database.html b/docs/src/Database.html
new file mode 100644
index 0000000..0963cac
--- /dev/null
+++ b/docs/src/Database.html
@@ -0,0 +1,390 @@
+
\ No newline at end of file
diff --git a/docs/src/DeleteParser.html b/docs/src/DeleteParser.html
new file mode 100644
index 0000000..60bf379
--- /dev/null
+++ b/docs/src/DeleteParser.html
@@ -0,0 +1,54 @@
+
{-|
+Module : DeleteParser
+Description : contains functions to parse DELETE query and evaluate it.
+-}
+moduleDeleteParser(
+DeleteExpr(..),
+deleteExpr,
+makeDelete,evaluateDelete)where
+
+importText.Parsec.String(Parser)
+importText.ParserCombinators.Parsec.Char
+importText.ParserCombinators.Parsec.Combinator
+importText.Parsec(parse,ParseError,try)
+importControl.Applicative((<*),(<$>),(*>),(<|>),(<$),(<*>))
+importControl.Monad
+importqualifiedText.ParserCombinators.Parsec.ExprasE
+
+importData.Maybe()
+importFuncs
+importExpressionParser
+importDatabase
+
+-- | 'DeleteExpr' is a constructor type for Delete Queries.
+dataDeleteExpr=Delete
+{dTname::ValueExpr-- ^ 'iTname' is name of the table
+,dWhere::ValueExpr-- ^ 'iWhere' contains where clause expression
+}deriving(Eq,Show)
+
+-- |'makeDelete' creates empty 'DeleteExpr' object
+makeDelete::DeleteExpr
+makeDelete=Delete{dTname=Iden""
+,dWhere=BoolLitFalse
+}
+
+-- |'tabeName' parses name of the table
+tableName::ParserValueExpr
+tableName=keyword_"delete"*>keyword_"from"*>iden[]
+
+-- |'whereClause' parses where clause
+whereClause::ParserValueExpr
+whereClause=keyword_"where"*>valueExpr[]
+
+-- |deleteExpr' aggerates all parsers to parse CREATE query
+deleteExpr::ParserDeleteExpr
+deleteExpr=Delete<$>tableName<*>whereClause
+
+eval::ValueExpr->String
+eval(Idens)=s
+
+-- |'evaluateDelete' evaluates parsed 'DeleteExpr' to delete rows in database table
+-- First argument is parsed 'DeleteExpr'
+-- Second argument is databse instance
+evaluateDelete::EitherParseErrorDeleteExpr->MaybeDatabase->MaybeDatabase
+evaluateDelete(Rightexpr)db=delete(Right(dWhereexpr))db(eval(dTnameexpr))
\ No newline at end of file
diff --git a/docs/src/ExpressionParser.html b/docs/src/ExpressionParser.html
new file mode 100644
index 0000000..9434a55
--- /dev/null
+++ b/docs/src/ExpressionParser.html
@@ -0,0 +1,149 @@
+
\ No newline at end of file
diff --git a/docs/src/Funcs.html b/docs/src/Funcs.html
new file mode 100644
index 0000000..5acb3e7
--- /dev/null
+++ b/docs/src/Funcs.html
@@ -0,0 +1,115 @@
+
{-|
+Module : Funcs
+Description : Contains standard parsers for building up other parsers
+-}
+moduleFuncswhere
+importText.Parsec.String(Parser)
+importText.Parsec(parse,ParseError,try)
+importText.ParserCombinators.Parsec.Char(oneOf,digit,string,anyChar,char,letter)
+importText.ParserCombinators.Parsec.Combinator(many1,manyTill,anyToken,eof,choice,between
+,sepBy,sepBy1,optionMaybe)
+importControl.Applicative(many,(<*),(<$>),(*>),(<|>),(<$),(<*>))
+importControl.Monad(void,guard)
+
+-- |The 'regularParse' parses a expression regularlly
+regularParse::Parsera->String->EitherParseErrora
+regularParsep=parsep""
+
+-- |The 'parseWithEof' is a wrapper that throws error if you haven’t consumed all the input
+parseWithEof::Parsera->String->EitherParseErrora
+parseWithEofp=parse(p<*eof)""
+
+-- |The 'parseWithLeftOver' is wrapper that tell you what was not consumed from the input by input parser
+parseWithLeftOver::Parsera->String->EitherParseError(a,String)
+parseWithLeftOverp=parse((,)<$>p<*>leftOver)""
+whereleftOver=manyTillanyTokeneof
+
+-- |The 'parseWithWSEof' wrapper allows parsing when input constains and leading whitespaces
+parseWithWSEof::Parsera->String->EitherParseErrora
+parseWithWSEofp=parseWithEof(whiteSpace*>p)
+wherewhiteSpace=void$many$oneOf" \n\t"
+
+-- |The 'lexeme' is wrapper parser that eats up any following whitespaces after parsing.
+lexeme::Parsera->Parsera
+lexemep=p<*whitespace
+
+-- |The 'integer' parses a integer constant
+integer::ParserInteger
+integer=read<$>lexeme(many1digit)
+
+-- |The 'identifier' parses a identifier string
+identifier::ParserString
+identifier=lexeme((:)<$>firstChar<*>manynonFirstChar)
+where
+firstChar=letter<|>char'_'
+nonFirstChar=digit<|>firstChar
+
+-- |The 'symbol' parses a single character symbol or operator
+-- It takes string as arguments and comapres it with parsed string.
+symbol::String->ParserString
+symbols=try$lexeme$do
+u<-many1(oneOf"<>=+-^%/*!|")
+guard(s==u)
+returns
+
+-- |The 'comma' parses comma
+comma::ParserChar
+comma=lexeme$char','
+
+-- |The 'openParen' parses Opening paranthesis
+openParen::ParserChar
+openParen=lexeme$char'('
+
+-- |The 'closeParen' parses closing paranthesis
+closeParen::ParserChar
+closeParen=lexeme$char')'
+
+-- |The 'keyowrd' parses a occurence of string given as input
+-- It takes a string to pe parsed as only input
+keyword::String->ParserString
+keywordk=try$do
+i<-identifier
+guard(i==k)
+returnk
+
+-- |The 'parens' function parses anything between opening and closing paranthesis
+parens::Parsera->Parsera
+parens=betweenopenParencloseParen
+
+-- |The 'identifierBlacklist' parses only that identifiers that are not in blacklist
+-- It takes a blacklist of type List as an argument
+identifierBlacklist::[String]->ParserString
+identifierBlacklistbl=do
+i<-identifier
+guard(i`notElem`bl)
+returni
+
+-- |The 'whitespace' parses any number of any type of whiespaces
+whitespace::Parser()
+whitespace=void$many(oneOf" \t\n")
+
+-- |The 'keyword_' parses keywords and ignores them
+keyword_::String->Parser()
+keyword_=void.keyword
+
+-- |The 'symbol_' parses symbol and ignores them
+symbol_::String->Parser()
+symbol_=void.symbol
+
+-- |The 'commaSep1' parses comma seperated items and returns a list
+commaSep1::Parsera->Parser[a]
+commaSep1=(`sepBy1`comma)
+
+-- |The 'stringToken' parses a string literal in single quotes
+stringToken::ParserString
+stringToken=lexeme(char'\''*>manyTillanyChar(char'\''))
+
+-- |The 'boolToken' parses boolean constants 'True' and 'False'
+boolToken::ParserBool
+boolToken=do
+i<-identifier
+guard(i`elem`["True","False"])
+ifi=="True"
+thenreturnTrue
+elsereturnFalse
+
\ No newline at end of file
diff --git a/docs/src/InsertParser.html b/docs/src/InsertParser.html
new file mode 100644
index 0000000..902db58
--- /dev/null
+++ b/docs/src/InsertParser.html
@@ -0,0 +1,79 @@
+
\ No newline at end of file
diff --git a/docs/src/Paths_HaSSQL.html b/docs/src/Paths_HaSSQL.html
new file mode 100644
index 0000000..b693401
--- /dev/null
+++ b/docs/src/Paths_HaSSQL.html
@@ -0,0 +1,51 @@
+
\ No newline at end of file
diff --git a/docs/src/QueryParser.html b/docs/src/QueryParser.html
new file mode 100644
index 0000000..bef095b
--- /dev/null
+++ b/docs/src/QueryParser.html
@@ -0,0 +1,122 @@
+
{-|
+Module : QueryParser
+Description : contains functions to parse SELECT query and evaluate it.
+-}
+moduleQueryParser(
+QueryExpr(..),
+queryExpr,
+makeSelect,evaluateQuery)where
+
+importText.Parsec.String(Parser)
+importText.ParserCombinators.Parsec.Char
+importText.ParserCombinators.Parsec.Combinator
+importText.Parsec(parse,ParseError,try)
+importControl.Applicative((<*),(<$>),(*>),(<|>),(<$),(<*>))
+importControl.Monad
+importqualifiedText.ParserCombinators.Parsec.ExprasE
+
+importData.Maybe()
+importFuncs
+importExpressionParser
+importDatabase
+
+-- |'QueryExpr' represents a SELECT statement
+dataQueryExpr=Select
+{qeSelectList::[(ValueExpr,MaybeString)]-- ^ 'qeSelectList' contains list of selected columns
+,qefromClause::ValueExpr-- ^ 'qeFromClause' contains table name
+,qeWhere::MaybeValueExpr-- ^ 'qeWhere' contains where clause expression
+,qeGroupBy::[ValueExpr]-- ^ 'qeGroupBy' contains list of groupby expresions
+,qeHaving::MaybeValueExpr-- ^ 'qeHaving' contains havingby expression
+,qeOrderBy::[ValueExpr]-- ^ 'qeOrderBy' contains list of orderby clause expressions
+}deriving(Eq,Show)
+
+-- |'makeSelect' makes a empty 'QueryExpr' object
+makeSelect::QueryExpr
+makeSelect=Select{qeSelectList=[]
+,qefromClause=Iden""
+,qeWhere=Nothing
+,qeGroupBy=[]
+,qeHaving=Nothing
+,qeOrderBy=[]}
+
+-- |'selectList' parses comma seperated 'selectItem'
+selectList::Parser[(ValueExpr,MaybeString)]
+selectList=keyword_"select"*>commaSep1selectItem
+
+-- |'selectItem' parses selected list names and their alias
+selectItem::Parser(ValueExpr,MaybeString)
+selectItem=(,)<$>valueExpr[]<*>optionMaybe(tryalias)
+wherealias=optional(keyword_"as")*>identifierBlacklist["from","where","group","having","order"]
+
+-- |'fromClause' parses from gets table name
+fromClause::ParserValueExpr
+fromClause=keyword_"from"*>iden["from","where","group","having","order"]
+
+-- |'whereClause' parses where clause
+whereClause::ParserValueExpr
+whereClause=keyword_"where"*>valueExpr[]
+
+-- |'groupByClause' parses group by clauses as list
+groupByClause::Parser[ValueExpr]
+groupByClause=keyword_"group"*>keyword_"by"
+*>commaSep1(valueExpr[])
+
+-- |'having' parses having by clause
+having::ParserValueExpr
+having=keyword_"having"*>(valueExpr[])
+
+-- |'orderBy' parses order by clauses as lists
+orderByClause::Parser[ValueExpr]
+orderByClause=keyword_"order"*>keyword_"by"
+*>commaSep1(valueExpr[])
+
+-- |'queryExpr' aggregates all parsers to parse a SELECT statement
+queryExpr::ParserQueryExpr
+queryExpr=Select
+<$>selectList
+<*>fromClause
+<*>optionMaybewhereClause
+<*>option[]groupByClause
+<*>optionMaybehaving
+<*>option[]orderByClause
+
+eval::ValueExpr->String
+eval(Idens)=s
+
+-- |'evalWhere' evaluates a where clause
+-- First argument is parsed where 'ValueExpr'
+-- Second argument is Maybe Database instance
+-- Third arhument is table Name
+evalWhere::MaybeValueExpr->MaybeDatabase->String->[[(Int,String,Datatype,String)]]
+evalWhere(Justexpr)dbtname=find(Rightexpr)dbtname
+evalWhere(Nothing)dbtname=find(Right(BoolLitTrue))dbtname
+
+-- |'evalOrderBy' evaluates a order by clause
+-- First argument is parsed orderby 'ValueExpr' list
+-- Second argument is output of where clause
+evalOrderBy::[ValueExpr]->[[(Int,String,Datatype,String)]]->[[(Int,String,Datatype,String)]]
+evalOrderBy[]out=out
+evalOrderBy(x:xs)out=evalOrderByxs(orderBy(Rightx)out)
+
+-- |'evalSelect' converts select lists to String tuples
+-- First argument is parsed select list
+evalSelect::[(ValueExpr,MaybeString)]->[(String,String)]
+evalSelect[(Star,Nothing)]=[]
+evalSelect[]=[]
+evalSelect(x:xs)=do
+case(sndx)of
+Nothing->(eval(fstx),eval(fstx)):evalSelectxs
+Justy->(eval(fstx),y):evalSelectxs
+
+-- |'evaluateQuery' evaluates a query expression
+-- First argument is parsed query expression
+-- Second argument is Maybe Database instance
+evaluateQuery::EitherParseErrorQueryExpr->MaybeDatabase->[[(Int,String,Datatype,String)]]
+evaluateQuery(Rightexpr)db=do
+letout1=evalWhere(qeWhereexpr)db(eval(qefromClauseexpr))
+letout2=evalOrderBy(qeOrderByexpr)out1
+select(evalSelect(qeSelectListexpr))out2
+
+
+
+
\ No newline at end of file
diff --git a/docs/src/SQLParser.html b/docs/src/SQLParser.html
new file mode 100644
index 0000000..6d2a4d9
--- /dev/null
+++ b/docs/src/SQLParser.html
@@ -0,0 +1,81 @@
+
{-|
+Module: SQLParser
+Description: Integrate all SQL statements into a single module
+-}
+moduleSQLParserwhere
+importText.Parsec.String(Parser)
+importText.Parsec.Error(ParseError)
+importText.Parsec(parse)
+importText.ParserCombinators.Parsec.Combinator(eof)
+importControl.Applicative((<*),(<$>),(*>),(<|>),(<$),(<*>))
+importFuncs
+importExpressionParser
+importQueryParser
+importInsertParser
+importCreateParser
+importDeleteParser
+importDatabase
+importData.Map(Map)
+importqualifiedData.MapasMap
+
+-- | 'SQLExpr' is a wrapping type constructor for Select, Insert and Delete statements.
+-- 'SELECT QueryExpr' contains
+dataSQLExpr=SELECTQueryExpr-- ^Parses a SELECT query
+|INSERTInsertExpr-- ^ Parses a INSERT Query
+|CREATECreateExpr-- ^ Parses a CREATE Query
+|DELETEDeleteExpr-- ^ Parses a DELETE Query
+deriving(Eq,Show)
+
+-- | 'ResType' is a wrapping type constructor for the response types of each of the above statements.
+dataResType=DB(MaybeDatabase)-- ^ Database instance for insert, create and delete queries
+|OUT([[(Int,String,Datatype,String)]])-- ^ Return object for SELECT queries
+|ERRORStringderiving(Eq,Show)
+-- | 'sqlExpr' describes an SQL expression.
+sqlExpr::ParserSQLExpr
+sqlExpr=(SELECT<$>queryExpr)<|>(INSERT<$>insertExpr)<|>(CREATE<$>createExpr)<|>(DELETE<$>deleteExpr)
+
+-- | 'evaluateSQL' evaluates each Expression using individual case statements
+evaluateSQL::EitherParseErrorSQLExpr->ResType->ResType
+evaluateSQL(Rightexpr)(DBdb)=do
+caseexprof
+SELECTe->OUT(evaluateQuery(Righte)db)
+INSERTe->DB(evaluateInsert(Righte)db)
+CREATEe->DB(evaluateCreate(Righte)db)
+DELETEe->DB(evaluateDelete(Righte)db)
+evaluateSQL(Lefterror)db=ERROR(showerror)
+
+-- |'getHeader' returns string of headers of table
+-- First argument is list of headers
+getHeaders::[(Int,String,Datatype,String)]->String
+getHeaders[]=""
+getHeaders((d,a,b,c):xs)=(a++" ("++(showb)++"), ")++(getHeadersxs)
+
+-- |'getHeader' returns string of depicting one entire row
+-- First argument is a row
+getRow::[(Int,String,Datatype,String)]->String
+getRow[]=""
+getRow((d,a,b,c):xs)=(c++", ")++(getRowxs)
+
+-- |'getRows' prints the rows which are the output of select query
+-- The argument is output of select parsed query
+getRows::[[(Int,String,Datatype,String)]]->IO()
+getRows[]=putStr""
+getRows(x:xs)=putStrLn((let(a,b,c,d)=headxinshowa++", ")++getRowx)*>(getRowsxs)
+
+-- |'queryPrinter' prints the Select query output in a tabular fashion
+-- The argument is output of select parsed query
+queryPrinter::ResType->IO()
+queryPrinter(OUToutput)=do
+caseoutputof
+[]->print("")
+otherwise->putStrLn("------------------------------------------------------------")
+*>putStrLn("PK, "++getHeaders(headoutput))
+*>putStrLn("------------------------------------------------------------")
+*>(getRowsoutput)
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/src/highlight.js b/docs/src/highlight.js
new file mode 100644
index 0000000..1e903bd
--- /dev/null
+++ b/docs/src/highlight.js
@@ -0,0 +1,27 @@
+
+var highlight = function (on) {
+ return function () {
+ var links = document.getElementsByTagName('a');
+ for (var i = 0; i < links.length; i++) {
+ var that = links[i];
+
+ if (this.href != that.href) {
+ continue;
+ }
+
+ if (on) {
+ that.classList.add("hover-highlight");
+ } else {
+ that.classList.remove("hover-highlight");
+ }
+ }
+ }
+};
+
+window.onload = function () {
+ var links = document.getElementsByTagName('a');
+ for (var i = 0; i < links.length; i++) {
+ links[i].onmouseover = highlight(true);
+ links[i].onmouseout = highlight(false);
+ }
+};
diff --git a/docs/src/style.css b/docs/src/style.css
new file mode 100644
index 0000000..e83dc5e
--- /dev/null
+++ b/docs/src/style.css
@@ -0,0 +1,55 @@
+body {
+ background-color: #fdf6e3;
+}
+
+.hs-identifier {
+ color: #073642;
+}
+
+.hs-identifier.hs-var {
+}
+
+.hs-identifier.hs-type {
+ color: #5f5faf;
+}
+
+.hs-keyword {
+ color: #af005f;
+}
+
+.hs-string, .hs-char {
+ color: #cb4b16;
+}
+
+.hs-number {
+ color: #268bd2;
+}
+
+.hs-operator {
+ color: #d33682;
+}
+
+.hs-glyph, .hs-special {
+ color: #dc322f;
+}
+
+.hs-comment {
+ color: #8a8a8a;
+}
+
+.hs-pragma {
+ color: #2aa198;
+}
+
+.hs-cpp {
+ color: #859900;
+}
+
+a:link, a:visited {
+ text-decoration: none;
+ border-bottom: 1px solid #eee8d5;
+}
+
+a:hover, a.hover-highlight {
+ background-color: #eee8d5;
+}
diff --git a/docs/synopsis.png b/docs/synopsis.png
new file mode 100644
index 0000000..85fb86e
Binary files /dev/null and b/docs/synopsis.png differ