diff --git a/CHANGELOG.md b/CHANGELOG.md index ac9e2cf..c934c84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - clean up project - fix nick of example bot in readme - remove `Haboli.Euphoria.Examples` module +- update `README.md` to reflect these changes ## 0.3.1.0 - add `Haboli.Euphoria` module diff --git a/README.md b/README.md index cbe340e..8758763 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,25 @@ supports all session and chat room commands listed in the For more information, see the haddock for the `Haboli.Euphoria.Client` and `Haboli.Euphoria.Api` modules. -## Example bot +## Bots -Here is a very basic example bot that replies to `!ping` with `Pong!`: +The library is built with flexibility and composability in mind. Because of +this, there is no special `Bot` monad — bots also run inside the `Client` monad. +However, there are a few convenience modules that make development of bots +easier. + +The convenience modules are built on top of the `Client` monad. None of the +convenience modules are necessary to create a functioning bot. When creating a +new bot, you can freely choose which modules to use and which to ignore or +replace with your own creations. + +For an example bot structure using the convenience modules, here is an +[example bot](src/Haboli/Euphoria/ExampleBot.hs). + +## Example client + +Here is a very basic example bot that replies to `!ping` with `Pong!`. It does +not use any of the provided convenience modules. ```haskell pingPongBot :: Client () () @@ -44,3 +60,11 @@ And here's how to run that bot: main :: IO () main = void $ runClient defaultConfig pingPongBot ``` + +## Lenses + +Haboli exports lenses for a few data types. The lenses are named like the record +accessors but suffixed with a `L`. For example, the lens corresponding to +`svNick` from `SessionView` is named `svNickL`. Lenses are not required to use +the libary. They are provided for the convenience of those who like using +lenses. diff --git a/haboli.cabal b/haboli.cabal index 4a27c41..6fca2d4 100644 --- a/haboli.cabal +++ b/haboli.cabal @@ -1,10 +1,10 @@ -cabal-version: 1.12 +cabal-version: 1.18 -- This file has been generated from package.yaml by hpack version 0.31.2. -- -- see: https://github.com/sol/hpack -- --- hash: 35dc75bb1fd8534c4476115b165d0e969a579affaa05a419abe6f7e3ab749082 +-- hash: 3ce7165a468ff6ccd5e098638b16268df6af5b8dbd4f0ac2e5490a29f6f15a37 name: haboli version: 0.3.1.0 @@ -22,6 +22,8 @@ extra-source-files: README.md CHANGELOG.md LICENSE +extra-doc-files: + README.md source-repository head type: git diff --git a/package.yaml b/package.yaml index 1185334..8f1d9cb 100644 --- a/package.yaml +++ b/package.yaml @@ -13,6 +13,9 @@ extra-source-files: - CHANGELOG.md - LICENSE +extra-doc-files: + - README.md + dependencies: - base >= 4.7 && < 5 - aeson diff --git a/src/Haboli/Euphoria.hs b/src/Haboli/Euphoria.hs index aa3e32f..656bf09 100644 --- a/src/Haboli/Euphoria.hs +++ b/src/Haboli/Euphoria.hs @@ -1,6 +1,6 @@ -- | This module reexports the most commonly used modules for convenience. For --- more detail on how this library works, check the "Haboli.Euphoria.Client" --- module's documentation. +-- more detail on how this library works, check the or the +-- "Haboli.Euphoria.Client" module's documentation. module Haboli.Euphoria ( module Haboli.Euphoria.Api