Skip to content

Instantly share code, notes, and snippets.

@k-bx
Created December 23, 2014 07:21
Show Gist options
  • Save k-bx/d0319a4bc0054516ab17 to your computer and use it in GitHub Desktop.
Save k-bx/d0319a4bc0054516ab17 to your computer and use it in GitHub Desktop.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE GADTs #-}
data Req = A | B
data ReqData :: Req -> * where
ReqDataA :: ReqData A
ReqDataB :: ReqData B
data Resp = Ra | Rb | Rc
data RespData :: Resp -> * where
RespDataA :: RespData Ra
RespDataB :: RespData Rb
RespDataC :: RespData Rc
sendA :: ReqData A -> RespData Ra
sendA = undefined
unSendA :: RespData Ra -> ReqData A
unSendA = undefined
main :: IO ()
main = do
let a = (unSendA (sendA ReqDataA)) :: ReqData A
putStrLn "hello"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment