From 797233ec94ecec843dd26217c9a41836157a5490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Beir=C3=A3o?= Date: Tue, 20 Jun 2017 22:53:01 +0200 Subject: [PATCH] Different variable names from type variables I am writing a small ELM beginners guide. I am at the part of explaining pattern matching. While trying to explain this example, I feel that some people might confuse `a` and `b` from the type signature (`Either a b`) with this `a` and `b` from the pattern matches. I tried to come up with a more descriptive name, just to avoid an unnecessary clash. --- src/examples/either.elm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/examples/either.elm b/src/examples/either.elm index c24d20038..4f2cf9723 100644 --- a/src/examples/either.elm +++ b/src/examples/either.elm @@ -27,20 +27,20 @@ partition eithers = [] -> ([], []) - Left a :: rest -> + Left leftPayload :: rest -> let (lefts, rights) = partition rest in - (a :: lefts, rights) + (leftPayload :: lefts, rights) - Right b :: rest -> + Right rightPayload :: rest -> let (lefts, rights) = partition rest in - (lefts, b :: rights) + (lefts, rightPayload :: rights) main = - text (toString (partition userIDs)) \ No newline at end of file + text (toString (partition userIDs))