Skip to content

jobliz/haskell-example-scripts

Repository files navigation

haskell-example-scripts

A set of runnable examples I'm writing and/or gathering from across the web as I learn Haskell.

Environment setup

A quick Haskell environment from Ubuntu repositories:

apt install ghc cabal-install haskell-stack

but cabal is seemingly old and stack is the replacement to be used preferentially, and the downloaded stack version is outdated and gives errors, so also do:

stack upgrade

An updated binary should be be created at /home/your_user/.local/bin/stack, but I'm not entirely sure how to use stack yet. Big TODO.

Libraries:

cabal install split regex-posix regex-pcre csv cassava aeson parsec megaparsec parser-combinators

VS Code IDE setup (TODO: Language server installation and configuration):

Self-study outline

TODO: Think this carefully, explain achieved progress.

  • Basic language features, function definition, operators, if statements
  • Command line input parsing
  • Pattern matching in both function definitions and case notation
  • Playing around with higher-order functions, maybe some silly things
  • Using folds instead of recursion and looping
  • Using the type system to create simple data structures, and the algorithms to use them
  • Using the type system to create recursive data structures, and the algorithms to use them
  • Parsing simple log files using the type system to check each row
  • Parsing simple log files using regexes to match data instead of arbitrary string splitting
  • Parsing CSV using the type system to check each row
  • Parsing a simple mathematical language with only pattern matching and eval
  • Parsing a simple mathematical language with parser combinators
  • Parsing a simple imperative language with parser combinators

General introductory posts

Online books

Reddit links

Course sites - some free

Online tutorials on functional programming with Haskell

Online tutorials on Haskell and libraries

Simple imperative language parser links

Symbolic math

Other links

http://pleac.sourceforge.net/pleac_haskell/index.html

About

Haskell examples.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published