From 7b6c597f32c7845648c7ed407d0ee08f9f08308c Mon Sep 17 00:00:00 2001 From: Sebastian Steger Date: Wed, 20 Aug 2025 15:01:58 +0200 Subject: [PATCH] Types, Literals, and Constants along with Arithmetic and Boolean Operations --- haskell/01-expressions/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/haskell/01-expressions/README.md b/haskell/01-expressions/README.md index 2bac07c..c6f7464 100644 --- a/haskell/01-expressions/README.md +++ b/haskell/01-expressions/README.md @@ -4,6 +4,20 @@ The following illustrates some haskell basics. It can be reproduced using `ghci` ## Types, Literals, and Constants along with Arithmetic and Boolean Operations +Expression | Type (:t) | Value | Comment +--- | --- | --- | -------- +`2` | `Num a => a` | `2` | +`2.03` | `Fractional a => a` | `2.3` | +`'c'` | `Char` | `'c'` +`"hallo"` | `String` | `"hallo"` | +`True` | `Bool` | `True` | +`x=5` | `Num a => a` | `5` | Constant named `x` +`2 + 3` | `Num a => a` | `5` | Similar `-,*,^` +`2 / 3` | `Fractional a => a` | `0.6666666666666666` | +`1 > 2` | `Bool` | `False` | Similar `<, <=, >=, ==, /=` +`True && False` | `Bool` | `False` | Similar `\|\|,not` +`((2+3)*5 > 1) \|\| not (1 > 2)` | `Bool` | `True` | Right part is not evaluated due to lazy evaluation + ## Unary Functions ## Binary Functions