This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds, DefaultSignatures, FlexibleInstances, FunctionalDependencies, TypeFamilies, TypeOperators #-} | |
import Control.Applicative | |
import Control.Monad.Trans.Class | |
import Control.Monad.Trans.Either | |
import Control.Monad.Trans.Reader | |
import Data.Proxy | |
import Network.Wai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds, TypeOperators, OverloadedStrings #-} | |
import Servant.API | |
import Servant.Server | |
import Control.Monad.Trans.Either | |
import Data.Proxy | |
import Data.Aeson | |
data AuthResult = AuthResult { sessionCookie :: String, message :: String } | |
instance ToJSON AuthResult where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- application specific monads and types | |
type ServerMonad a | |
type SessionMonad a | |
runServerMonad :: ServerContext -> ServerMonad a -> IO (Either (Int,String) a) | |
authenticated :: AuthData -> SessionMonad a -> ServerMonad a | |
data AuthData | |
data AuthResponse a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compile with `clang++ -stdlib=libc++ -emit-llvm -c -O1 -g test.cc -I <path-to-polyglot-h>` | |
// disassemble with `llvm-dis test.bc` | |
#include <polyglot.h> | |
class Test { | |
public: | |
Test(); | |
~Test(); | |
static void foo(); |