dice-0.1.0.1: Simplistic D&D style dice-rolling system.

Safe HaskellNone
LanguageHaskell98

Data.Random.Dice

Documentation

data Expr a Source #

Constructors

Const String a 
Plus (Expr a) (Expr a) 
Minus (Expr a) (Expr a) 
Times (Expr a) (Expr a) 
Divide (Expr a) (Expr a) 
Instances
Functor Expr Source # 
Instance details

Defined in Data.Random.Dice

Methods

fmap :: (a -> b) -> Expr a -> Expr b #

(<$) :: a -> Expr b -> Expr a #

Show a => Show (Expr a) Source # 
Instance details

Defined in Data.Random.Dice

Methods

showsPrec :: Int -> Expr a -> ShowS #

show :: Expr a -> String #

showList :: [Expr a] -> ShowS #

foldExpr :: (String -> t1 -> t2) -> (t2 -> t2 -> t2) -> (t2 -> t2 -> t2) -> (t2 -> t2 -> t2) -> (t2 -> t2 -> t2) -> Expr t1 -> t2 Source #

evalExprWithDiv :: (Num a, Monad m) => (a -> a -> m a) -> Expr a -> m a Source #

evalFractionalExpr :: (Eq a, Fractional a, Monad m) => Expr a -> m a Source #

evalIntegralExpr :: (Integral a, Monad m) => Expr a -> m a Source #

commute :: Monad m => (Expr a1 -> Expr a2 -> b) -> Expr (m a1) -> Expr (m a2) -> m b Source #

runExpr :: Monad m => Expr (m a) -> m (Expr a) Source #

fmtSimple :: (Integral a, Show a) => Expr [a] -> String Source #

showScalarConst :: Show a => String -> a -> p -> String -> String Source #

showListConst :: Show a => String -> a -> p -> String -> String Source #

showSimpleConst :: (Ord a, Num a) => (a -> t -> ShowS) -> p -> [t] -> a -> ShowS Source #

showRational :: (Show a1, Ord a2, Num a1, Num a2, Eq a1) => a2 -> Ratio a1 -> ShowS Source #

fmtExprPrec :: (String -> a -> Int -> ShowS) -> Expr a -> Int -> ShowS Source #

summarizeRollsOver :: Num a => Int -> [a] -> [a] Source #

roll :: Integral a => a -> a -> RVar [a] Source #

numExp :: Num a => CharParser st (Expr (RVar [a])) Source #