1
2
3
4
5
6
7
{-# LANGUAGE RankNTypes #-}

newtype ExistsEnum = ExistsEnum (forall r. (forall x. (Enum x) => x -> r) -> r)

instance Enum ExistsEnum where
   fromEnum (ExistsEnum e) = e fromEnum
   toEnum i = ExistsEnum (\k -> k $ toEnum i)