imj-base-0.1.0.2: Game engine with geometry, easing, animated text, delta rendering.

Safe HaskellSafe
LanguageHaskell2010

Imj.Util

Contents

Synopsis

List utilities

showListOrSingleton :: Show a => [a] -> Text Source #

If list is a singleton, show the element, else show the list.

replicateElements :: Int -> [a] -> [a] Source #

Replicates each list element n times and concatenates the result.

range Source #

Arguments

:: Enum a 
=> Ord a 
=> a

First inclusive bound

-> a

Second inclusive bound

-> [a] 

Builds a range with no constraint on the order of bounds:

range 3 5 == [3,4,5]
range 5 3 == [5,4,3]

String utilities

Math utilities

randomRsIO Source #

Arguments

:: Random a 
=> a

lo : lower bound

-> a

hi : upper bound

-> IO [a] 

Returns a list of random values uniformly distributed in the closed interval [lo,hi].

It is unspecified what happens if lo>hi

clamp Source #

Arguments

:: Ord a 
=> a

The value

-> a

The inclusive minimum bound

-> a

The inclusive maximum bound

-> a 

Expects the bounds to be in the right order.

Reexports

data Int64 :: * #

64-bit signed integer type

Instances

Bounded Int64

Since: 2.1

Enum Int64

Since: 2.1

Eq Int64

Since: 2.1

Methods

(==) :: Int64 -> Int64 -> Bool #

(/=) :: Int64 -> Int64 -> Bool #

Integral Int64

Since: 2.1

Data Int64

Since: 4.0.0.0

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int64 -> c Int64 #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int64 #

toConstr :: Int64 -> Constr #

dataTypeOf :: Int64 -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Int64) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int64) #

gmapT :: (forall b. Data b => b -> b) -> Int64 -> Int64 #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int64 -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int64 -> r #

gmapQ :: (forall d. Data d => d -> u) -> Int64 -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Int64 -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 #

Num Int64

Since: 2.1

Ord Int64

Since: 2.1

Methods

compare :: Int64 -> Int64 -> Ordering #

(<) :: Int64 -> Int64 -> Bool #

(<=) :: Int64 -> Int64 -> Bool #

(>) :: Int64 -> Int64 -> Bool #

(>=) :: Int64 -> Int64 -> Bool #

max :: Int64 -> Int64 -> Int64 #

min :: Int64 -> Int64 -> Int64 #

Read Int64

Since: 2.1

Real Int64

Since: 2.1

Methods

toRational :: Int64 -> Rational #

Show Int64

Since: 2.1

Methods

showsPrec :: Int -> Int64 -> ShowS #

show :: Int64 -> String #

showList :: [Int64] -> ShowS #

Ix Int64

Since: 2.1

Bits Int64

Since: 2.1

FiniteBits Int64

Since: 4.6.0.0

Prim Int64 
Random Int64 

Methods

randomR :: RandomGen g => (Int64, Int64) -> g -> (Int64, g) #

random :: RandomGen g => g -> (Int64, g) #

randomRs :: RandomGen g => (Int64, Int64) -> g -> [Int64] #

randoms :: RandomGen g => g -> [Int64] #

randomRIO :: (Int64, Int64) -> IO Int64 #

randomIO :: IO Int64 #

Unbox Int64 
Vector Vector Int64 
MVector MVector Int64 
data Vector Int64 
data MVector s Int64