Cover Material, Copyright, and License
Preface
- Requests from the Author
- Structure of the Book
- Code Examples
- Functional Programming Requires a Different Mind Set
- eBooks Are Living Documents
- Setting Up Your Development Environment
- Why Haskell?
- Enjoy Yourself
- Acknowledgements
Section 1 - Tutorial
Tutorial on Pure Haskell Programming
- Interactive GHCi Shell
- Introduction to Haskell Types
- Functions Are Pure
- Using Parenthesis or the Special $ Character and Operator Precedence
- Lazy Evaluation
- Understanding List Comprehensions
- Haskell Rules for Indenting Code
- Understanding let and where
- Conditional do Expressions and Anonymous Functions
- Maps
- Sets
- More on Functions
- Comments on Dealing With Immutable Data and How to Structure Programs
- Error Handling
- Testing Haskell Code
- Pure Haskell Wrap Up
Tutorial on Impure Haskell Programming
- Hello IO () Monad
- A Note About >> and >>= Operators
- Console IO Example with Stack Configuration
- File IO
- Error Handling in Impure Code
- Network IO
- A Haskell Game Loop that Maintains State Functionally
- A More Detailed Look at Monads
- Using Applicative Operators <$> and <*>: Finding Common Words in Files
- List Comprehensions Using the do Notation
- Dealing With Time
- Using Debug.Trace
- Wrap Up
Section 2 - Cookbook
Using the OpenAI Large Language Model APIs in Haskell
- Example Client Code
- Adding a Simple Application: Find Place Names in Input Text
A Web Application For Using the Google Gemini APIs
- Web App Wrap Up and a Description of Scotty Web Framework
Command Line Utility To Use the Google Gemini APIs
Command Line Tool to Use Local Ollama LLM Server
Using the Brave Search API
Text Processing
- CSV Spreadsheet Files
- JSON Data
- Cleaning Natural Language Text
Natural Language Processing Tools
- Resolve Entities in Text to DBPedia URIs
- Bag of Words Classification Model
- Text Summarization
- Part of Speech Tagging
- Natural Language Processing Wrap Up
Linked Data and the Semantic Web
- The SPARQL Query Language
- A Haskell HTTP Based SPARQL Client
- Querying Remote SPARQL Endpoints
- Linked Data and Semantic Web Wrap Up
Implementing a Simple RDF Datastore With Partial SPARQL Support
- In-memory Example Using a Pattern Matching Query Syntax
- In-memory Example Using a Simplified SPARQL Query Syntax
- Wrap Up
Web Scraping
- Web Scraping Wrap Up
Using Relational Databases
- Database Access for Sqlite
- Database Access for Postgres
Data Analysis in Haskell with DataFrame
- Setup and Boilerplate
- Loading Data and Summary Statistics
- Deriving New Columns
- Filtering and Selection
- Sorting
- Grouping and Aggregation
- Writing Data to Files
Haskell Program to Play the Blackjack Card Game
Section 3 - Larger Projects
Knowledge Graph Creator
- Code Layout For the KGCreator Project and strategies for sharing Haskell code between projects
- The Main Event: Detecting Entities in Text
- Utility Code for Generating RDF
- Utility Code for Generating Cypher Input Data for Neo4J
- Top Level API Code for Handling Knowledge Graph Data Generation
- Wrap Up for Automating the Creation of Knowledge Graphs
Hybrid Haskell and Python Natural Language Processing
- Example Use of the Haskell NLP Client
- Setting up the Python NLP Server
- Understanding the Haskell NLP Client Code
- Wrap Up for Using the Python SpaCy NLP Service
Hybrid Haskell and Python For Coreference Resolution
- Installing the Python Coreference Server
- Understanding the Haskell Coreference Client Code
- Key Points
- Wrap Up for Using the Python Coreference NLP Service
Book Wrap Up
- Using Haskell for Modern AI Applications
Appendix A - Haskell Tools Setup
- stack
- Emacs Setup
- Do you want more of an IDE-like Development Environment?
- hlint

