yu-utils-0.1.1.0: Utils for Yu

Copyright(C) 2017-2018 Johann Lee <me@qinka.pro>
LicenseGPL3
Maintainerme@qinka.pro
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Yu.Utils.Handler

Contents

Description

The method which might be useful for server

Synopsis

about exception

catchH Source #

Arguments

:: Exception e 
=> HandlerT site IO a

the action

-> (e -> HandlerT site IO a)

the exception handler

-> HandlerT site IO a

return

The method to catch the exception (in HadnlerT)

handlerH Source #

Arguments

:: Exception e 
=> (e -> HandlerT site IO a)

the handler for exceptions

-> HandlerT site IO a

operation

-> HandlerT site IO a 

The method for handler, equal to flip catchH

tryH Source #

Arguments

:: Exception e 
=> HandlerT site IO a

action

-> HandlerT site IO (Either e a)

return the result or the exception

The method for a try

about functor and moand

(<#>) infixl 4 Source #

Arguments

:: (Functor f1, Functor f2) 
=> (a -> b)

func

-> f1 (f2 a)

item

-> f1 (f2 b)

eq to (func $) $ item

the operator just like $

(<%>) infixl 4 Source #

Arguments

:: (Monad m, Functor f) 
=> (a -> m b)

func

-> f (m a)

item

-> f (m b)

eq to (func =<$ item

return the exception

returnE Source #

Arguments

:: (Monad m, Exception e) 
=> e

the exception

-> m String

return as string

a method to return a `exception' when it catched

returnET Source #

Arguments

:: (Monad m, Exception e) 
=> e

exception

-> m Text 

the text-returned version for returnE

returnEH Source #

Arguments

:: SomeException

exception

-> HandlerT site IO TypedContent 

the HandlerT version for returnE and returnEt

others

showJs :: Show a => a -> RawJavascript Source #

show the js

fromBinToBytestr :: Binary -> ByteString Source #

from binary to bytestring

data LogPath Source #

the path for logger

Constructors

LogFile FilePath

using files

LogStdout

using stdout

LogStderr

using stderr

Orphan instances