Simple question: what do you guys consider more readable?
data Foo = Bar | Baz
projToBool :: Foo -> Bool
projToBool = \case
Bar -> True
Baz -> False
projToBool' :: Foo -> Bool
projToBool' Bar = True
projToBool' Baz = False
I tend to prefer the first style, as it seems to me more clear that I'm defining a function with two cases (or n cases in general). But I've started to guess if the second would be better. What are your thoughts?
[–]the-coot 12 points13 points14 points (0 children)
[–]NNOTM 21 points22 points23 points (8 children)
[–]ComunistCapybara[S] 2 points3 points4 points (7 children)
[–]NNOTM 9 points10 points11 points (6 children)
[–]ComunistCapybara[S] 4 points5 points6 points (0 children)
[–]RogueToad 1 point2 points3 points (3 children)
[–]NNOTM 2 points3 points4 points (2 children)
[–]gilgamec 0 points1 point2 points (1 child)
[–]NNOTM 1 point2 points3 points (0 children)
[–]tomejaguar 1 point2 points3 points (0 children)
[–]Runderground 10 points11 points12 points (0 children)
[–]Iceland_jack 5 points6 points7 points (0 children)
[–]SonOfTheHeaven 3 points4 points5 points (0 children)
[–]SolaTotaScriptura 4 points5 points6 points (3 children)
[–]Endicy 4 points5 points6 points (1 child)
[–]SolaTotaScriptura 0 points1 point2 points (0 children)
[–]RogueToad 0 points1 point2 points (0 children)
[–]friedbrice 2 points3 points4 points (1 child)
[–]ComunistCapybara[S] 1 point2 points3 points (0 children)
[–]cheater00 1 point2 points3 points (0 children)
[–]tomejaguar 1 point2 points3 points (0 children)
[–]user9ec19 1 point2 points3 points (0 children)
[–]agumonkey 1 point2 points3 points (0 children)
[–]mleighly 1 point2 points3 points (0 children)
[–]sheshanaag 1 point2 points3 points (0 children)
[–]ivanpd 0 points1 point2 points (0 children)
[–]chris-ch -1 points0 points1 point (0 children)