Skip to content

Haskell and Cryptocurrencies Notes (free course from IOG)

Notifications You must be signed in to change notification settings

jonathondilworth/haskell-notes

Repository files navigation

haskell-notes | README.md

These are my own notes, so take them for what they are. For instance, there may be some misleading details if I have misunderstood something; as far as learning materials go, these notes are here mainly as a source of 'self-help' - I tend to learn best through writing (or typing) things down and following exercises.

Haskell and Cryptocurrencies Notes

Course offered by IOG, you can find accompanying information within the builders / pioneers announcements @ the IOG discord technical server.

Questions Extracted From Notes

Welcome Lecture

Question: would it be accurate to say that the definition of 'hiding' (for hash functions) can be phrased such that: given a hash function H, an inverse function H' does not exist. Thus, given $h(x) = y$, $h^{-1}(y) = x$ does not exist?

Question: Given the statement regarding hash functions: "the input are arbitrary byte strings, so there are potentially infinitely many of those" - given that memory is discrete, how is it possible for there to be infinitely many input byte strings? Are we discussing hash functions in terms of their implementation on a discrete system, or their mathematical properties within 'the real world' / continuous space?

Question (this was discussed within the IOG Discord, but I don't think consensus was necessarily reached on the outcome of the question, so I'll raise it here): if one was to push two transactions to chain with the intent to have them validated within the same block, is there anything stopping the outputs from one transaction acting as the inputs to the other? Emphasis being on: both transactions are not yet validated, but have been pushed to chain (or an SPO mempool) in an ordered fashion, such that the first transaction is pushed first and the second has been pushed second; can the second transaction use outputs from the first transaction whilst both being validated within the same block? My apologies if there is an obvious answer or is this is a silly question. I would actually be interested in knowing if this is possible in both accounting based models and UTxO based models.

An Overview Of Haskell

Having unpaused the video and read some more about currying - probably spending too much time on this, but I am pretty sure I understand what is going on, but I suppose my question really would be: what would be a concise and intuitive definition of the concept of currying within Haskell?

Higher Order Functions

Do you want to maintain data structures and their respective content as 'abstract' as possible before performing any kind of evaluation in order to, for instance, maintain as much precision as possible, or is this a non-issue?

Week Two

TODO: Update this section.

Notes

  1. Welcome Lecture, Blockchains, Cryptocurrencies, Beyond Generic Blockchains, Ideals, Hashing Functions, Transactional Ordering, Digital Signatures, Forking, Consensus Protocols, Consensus Properties (Termination, Agreement, Strong Validity), Transactions, Blocks, Fees, IOHK, Haskell
  2. An overview of Haskell, Goals, History, Features, Algebraic Data Types, Type Inference, Type Classes, Data Constructors, Type Constructors, Polymorphism and Parametric Polymorphism, Referential Transparency, Eval, Functions, Nomenclature, Examples, Pattern Matching, Equational Reasoning, Currying, Symbolic Operators and Identifiers, Associativity of Infix Operators, Coding Examples (GHCi)
  3. Higher Order Functions, Alternative Implementations, Type-Directed Programming, More On Type Inference, Deriving Instances, Pure Functions, Lazy Evaluation, Summary
  4. Basics: Prelude, Data Structure Composition: Catamorphism, Modules / Dependencies: Hackage, Documentation & Haddock, Booleans (Data Type, Constructors, Examples), Pattern Matching, Typed Holes, Some More On Functions, Guards
  5. Maybe As A Type Constructor, Maybe As Parameterised By A Polymorphic Type Variable, Return In Haskell (Nothing), Functions Using Maybe, Pairs, Currying, Uncurrying
  6. Cons, Breaking Lists Down With Cons, List Constructors, Functions On Lists, Either, Elem, Append, Reverse, Filter
  7. Lookup Tables, Type Synonyms, Tables and Table Functions, Some More On Recursion & Filter, newtype Keyword, More On Immutability, Types For Modelling Data Structures, Records, Accessors, Functions (Algorithms?) That Operate On Data Structures (e.g. Transactions & Processing Transactions - A Naive, Yet Interesting Example)
  8. Binary Trees - Skipped Note Making (see notes on: Expression Trees as Algebraic Data Types & More in Plutus Notes.
  9. ASTs - Skipped Note Making (see above).

There won't be too many additions to this Repo for a short while as the third Cohort of PPP starts. I don't have much time (as it currently stands), so I'll mainly be concentrating on the third cohort and any (potentially commercial) projects.

Code Examples

  1. Basic Propositional Logic Implementation (prop.hs)
  2. Boilerplate Code For GHCi | Week One (week1.hs)
  3. Attempt #1 @ week1 exercise, TODO: come back to this
  4. Boilerplate Code For GHCi | Various Snippets (maintained across multiple weeks)

Authors Note

Having had some experience with Haskell as an undergraduate (a few years ago now), I realise (having taken the Plutus Pioneer Program) that I had only really scratched the surface. Thus, I reconsidered my goals, went back and undertook the introduction to Function Programming course provided by the University of Edinburgh (which I rate extremely highly).

I am about to start this course, I will update this README as I make some progress through the course. As always, my thanks to the course organisers, lecturers and TAs: Lars Brünjes, Andres Löh and Alejandro García.

Jan 9th 2022: I had to take about three weeks leave (during the holiday season) due to multiple (quite serious) reasons. I will be online and active as much as possible. This note will be erased when I can return to taking an actively full time role in this community and projects in general.


Other Courses I Have Undertaken (recently):

  • Plutus Pioneer Program Cohort Two - officially | 2021
  • Introduction to Functional Programming (INF1A) - unofficially | 2018
  • Blockchains and Distributed Ledgers (BDL)1 - unofficially | 2020

Footnotes

  1. I am still working my way through these lectures and making lecture notes, as I was fortunate enough to be temporarily enrolled on that course during my time at the University of Edinburgh, thus I was able to retain the teaching materials which, unfortunately, I cannot share. I can, however, share my notes which are listed below.

My Notes For Other Courses

Interesting Discussions and Materials

About

Haskell and Cryptocurrencies Notes (free course from IOG)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published