Lesson 06 of 55
8 mins readPython Booleans, Equality & Logical Operators
In Plain English
Explore boolean logic in Haskell: values True and False, equality test (==), not-equal test (/=), and logical conjunction/disjunction.
Deep Dive: How It Works
Not Equal (/=): Haskell uses /= for inequality (resembling the mathematical ≠symbol), not !=.
Logical Functions: && (and), || (or), and not (unary negation).
Order Comparisons: <, <=, >, >= available for any type in the Ord typeclass.
Core Rules to Remember

Inequality Operator (/=): Haskell uses /= instead of != for not-equal checks.

Strict Boolean Types: Conditionals accept only true Bool values, preventing type coercion bugs.
Live Interactive Example
Hit Run Code to see it liveBoolean Operations and Comparisons
Python 3.12
1
2
3
4
5
6
7
8
9
10
11
12
13
Output Console
Click "Run Code" to view the rendered output.
How it works: 10 /= 20 evaluates to True.
Your Turn: Micro Challenge
No pressure! Edit the starter code below and test your solution with instant feedback.
Micro Exercise
Verify Inequality Condition
Evaluate `42 /= 99` and assign to `result`.
Print `"Result: "` followed by `show result`.
1
2
3
4
5
6
Sandbox Output
Click "Run & Check" to test your solution.
Finished reading and practicing?
Mark this lesson as completed to update your course progress.