dice-0.1.1: Simplistic D&D style dice-rolling system.
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Instances details
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 -> t -> t) -> (t -> t -> t) -> (t -> t -> t) -> (t -> t -> t) -> (t -> t -> t) -> Expr t -> t Source #

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

commute :: Monad m => (Expr a -> Expr a -> b) -> Expr (m a) -> Expr (m a) -> 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 -> a -> ShowS) -> p -> [a] -> a -> ShowS Source #

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

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

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

roll :: (Integral a, UniformRange a) => a -> a -> RVar [a] Source #

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