<div dir="ltr">I've got this code I've entered into the ghci by hand between :{ and :}<div><br></div><div><font face="monospace">:{</font></div><div><font face="monospace">{-# LANGUAGE LambdaCase #-}</font></div><div><font face="monospace">data List a = Empty | Cons a (List a) deriving (Eq, Ord, Show)<br>infixr 5 `Cons`<br><br>subst_c :: (a -> Bool)  -> (a, MyList a) -> MyList a<br>subst_c pred = \ case<br>                     (_, Empty)    -> Empty<br>                     (n, Cons e t)<br>                       | pred e    -> Cons n $ subst_c pred (n, t)<br>                       | otherwise -> Cons e $ subst_c pred (n, t)<br>:}<br></font></div><div><br></div><div>but I keep getting the error</div><div><br></div><div><font face="monospace">Illegal lambda-case (use -XLambdaCase)<br></font></div><div><br></div><div>This works fine inside an .hs file and :load and run at the prompt. However, I'm using Emacs org-mode and need to keep everything limited to a version of hand-entered :{ ... :}. Any suggestions?</div><div><br></div><div>LB</div><div><br></div><div><br></div></div>