This file contains hidden or 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
module Web.Scotty.Async | |
where | |
import Control.Concurrent (ThreadId, forkIO, newEmptyMVar, putMVar, takeMVar) | |
import Control.Concurrent.Async (async, Async(..)) | |
import Data.Default (def) | |
import Network.Wai.Handler.Warp (Port, defaultSettings, setBeforeMainLoop, | |
setPort) | |
import Web.Scotty (Options(..), ScottyM, scottyOpts) |
This file contains hidden or 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
module SetFunctor where | |
import Data.Functor.Coyoneda | |
import Data.Set | |
setF :: Coyoneda Set Int | |
setF = liftCoyoneda $ fromList [1, 2, 3] | |
runCoyendaSet :: Ord a => Coyoneda Set a -> Set a | |
runCoyendaSet (Coyoneda f s) = fromList . fmap f $ toList s |
This file contains hidden or 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
// [ Scala ] | |
// You need to tell compiler that F, T, and A are of kinds (*, *) -> *, * -> *, and * respectively. | |
// See all those underscores. | |
trait Foo[F[_, _], T[_], A] { | |
def foo: F[T[A], A] | |
} | |
// [ Haskell ] | |
// It can infer kinds from context. | |
{-# LANGUAGE MultiParamTypeClasses #-} |
This file contains hidden or 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
from fabric.api import env, run, sudo, local, put | |
def production(): | |
"""Defines production environment""" | |
env.user = "deploy" | |
env.hosts = ['example.com',] | |
env.base_dir = "/var/www" | |
env.app_name = "app" | |
env.domain_name = "app.example.com" | |
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name } |