summaryrefslogtreecommitdiff
path: root/tests/examples/ghc86/TH_recover.hs
blob: ac9c7cf17530604c64b90a51c03c63778c2a936e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{-# LANGUAGE TemplateHaskell #-}
module Main where

import Language.Haskell.TH

-- The recover successfully find that 'ola' is not in scope
-- and use '1' instead

y = $(recover (return (LitE (IntegerL 1)))
              (reify (mkName ("ola")) >> return (LitE (IntegerL 2))))

main = print y