diff --git a/MyPrelude.hs b/MyPrelude.hs index d4b0bf2..a3a1326 100644 --- a/MyPrelude.hs +++ b/MyPrelude.hs @@ -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