diff --git a/haskell/01-expressions/README.md b/haskell/01-expressions/README.md index c6f7464..fab33b6 100644 --- a/haskell/01-expressions/README.md +++ b/haskell/01-expressions/README.md @@ -20,6 +20,19 @@ Expression | Type (:t) | Value | Comment ## Unary Functions +Expression | Type (:t) | Value | Comment +--- | --- | --- | -------- +`sqrt(4)` | `Floating a => a` | `2.0` | +`sqrt 4` | `Floating a => a` | `2.0` | Similar `abs,negate,signum,recip` +`sqrt` | `Floating a => a -> a` | | +`sqrt 3^2 + 4^2` | `Floating a => a` | `19.0` | +`sqrt (3^2 + 4^2)` | `Floating a => a` | `5.0` | +`negate(sqrt (3^2 + 4^2))` | `Floating a => a` | `-5.0` | +`negate $ sqrt (3^2 + 4^2)` | `Floating a => a`| `-5.0` | Function **application** operator `$` +`(negate . sqrt) (3^2 + 4^2)`| `Floating a => a`| `-5.0` | Function **composition** operator `.` Reads `negate` **after** `negate . sqrt` | +`(negate . length) "hallo"` | `Int` | `-5` | +`negatedRoot = negate . sqrt` | `Floating c => c -> c` | | Constant named `negatedRoot` + ## Binary Functions ## Tuples