PRELUDE: add if' function to simplify if-then-else

This commit is contained in:
2014-10-13 22:30:57 +02:00
parent 077d0442f5
commit 9dcf1e30f9

View File

@@ -72,3 +72,9 @@ seqList = tail. inits
dupLast :: [a] -> [a]
dupLast [] = []
dupLast xs = xs ++ [last xs]
-- |Simpler version of if-then-else.
if' :: Bool -> a -> a -> a
if' True x _ = x
if' False _ y = y