{-# LANGUAGE ExistentialQuantification #-} module Rolling.Common (Diagram (..), Prob, Result (..), normalize, die) where import Rolling.Prob data Diagram = forall a. Diagram { title :: String, filename :: String, rolls :: a, render :: String -> String -> a -> IO () } die :: Int -> Prob Int die n = Prob [(d, P 1 n) | d <- [1 .. n]] -- the success metric for vaguely PbtA-ish games data Result = Success | Partial | Failure deriving (Eq, Show, Ord)