From 1ecb20c443f343d2113ceb77c18bd7157350af5c Mon Sep 17 00:00:00 2001 From: June A <40224657+fuguswarm@users.noreply.github.com> Date: Fri, 4 Mar 2022 17:45:37 +0100 Subject: [PATCH] Update README.md --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index e7a12f2..4b8e9e8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,29 @@ # py2hs A complementary resource that helps python programmers to learn Haskell as a new language + +Python +>>> def multiply(x, y): +... return x * y +... +>>> multiply(2, 3) +6 + +Haskell +λ> multiply x y = x * y +λ> multiply 2 3 +6 + +Flow control +Python +def bigger(x, y): + if x > y: + return x + else: + return y + +Haskell +bigger x y = if x > y + then x + else y + +