Skip to main content
4 events
when toggle format what by license comment
Jan 4, 2017 at 12:50 history edited Dylan Meeus CC BY-SA 3.0
added 57 characters in body
Jan 4, 2017 at 12:49 comment added Dylan Meeus @ChristianSievers indeed the n<2 is an obvious improvement, thank you. The second one works as well, though it does not save me anything in this case. I'm still learning Haskell and did not realise I could have a guard like that. Thank you!
Jan 4, 2017 at 12:44 comment added Christian Sievers A golfier way to say n<=1 for integers is n<2. Also, the second condition doesn't need to be the negation of the first (the idiomatic otherwise is simply True), so usally in golfing something like 1<2 is used.
Jan 4, 2017 at 10:39 history answered Dylan Meeus CC BY-SA 3.0