diff --git a/ginger.cabal b/ginger.cabal
--- a/ginger.cabal
+++ b/ginger.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                ginger
-version:             0.2.3.0
+version:             0.2.4.0
 synopsis:            An implementation of the Jinja2 template language in Haskell
 description:         Ginger is Jinja, minus the most blatant pythonisms. Wants
                      to be feature complete, but isn't quite there yet.
@@ -44,7 +44,6 @@
                , vector
   hs-source-dirs:      src
   default-language:    Haskell2010
-  GHC-options: -O0
 
 executable ginger
     main-is: GingerCLI.hs
diff --git a/src/Text/Ginger/AST.hs b/src/Text/Ginger/AST.hs
--- a/src/Text/Ginger/AST.hs
+++ b/src/Text/Ginger/AST.hs
@@ -59,4 +59,5 @@
     | MemberLookupE Expression Expression -- ^ foo[bar] (also dot access)
     | CallE Expression [(Maybe Text, Expression)] -- ^ foo(bar=baz, quux)
     | LambdaE [Text] Expression -- ^ (foo, bar) -> expr
+    | TernaryE Expression Expression Expression -- ^ expr ? expr : expr
     deriving (Show)
diff --git a/src/Text/Ginger/Parse.hs b/src/Text/Ginger/Parse.hs
--- a/src/Text/Ginger/Parse.hs
+++ b/src/Text/Ginger/Parse.hs
@@ -438,7 +438,7 @@
     optional . ignore . char $ '\n'
 
 expressionP :: Monad m => Parser m Expression
-expressionP = lambdaExprP <|> booleanExprP
+expressionP = lambdaExprP <|> ternaryExprP
 
 lambdaExprP :: Monad m => Parser m Expression
 lambdaExprP = do
@@ -472,6 +472,22 @@
             rhs <- operandP
             spaces
             return (\lhs -> CallE (VarE funcName) [(Nothing, lhs), (Nothing, rhs)])
+
+ternaryExprP :: Monad m => Parser m Expression
+ternaryExprP = do
+    condition <- booleanExprP
+    spaces
+    ternaryTailP condition <|> return condition
+
+ternaryTailP :: Monad m => Expression -> Parser m Expression
+ternaryTailP condition = do
+    char '?'
+    spaces
+    yesBranch <- expressionP
+    char ':'
+    spaces
+    noBranch <- expressionP
+    return $ TernaryE condition yesBranch noBranch
 
 booleanExprP :: Monad m => Parser m Expression
 booleanExprP =
diff --git a/src/Text/Ginger/Run.hs b/src/Text/Ginger/Run.hs
--- a/src/Text/Ginger/Run.hs
+++ b/src/Text/Ginger/Run.hs
@@ -754,6 +754,10 @@
                 setVar argName arg
             runExpression body
     return $ fromFunction fn
+runExpression (TernaryE condition yes no) = do
+    condVal <- runExpression condition
+    let expr = if asBoolean condVal then yes else no
+    runExpression expr
 
 -- | Helper function to output a HTML value using whatever print function the
 -- context provides.
