module RebindHR where

import Prelude hiding ( (>>=) )
import Data.Typeable

data Exp = Int Int | Plus Exp Exp | Bool Bool
data TExp a where
  TInt :: Int -> TExp Int
  TPlus :: TExp Int -> TExp Int -> TExp Int
  TBool :: Bool -> TExp Bool

(>>=) :: ((forall t. Typeable t => TExp t -> Maybe r) -> Maybe r)
      -> (forall t. Typeable t => TExp t -> Maybe r)
      -> Maybe r
x >>= y = x y