I have a very simple continuation function (avoided using Monads for simplicity sake):
data C a = C {unwrap :: (a -> a) -> a}
Essentially, I'm trying to perform different implementations based on input type, something similar to (sudo-code):
data Gadt a where
AString :: String -> Gadt Bool
AInt :: Int -> Gadt Bool
data C a = C {unwrap :: (a -> Gadt a) -> a}
example :: a -> C a
example v = C $ \f -> | (v :: Int) == True = f (AInt v)
| (v :: String) == True = f (AString v)
cont :: Gadt a -> a
cont (AInt v) = ...
cont (AString v) = ...
Am I overlooking a basic solution here? I'm new to continuations so I may of just overlooked something simple.