Closed fumieval closed 11 years ago
We don't require GADTs. Just use Free Applicative:
data InputBase = Key Char (Bool -> a) | Mouse (V2 -> a) deriving Functor
type Input = Ap Input
key :: Char -> Input Bool
key ch = liftAp $ Key ch id
mouse :: Input V2
mouse = liftAp $ Mouse ch id
Done.