From 923a17f7ff7626841df0618e9128e47eff4017a8 Mon Sep 17 00:00:00 2001 From: Boyan Date: Sun, 16 Mar 2025 17:25:05 +0100 Subject: [PATCH] session 2 --- haskell/README.md | 6 ++++++ haskell/sessions/16_03/notes.md | 20 ++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/haskell/README.md b/haskell/README.md index b0147d7..c7a3c4a 100644 --- a/haskell/README.md +++ b/haskell/README.md @@ -38,3 +38,9 @@ Because it is the simplest recursive data structure. It is a recursive data stru The tree is simply too complex. Linked lists are easy. +## [16th of March - Deriving types] + +> How does one do this systematically? + +> Lazy and singly-linked lists, what's the relation? + diff --git a/haskell/sessions/16_03/notes.md b/haskell/sessions/16_03/notes.md index 389ff98..7b53e70 100644 --- a/haskell/sessions/16_03/notes.md +++ b/haskell/sessions/16_03/notes.md @@ -10,6 +10,10 @@ | Proof on lists | Proving properties of functions that operate on lists | 😕 | | Proof on trees/ADTs | Proving properties of functions that operate on trees or ADTs | 😕 | + +## Deducing types systematically + +### (:).(:) ```hs expr = (:) . (:) @@ -41,24 +45,24 @@ expr :: a -> [[a] -> [a]] -> [[a] -> [a]] ``` +### `f = \x y -> x (x (x y))` [^1] ```hs f = \x y -> x (x (x y)) ``` -Rigorous solution of the above. - - -## Look into +## Questions > How does one do the equations? -> CLI is functional lol +> CLI is functional? -> Lazy and singly-linked lists +> Lazy and singly-linked lists, what's the relation? -> Y combinator - ? +> Y combinator? ## Resources - [course](https://www.cis.upenn.edu/~cis1940/spring15/lectures.html) -- [standard list](https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-List.html) \ No newline at end of file +- [standard list](https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-List.html) + +[^1]: need to find the actual rigorous way of doing this \ No newline at end of file