stochaskell-1.0.0: A probabilistic programming language

Copyright(c) David A Roberts 2015-2021
LicenseGPL-3
Maintainerd@vidr.cc
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Language.Stochaskell

Contents

Description

 
Synopsis

Documentation

Expressions

data Expression t #

Stochaskell expression representation (statically typed)

Instances
IsList RMat # 
Instance details

Defined in Data.Expression.Eval

Associated Types

type Item RMat :: Type #

Methods

fromList :: [Item RMat] -> RMat #

fromListN :: Int -> [Item RMat] -> RMat #

toList :: RMat -> [Item RMat] #

IsList ZVec # 
Instance details

Defined in Data.Expression.Eval

Associated Types

type Item ZVec :: Type #

Methods

fromList :: [Item ZVec] -> ZVec #

fromListN :: Int -> [Item ZVec] -> ZVec #

toList :: ZVec -> [Item ZVec] #

IsList RVec # 
Instance details

Defined in Data.Expression.Eval

Associated Types

type Item RVec :: Type #

Methods

fromList :: [Item RVec] -> RVec #

fromListN :: Int -> [Item RVec] -> RVec #

toList :: RVec -> [Item RVec] #

IsList BVec # 
Instance details

Defined in Data.Expression.Eval

Associated Types

type Item BVec :: Type #

Methods

fromList :: [Item BVec] -> BVec #

fromListN :: Int -> [Item BVec] -> BVec #

toList :: BVec -> [Item BVec] #

Read RMat # 
Instance details

Defined in Data.Expression.Eval

Read ZVec # 
Instance details

Defined in Data.Expression.Eval

Read RVec # 
Instance details

Defined in Data.Expression.Eval

Read BVec # 
Instance details

Defined in Data.Expression.Eval

Read Z # 
Instance details

Defined in Data.Expression.Eval

Read R # 
Instance details

Defined in Data.Expression.Eval

Read B # 
Instance details

Defined in Data.Expression.Eval

Scalable R RVec # 
Instance details

Defined in Data.Expression

Methods

(*>) :: R -> RVec -> RVec #

Cast Int R # 
Instance details

Defined in Data.Expression

Methods

cast :: Int -> R #

Cast Z R # 
Instance details

Defined in Data.Expression

Methods

cast :: Z -> R #

Distribution Poisson R P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Poisson R -> P Z

Distribution PMF RVec P Z # 
Instance details

Defined in Data.Program

Methods

sample :: PMF RVec -> P Z

Distribution Geometric R P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Geometric R -> P Z

Distribution Bernoullis RVec P BVec # 
Instance details

Defined in Data.Program

Methods

sample :: Bernoullis RVec -> P BVec

Distribution Bernoulli R P B # 
Instance details

Defined in Data.Program

Methods

sample :: Bernoulli R -> P B

(ExprType r, ExprType f, Show f) => Joint P Z (Expression r) (Expression f) # 
Instance details

Defined in Data.Program

ExprType t => Cast t (Expression t) # 
Instance details

Defined in Data.Expression

Methods

cast :: t -> Expression t #

Distribution Uniforms (RMat, RMat) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: Uniforms (RMat, RMat) -> P RMat

Distribution Uniforms (RVec, RVec) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Uniforms (RVec, RVec) -> P RVec

Distribution Uniform (Z, Z) P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Uniform (Z, Z) -> P Z

Distribution Uniform (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Uniform (R, R) -> P R

Distribution Normals (RMat, RMat) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: Normals (RMat, RMat) -> P RMat

Distribution Normals (RVec, RVec) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Normals (RVec, RVec) -> P RVec

Distribution Normal (RVec, RMat) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Normal (RVec, RMat) -> P RVec

Distribution Normal (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Normal (R, R) -> P R

Distribution NegBinomial (R, R) P Z # 
Instance details

Defined in Data.Program

Methods

sample :: NegBinomial (R, R) -> P Z

Distribution Logistic (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Logistic (R, R) -> P R

Distribution LKJ (R, Interval Z) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: LKJ (R, Interval Z) -> P RMat

Distribution InvGamma (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: InvGamma (R, R) -> P R

Distribution Gamma (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Gamma (R, R) -> P R

Distribution Cauchy (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Cauchy (R, R) -> P R

Distribution Beta (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Beta (R, R) -> P R

ExprType t => Distribution OrderedSample (Z, P (Expression t)) P (Expression [t]) # 
Instance details

Defined in Data.Program

Methods

sample :: OrderedSample (Z, P (Expression t)) -> P (Expression [t])

Distribution PoissonProcess (R, R -> R, R) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: PoissonProcess (R, R -> R, R) -> P RVec

(ExprType t, Enum t) => Enum (Expression t) # 
Instance details

Defined in Data.Expression.Eval

Eq t => Eq (Expression t) # 
Instance details

Defined in Data.Expression

Methods

(==) :: Expression t -> Expression t -> Bool #

(/=) :: Expression t -> Expression t -> Bool #

(ExprType t, Floating t) => Floating (Expression t) # 
Instance details

Defined in Data.Expression

(ExprType t, Fractional t) => Fractional (Expression t) # 
Instance details

Defined in Data.Expression

(ExprType t, Integral t) => Integral (Expression t) # 
Instance details

Defined in Data.Expression.Eval

(ExprType t, Num t) => Num (Expression t) # 
Instance details

Defined in Data.Expression

Ord t => Ord (Expression t) # 
Instance details

Defined in Data.Expression

(ExprType t, Real t) => Real (Expression t) # 
Instance details

Defined in Data.Expression.Eval

(Show t, ExprType t) => Show (Expression t) # 
Instance details

Defined in Data.Expression.Eval

ExprType e => Semigroup (Expression [[e]]) # 
Instance details

Defined in Data.Expression

Methods

(<>) :: Expression [[e]] -> Expression [[e]] -> Expression [[e]] #

sconcat :: NonEmpty (Expression [[e]]) -> Expression [[e]] #

stimes :: Integral b => b -> Expression [[e]] -> Expression [[e]] #

Boolean (Expression Bool) # 
Instance details

Defined in Data.Expression

IfB (Expression t) # 
Instance details

Defined in Data.Expression

Methods

ifB :: bool ~ BooleanOf (Expression t) => bool -> Expression t -> Expression t -> Expression t #

EqB (Expression t) # 
Instance details

Defined in Data.Expression

Methods

(==*) :: bool ~ BooleanOf (Expression t) => Expression t -> Expression t -> bool #

(/=*) :: bool ~ BooleanOf (Expression t) => Expression t -> Expression t -> bool #

OrdB (Expression t) # 
Instance details

Defined in Data.Expression

Methods

(<*) :: bool ~ BooleanOf (Expression t) => Expression t -> Expression t -> bool #

(<=*) :: bool ~ BooleanOf (Expression t) => Expression t -> Expression t -> bool #

(>*) :: bool ~ BooleanOf (Expression t) => Expression t -> Expression t -> bool #

(>=*) :: bool ~ BooleanOf (Expression t) => Expression t -> Expression t -> bool #

(Ord t, ExprType t) => Transfinite (Expression t) # 
Instance details

Defined in Data.Expression

ExprType a => ExprTuple (Expression a) # 
Instance details

Defined in Data.Expression

ExprType a => ExprType (Expression a) # 
Instance details

Defined in Data.Expression

ExprType e => Matrix (Expression [[e]]) Z (Expression e) # 
Instance details

Defined in Data.Expression

Methods

matrix :: AbstractArray Z (Expression e) -> Expression [[e]] #

blockMatrix :: [[Expression [[e]]]] -> Expression [[e]] #

eye :: Z -> Expression [[e]] #

zeros :: Z -> Z -> Expression [[e]] #

matrixRows :: Expression [[e]] -> Z #

matrixCols :: Expression [[e]] -> Z #

designMatrix :: (Indexable v Z (Expression e), Num Z) => Z -> AbstractArray Z v -> Expression [[e]] #

ExprType e => Vector (Expression [e]) Z (Expression e) # 
Instance details

Defined in Data.Expression

ExprType e => Transposable (Expression [[e]]) (Expression [[e]]) # 
Instance details

Defined in Data.Expression

Methods

tr :: Expression [[e]] -> Expression [[e]] #

tr' :: Expression [[e]] -> Expression [[e]] #

SquareMatrix (Expression [[e]]) (Expression e) # 
Instance details

Defined in Data.Expression

Methods

chol :: Expression [[e]] -> Expression [[e]] #

inv :: Expression [[e]] -> Expression [[e]] #

det :: Expression [[e]] -> Expression e #

logDet :: Expression [[e]] -> Expression e #

LinearOperator (Expression [[e]]) (Expression [e]) # 
Instance details

Defined in Data.Expression

Methods

(#>) :: Expression [[e]] -> Expression [e] -> Expression [e] #

(<#) :: Expression [e] -> Expression [[e]] -> Expression [e] #

diag :: Expression [e] -> Expression [[e]] #

asColumn :: Expression [e] -> Expression [[e]] #

asRow :: Expression [e] -> Expression [[e]] #

outer :: Expression [e] -> Expression [e] -> Expression [[e]] #

InnerProduct (Expression [e]) (Expression e) # 
Instance details

Defined in Data.Expression

Methods

(<.>) :: Expression [e] -> Expression [e] -> Expression e #

ExprType e => Scalable (Expression e) (Expression [[e]]) # 
Instance details

Defined in Data.Expression

Methods

(*>) :: Expression e -> Expression [[e]] -> Expression [[e]] #

Cast (Expression t) (Expression [[t]]) # 
Instance details

Defined in Data.Expression

Methods

cast :: Expression t -> Expression [[t]] #

Cast (Expression t) (Expression [t]) # 
Instance details

Defined in Data.Expression

Methods

cast :: Expression t -> Expression [t] #

Indexable (Expression [e]) (Expression Integer) (Expression e) # 
Instance details

Defined in Data.Expression

(ExprTuple a, ExprTuple b, ExprType t) => Show (a -> b -> Expression t) # 
Instance details

Defined in Data.Expression

Methods

showsPrec :: Int -> (a -> b -> Expression t) -> ShowS #

show :: (a -> b -> Expression t) -> String #

showList :: [a -> b -> Expression t] -> ShowS #

(ExprTuple a, ExprType t) => Show (a -> Expression t) # 
Instance details

Defined in Data.Expression

Methods

showsPrec :: Int -> (a -> Expression t) -> ShowS #

show :: (a -> Expression t) -> String #

showList :: [a -> Expression t] -> ShowS #

(ExprType a, ExprType b) => ExprTuple (Expression a, Expression b) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b) => ExprType (Expression a, Expression b) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c) => ExprTuple (Expression a, Expression b, Expression c) # 
Instance details

Defined in Data.Expression

ExprType t => GConstructor (K1 i (Expression t) :: Type -> Type) # 
Instance details

Defined in Data.Expression

Methods

gtypeOf :: TypeOf (K1 i (Expression t) p) #

gtags :: Tags (K1 i (Expression t) p) #

gconstruct :: (forall t0. ExprType t0 => a -> Expression t0) -> Tag -> [a] -> K1 i (Expression t) p #

gdeconstruct :: (forall t0. ExprType t0 => Expression t0 -> a) -> K1 i (Expression t) p -> (Tag, [a]) #

(ExprType a, ExprType b, ExprType c) => ExprType (Expression a, Expression b, Expression c) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d) => ExprTuple (Expression a, Expression b, Expression c, Expression d) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d) => ExprType (Expression a, Expression b, Expression c, Expression d) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d, ExprType e) => ExprTuple (Expression a, Expression b, Expression c, Expression d, Expression e) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d, ExprType e) => ExprType (Expression a, Expression b, Expression c, Expression d, Expression e) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d, ExprType e, ExprType f) => ExprTuple (Expression a, Expression b, Expression c, Expression d, Expression e, Expression f) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d, ExprType e, ExprType f) => ExprType (Expression a, Expression b, Expression c, Expression d, Expression e, Expression f) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d, ExprType e, ExprType f, ExprType g) => ExprTuple (Expression a, Expression b, Expression c, Expression d, Expression e, Expression f, Expression g) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d, ExprType e, ExprType f, ExprType g) => ExprType (Expression a, Expression b, Expression c, Expression d, Expression e, Expression f, Expression g) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d, ExprType e, ExprType f, ExprType g, ExprType h) => ExprTuple (Expression a, Expression b, Expression c, Expression d, Expression e, Expression f, Expression g, Expression h) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d, ExprType e, ExprType f, ExprType g, ExprType h) => ExprType (Expression a, Expression b, Expression c, Expression d, Expression e, Expression f, Expression g, Expression h) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d, ExprType e, ExprType f, ExprType g, ExprType h, ExprType i) => ExprTuple (Expression a, Expression b, Expression c, Expression d, Expression e, Expression f, Expression g, Expression h, Expression i) # 
Instance details

Defined in Data.Expression

(ExprType a, ExprType b, ExprType c, ExprType d, ExprType e, ExprType f, ExprType g, ExprType h, ExprType i) => ExprType (Expression a, Expression b, Expression c, Expression d, Expression e, Expression f, Expression g, Expression h, Expression i) # 
Instance details

Defined in Data.Expression

type Item RMat # 
Instance details

Defined in Data.Expression.Eval

type Item RMat = [Double]
type Item ZVec # 
Instance details

Defined in Data.Expression.Eval

type Item RVec # 
Instance details

Defined in Data.Expression.Eval

type Item BVec # 
Instance details

Defined in Data.Expression.Eval

type Item BVec = Bool
type BooleanOf (Expression t) # 
Instance details

Defined in Data.Expression

Array manipulation

class Indexable a i e | a -> i e where #

generalised array interface

Minimal complete definition

(!), bounds

Methods

(!) :: a -> i -> e infixl 9 #

see (!)

bounds :: a -> Interval i #

see bounds

deleteAt :: Indexable a i e => a -> i -> a #

a `deleteAt` i -- remove i'th element of array

insertAt :: Indexable a i e => a -> (i, e) -> a #

a `insertAt` (i,e) -- move a!i and following elements up one, and set a!i = e

replaceAt :: Indexable a i e => a -> (i, e) -> a #

a `replaceAt` (i,e) -- set a!i = e

deleteIndex :: a -> i -> a #

insertIndex :: a -> i -> e -> a #

replaceIndex :: a -> i -> e -> a #

Instances
Indexable DExpr DExpr DExpr # 
Instance details

Defined in Data.Expression

Indexable ConstVal [Integer] ConstVal # 
Instance details

Defined in Data.Expression.Const

Indexable [e] Int e # 
Instance details

Defined in Data.Array.Abstract

Methods

(!) :: [e] -> Int -> e #

bounds :: [e] -> Interval Int #

deleteAt :: [e] -> Int -> [e] #

insertAt :: [e] -> (Int, e) -> [e] #

replaceAt :: [e] -> (Int, e) -> [e] #

deleteIndex :: [e] -> Int -> [e] #

insertIndex :: [e] -> Int -> e -> [e] #

replaceIndex :: [e] -> Int -> e -> [e] #

Indexable (Expression [e]) (Expression Integer) (Expression e) # 
Instance details

Defined in Data.Expression

(IArray UArray e, Ix i) => Indexable (UArray i e) i e # 
Instance details

Defined in Data.Array.Abstract

Methods

(!) :: UArray i e -> i -> e #

bounds :: UArray i e -> Interval i #

deleteAt :: UArray i e -> i -> UArray i e #

insertAt :: UArray i e -> (i, e) -> UArray i e #

replaceAt :: UArray i e -> (i, e) -> UArray i e #

deleteIndex :: UArray i e -> i -> UArray i e #

insertIndex :: UArray i e -> i -> e -> UArray i e #

replaceIndex :: UArray i e -> i -> e -> UArray i e #

Ix i => Indexable (Array i e) i e # 
Instance details

Defined in Data.Array.Abstract

Methods

(!) :: Array i e -> i -> e #

bounds :: Array i e -> Interval i #

deleteAt :: Array i e -> i -> Array i e #

insertAt :: Array i e -> (i, e) -> Array i e #

replaceAt :: Array i e -> (i, e) -> Array i e #

deleteIndex :: Array i e -> i -> Array i e #

insertIndex :: Array i e -> i -> e -> Array i e #

replaceIndex :: Array i e -> i -> e -> Array i e #

Indexable (AbstractArray i e) [i] e # 
Instance details

Defined in Data.Array.Abstract

Methods

(!) :: AbstractArray i e -> [i] -> e #

bounds :: AbstractArray i e -> Interval [i] #

deleteAt :: AbstractArray i e -> [i] -> AbstractArray i e #

insertAt :: AbstractArray i e -> ([i], e) -> AbstractArray i e #

replaceAt :: AbstractArray i e -> ([i], e) -> AbstractArray i e #

deleteIndex :: AbstractArray i e -> [i] -> AbstractArray i e #

insertIndex :: AbstractArray i e -> [i] -> e -> AbstractArray i e #

replaceIndex :: AbstractArray i e -> [i] -> e -> AbstractArray i e #

Recursion

foldlE :: ExprType b => (Expression b -> Expression a -> Expression b) -> Expression b -> Expression [a] -> Expression b #

Stochaskell equivalent of foldl

foldrE :: ExprType b => (Expression a -> Expression b -> Expression b) -> Expression b -> Expression [a] -> Expression b #

Stochaskell equivalent of foldr

scanlE :: ExprType b => (Expression b -> Expression a -> Expression b) -> Expression b -> Expression [a] -> Expression [b] #

Stochaskell equivalent of scanl

scanrE :: ExprType b => (Expression a -> Expression b -> Expression b) -> Expression b -> Expression [a] -> Expression [b] #

Stochaskell equivalent of scanr

foldE :: forall t f. (Functor f, Constructor (f (FixE f)), ExprTuple t, ExprType (f (FixE f)), ExprType (f t)) => (Expression (f t) -> t) -> FixE' f -> t #

unfoldE :: forall t f. (Functor f, Constructor (f t), ExprTuple t, ExprType (f (FixE f)), ExprType (f t)) => (t -> Expression (f t)) -> t -> FixE' f #

Helpers

constSymbol :: forall t. ExprType t => String -> Expression t #

create a symbol assumed to have a known value

d :: (ExprTuple s, ExprTuple t) => s -> t -> RMat #

automatic differentiation, eg:

(z**2) `d` z

factorial' :: Z -> Z #

find' :: ExprType e => (Expression e -> B) -> Expression e -> Expression [e] -> Expression e #

find p d v: find leftmost element of v satisfying p, else d if no elements satisfy p

findSortedInsertIndex :: R -> RVec -> Z #

given a value and a sorted vector, find the index at which we could insertAt the value whilst keeping the vector sorted

findSortedInsertIndexBound :: Interval Z -> R -> RVec -> Z #

like findSortedInsertIndex but with the given bounds on the index

floor' :: R -> Z #

Stochaskell equivalent of floor

min' :: Expression a -> Expression a -> Expression a #

minimum of two values

solve :: ExprTuple t => t -> t -> EEnv #

equation solver / transformation inverter

solveP :: ExprTuple t => P t -> t -> EEnv #

solve applied to program outputs

sum' :: (ExprType a, Num a) => Expression [a] -> Expression a #

Stochaskell equivalent of sum

symbol :: forall t. ExprType t => String -> Expression t #

create a symbolic variable

symbols :: ExprType t => String -> [Expression t] #

create a list of (one-letter) symbols

Linear algebra

class InnerProduct v e | v -> e where #

Methods

(<.>) :: v -> v -> e infixr 8 #

generalisation of <.>

Instances
InnerProduct ConstVal ConstVal # 
Instance details

Defined in Data.Expression.Const

Methods

(<.>) :: ConstVal -> ConstVal -> ConstVal #

InnerProduct (Expression [e]) (Expression e) # 
Instance details

Defined in Data.Expression

Methods

(<.>) :: Expression [e] -> Expression [e] -> Expression e #

class LinearOperator m v | m -> v, v -> m where #

generalised linear operator interface

Minimal complete definition

(#>), (<#), diag, asColumn, asRow

Methods

(#>) :: m -> v -> v infixr 8 #

see #>

(<#) :: v -> m -> v #

see <#

diag :: v -> m #

convert vector to diagonal matrix

asColumn :: v -> m #

convert vector to column

asRow :: v -> m #

convert vector to row

outer :: (LinearOperator m v, Semigroup m) => v -> v -> m #

outer product

Instances
LinearOperator ConstVal ConstVal # 
Instance details

Defined in Data.Expression.Const

LinearOperator DExpr DExpr # 
Instance details

Defined in Data.Expression

LinearOperator (Expression [[e]]) (Expression [e]) # 
Instance details

Defined in Data.Expression

Methods

(#>) :: Expression [[e]] -> Expression [e] -> Expression [e] #

(<#) :: Expression [e] -> Expression [[e]] -> Expression [e] #

diag :: Expression [e] -> Expression [[e]] #

asColumn :: Expression [e] -> Expression [[e]] #

asRow :: Expression [e] -> Expression [[e]] #

outer :: Expression [e] -> Expression [e] -> Expression [[e]] #

class Matrix m i e | m -> i e where #

generalised matrix interface

Minimal complete definition

matrix, blockMatrix, eye, zeros, matrixRows, matrixCols

Methods

matrix :: AbstractArray i e -> m #

convert from abstract array

blockMatrix :: [[m]] -> m #

create a block matrix

eye :: i -> m #

identity matrix

zeros :: i -> i -> m #

zero matrix

matrixRows :: m -> i #

number of rows

matrixCols :: m -> i #

number of columns

designMatrix :: (Indexable v i e, Num i) => i -> AbstractArray i v -> m #

pack vectors as rows of a matrix

class Scalable a v | v -> a where #

Methods

(*>) :: a -> v -> v infixr 7 #

scalar by array multiplication (see *>)

Instances
Scalable ConstVal ConstVal # 
Instance details

Defined in Data.Expression.Const

Methods

(*>) :: ConstVal -> ConstVal -> ConstVal #

Scalable R RVec # 
Instance details

Defined in Data.Expression

Methods

(*>) :: R -> RVec -> RVec #

(IArray UArray e, Num e, Ix i) => Scalable e (UArray i e) # 
Instance details

Defined in Data.Array.Abstract

Methods

(*>) :: e -> UArray i e -> UArray i e #

(Num e, Ix i) => Scalable e (Array i e) # 
Instance details

Defined in Data.Array.Abstract

Methods

(*>) :: e -> Array i e -> Array i e #

ExprType e => Scalable (Expression e) (Expression [[e]]) # 
Instance details

Defined in Data.Expression

Methods

(*>) :: Expression e -> Expression [[e]] -> Expression [[e]] #

class SquareMatrix m e | m -> e where #

Methods

chol :: m -> m #

lower-triangular Cholesky decomposition, see chol

inv :: m -> m #

see inv

det :: m -> e #

see det

logDet :: m -> e #

logarithm of the absolute value of the determinant

Instances
SquareMatrix ConstVal ConstVal # 
Instance details

Defined in Data.Expression.Const

SquareMatrix DExpr DExpr # 
Instance details

Defined in Data.Expression

Methods

chol :: DExpr -> DExpr #

inv :: DExpr -> DExpr #

det :: DExpr -> DExpr #

logDet :: DExpr -> DExpr #

SquareMatrix (Expression [[e]]) (Expression e) # 
Instance details

Defined in Data.Expression

Methods

chol :: Expression [[e]] -> Expression [[e]] #

inv :: Expression [[e]] -> Expression [[e]] #

det :: Expression [[e]] -> Expression e #

logDet :: Expression [[e]] -> Expression e #

class Transposable m mt | m -> mt, mt -> m where #

Methods

tr :: m -> mt #

conjugate transpose

tr' :: m -> mt #

transpose

Instances
Transposable ConstVal ConstVal # 
Instance details

Defined in Data.Expression.Const

Transposable DExpr DExpr # 
Instance details

Defined in Data.Expression

Methods

tr :: DExpr -> DExpr #

tr' :: DExpr -> DExpr #

(CTrans t, Container Vector t) => Transposable (Matrix t) (Matrix t) 
Instance details

Defined in Internal.Numeric

Methods

tr :: Matrix t -> Matrix t #

tr' :: Matrix t -> Matrix t #

ExprType e => Transposable (Expression [[e]]) (Expression [[e]]) # 
Instance details

Defined in Data.Expression

Methods

tr :: Expression [[e]] -> Expression [[e]] #

tr' :: Expression [[e]] -> Expression [[e]] #

class Vector v i e | v -> i e, i e -> v where #

generalised vector interface

Methods

vector :: AbstractArray i e -> v #

convert from abstract array

blockVector :: [v] -> v #

vectorSize :: v -> i #

number of elements in vector

Types

type B #

Arguments

 = Expression Bool

boolean

type R #

Arguments

 = Expression Double

real

type Z #

Arguments

 = Expression Integer

integer

type BVec #

Arguments

 = Expression [Bool]

boolean vector

type RVec #

Arguments

 = Expression [Double]

real vector

type ZVec #

Arguments

 = Expression [Integer]

integer vector

type BMat #

Arguments

 = Expression [[Bool]]

boolean matrix

type RMat #

Arguments

 = Expression [[Double]]

real matrix

type ZMat #

Arguments

 = Expression [[Integer]]

integer matrix

Type casting

class Cast a b where #

cast a value of one type to another

Methods

cast :: a -> b #

Instances
Cast Int R # 
Instance details

Defined in Data.Expression

Methods

cast :: Int -> R #

Cast Z R # 
Instance details

Defined in Data.Expression

Methods

cast :: Z -> R #

ExprType t => Cast t (Expression t) # 
Instance details

Defined in Data.Expression

Methods

cast :: t -> Expression t #

Cast (Expression t) (Expression [[t]]) # 
Instance details

Defined in Data.Expression

Methods

cast :: Expression t -> Expression [[t]] #

Cast (Expression t) (Expression [t]) # 
Instance details

Defined in Data.Expression

Methods

cast :: Expression t -> Expression [t] #

boolean :: (Eq a, Boolean a, Boolean b) => a -> b #

convert between boolean types (eg. Bool to B)

integer :: (Integral i, Num n) => i -> n #

convert between integer types (eg. Int to Z)

real :: (Real r, Fractional f) => r -> f #

convert between real types (eg. Double to R)

list :: (IsList l, IsList l', Item l ~ Item l') => l -> l' #

convert between list types (eg. [Double] to RVec)

Abstract arrays

type Interval i = (i, i) #

closed interval of integers

data AbstractArray i e #

create abstract arrays with an expression like

[ i + j | i <- 1...rows, j <- 1...cols ]
Instances
Monad (AbstractArray i) # 
Instance details

Defined in Data.Array.Abstract

Methods

(>>=) :: AbstractArray i a -> (a -> AbstractArray i b) -> AbstractArray i b #

(>>) :: AbstractArray i a -> AbstractArray i b -> AbstractArray i b #

return :: a -> AbstractArray i a #

fail :: String -> AbstractArray i a #

Functor (AbstractArray i) # 
Instance details

Defined in Data.Array.Abstract

Methods

fmap :: (a -> b) -> AbstractArray i a -> AbstractArray i b #

(<$) :: a -> AbstractArray i b -> AbstractArray i a #

Applicative (AbstractArray i) # 
Instance details

Defined in Data.Array.Abstract

Methods

pure :: a -> AbstractArray i a #

(<*>) :: AbstractArray i (a -> b) -> AbstractArray i a -> AbstractArray i b #

liftA2 :: (a -> b -> c) -> AbstractArray i a -> AbstractArray i b -> AbstractArray i c #

(*>) :: AbstractArray i a -> AbstractArray i b -> AbstractArray i b #

(<*) :: AbstractArray i a -> AbstractArray i b -> AbstractArray i a #

(Ix i, Show i, Eq e) => Eq (AbstractArray i e) # 
Instance details

Defined in Data.Array.Abstract

Methods

(==) :: AbstractArray i e -> AbstractArray i e -> Bool #

(/=) :: AbstractArray i e -> AbstractArray i e -> Bool #

(Ix i, Show i, Ord e) => Ord (AbstractArray i e) # 
Instance details

Defined in Data.Array.Abstract

Indexable (AbstractArray i e) [i] e # 
Instance details

Defined in Data.Array.Abstract

Methods

(!) :: AbstractArray i e -> [i] -> e #

bounds :: AbstractArray i e -> Interval [i] #

deleteAt :: AbstractArray i e -> [i] -> AbstractArray i e #

insertAt :: AbstractArray i e -> ([i], e) -> AbstractArray i e #

replaceAt :: AbstractArray i e -> ([i], e) -> AbstractArray i e #

deleteIndex :: AbstractArray i e -> [i] -> AbstractArray i e #

insertIndex :: AbstractArray i e -> [i] -> e -> AbstractArray i e #

replaceIndex :: AbstractArray i e -> [i] -> e -> AbstractArray i e #

(...) :: a -> a -> AbstractArray a a infix 5 #

create abstract array containing given integer range

Probability distributions

data P t #

Stochaskell probabilistic program intermediate representation

Instances
Monad P # 
Instance details

Defined in Data.Program

Methods

(>>=) :: P a -> (a -> P b) -> P b #

(>>) :: P a -> P b -> P b #

return :: a -> P a #

fail :: String -> P a #

Functor P # 
Instance details

Defined in Data.Program

Methods

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

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

Applicative P # 
Instance details

Defined in Data.Program

Methods

pure :: a -> P a #

(<*>) :: P (a -> b) -> P a -> P b #

liftA2 :: (a -> b -> c) -> P a -> P b -> P c #

(*>) :: P a -> P b -> P b #

(<*) :: P a -> P b -> P a #

MonadGuard P # 
Instance details

Defined in Data.Program

Methods

guard :: ConditionOf (P ()) -> P () #

Distribution Poisson R P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Poisson R -> P Z

Distribution PMF RVec P Z # 
Instance details

Defined in Data.Program

Methods

sample :: PMF RVec -> P Z

Distribution Geometric R P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Geometric R -> P Z

Distribution Bernoullis RVec P BVec # 
Instance details

Defined in Data.Program

Methods

sample :: Bernoullis RVec -> P BVec

Distribution Bernoulli R P B # 
Instance details

Defined in Data.Program

Methods

sample :: Bernoulli R -> P B

(ExprType r, ExprType f, Show f) => Joint P Z (Expression r) (Expression f) # 
Instance details

Defined in Data.Program

Distribution Uniforms (RMat, RMat) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: Uniforms (RMat, RMat) -> P RMat

Distribution Uniforms (RVec, RVec) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Uniforms (RVec, RVec) -> P RVec

Distribution Uniform (Z, Z) P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Uniform (Z, Z) -> P Z

Distribution Uniform (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Uniform (R, R) -> P R

Distribution Normals (RMat, RMat) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: Normals (RMat, RMat) -> P RMat

Distribution Normals (RVec, RVec) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Normals (RVec, RVec) -> P RVec

Distribution Normal (RVec, RMat) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Normal (RVec, RMat) -> P RVec

Distribution Normal (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Normal (R, R) -> P R

Distribution NegBinomial (R, R) P Z # 
Instance details

Defined in Data.Program

Methods

sample :: NegBinomial (R, R) -> P Z

Distribution Logistic (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Logistic (R, R) -> P R

Distribution LKJ (R, Interval Z) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: LKJ (R, Interval Z) -> P RMat

Distribution InvGamma (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: InvGamma (R, R) -> P R

Distribution Gamma (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Gamma (R, R) -> P R

Distribution Cauchy (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Cauchy (R, R) -> P R

Distribution Beta (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Beta (R, R) -> P R

ExprType t => Distribution OrderedSample (Z, P (Expression t)) P (Expression [t]) # 
Instance details

Defined in Data.Program

Methods

sample :: OrderedSample (Z, P (Expression t)) -> P (Expression [t])

Distribution PoissonProcess (R, R -> R, R) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: PoissonProcess (R, R -> R, R) -> P RVec

Eq t => Eq (P t) # 
Instance details

Defined in Data.Program

Methods

(==) :: P t -> P t -> Bool #

(/=) :: P t -> P t -> Bool #

ExprTuple t => Show (P t) # 
Instance details

Defined in Data.Program

Methods

showsPrec :: Int -> P t -> ShowS #

show :: P t -> String #

showList :: [P t] -> ShowS #

(IfB t, BooleanOf t ~ B) => IfB (P t) # 
Instance details

Defined in Data.Program

Methods

ifB :: bool ~ BooleanOf (P t) => bool -> P t -> P t -> P t #

(ExprTuple a, ExprTuple b) => Show (a -> P b) # 
Instance details

Defined in Data.Program

Methods

showsPrec :: Int -> (a -> P b) -> ShowS #

show :: (a -> P b) -> String #

showList :: [a -> P b] -> ShowS #

type BooleanOf (P t) # 
Instance details

Defined in Data.Program

type BooleanOf (P t) = B
type ConditionOf (P ()) # 
Instance details

Defined in Data.Program

class Monad m => Distribution d s m t | d m t -> s #

generalised probability distribution interface

Minimal complete definition

sample

Instances
Distribution Poisson Double IO Integer # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Poisson R P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Poisson R -> P Z

Distribution PMF RVec P Z # 
Instance details

Defined in Data.Program

Methods

sample :: PMF RVec -> P Z

Distribution Geometric Double IO Integer # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Geometric R P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Geometric R -> P Z

Distribution Bernoullis RVec P BVec # 
Instance details

Defined in Data.Program

Methods

sample :: Bernoullis RVec -> P BVec

Distribution Bernoulli Double IO Bool # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Bernoulli R P B # 
Instance details

Defined in Data.Program

Methods

sample :: Bernoulli R -> P B

Distribution PMF [Double] IO Integer # 
Instance details

Defined in Data.Random.Distribution.Abstract

Methods

sample :: PMF [Double] -> IO Integer

Distribution Uniforms (RMat, RMat) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: Uniforms (RMat, RMat) -> P RMat

Distribution Uniforms (RVec, RVec) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Uniforms (RVec, RVec) -> P RVec

Random t => Distribution Uniform (t, t) IO t # 
Instance details

Defined in Data.Random.Distribution.Abstract

Methods

sample :: Uniform (t, t) -> IO t

Distribution Uniform (Z, Z) P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Uniform (Z, Z) -> P Z

Distribution Uniform (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Uniform (R, R) -> P R

Distribution Normals (RMat, RMat) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: Normals (RMat, RMat) -> P RMat

Distribution Normals (RVec, RVec) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Normals (RVec, RVec) -> P RVec

Distribution Normal (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Normal (RVec, RMat) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Normal (RVec, RMat) -> P RVec

Distribution Normal (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Normal (R, R) -> P R

Distribution NegBinomial (Double, Double) IO Integer # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution NegBinomial (R, R) P Z # 
Instance details

Defined in Data.Program

Methods

sample :: NegBinomial (R, R) -> P Z

Distribution Logistic (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Logistic (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Logistic (R, R) -> P R

Distribution LKJ (R, Interval Z) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: LKJ (R, Interval Z) -> P RMat

Distribution InvGamma (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution InvGamma (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: InvGamma (R, R) -> P R

Distribution Gamma (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Methods

sample :: Gamma (Double, Double) -> IO Double

Distribution Gamma (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Gamma (R, R) -> P R

Distribution Cauchy (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Cauchy (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Cauchy (R, R) -> P R

Distribution Beta (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Methods

sample :: Beta (Double, Double) -> IO Double

Distribution Beta (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Beta (R, R) -> P R

ExprType t => Distribution OrderedSample (Z, P (Expression t)) P (Expression [t]) # 
Instance details

Defined in Data.Program

Methods

sample :: OrderedSample (Z, P (Expression t)) -> P (Expression [t])

Distribution PoissonProcess (R, R -> R, R) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: PoissonProcess (R, R -> R, R) -> P RVec

class Joint m i r f | m -> i where #

Methods

joint :: (AbstractArray i r -> f) -> AbstractArray i (m r) -> m f #

create distribution over arrays as the product of an array of independent distributions, eg.

joint matrix [ normal i j | i <- 1...m, j <- 1...n ]
Instances
Joint IO Integer e f # 
Instance details

Defined in Data.Array.Abstract

Methods

joint :: (AbstractArray Integer e -> f) -> AbstractArray Integer (IO e) -> IO f #

(ExprType r, ExprType f, Show f) => Joint P Z (Expression r) (Expression f) # 
Instance details

Defined in Data.Program

Primitives

Boolean

data Bernoulli p #

Instances
Distribution Bernoulli Double IO Bool # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Bernoulli R P B # 
Instance details

Defined in Data.Program

Methods

sample :: Bernoulli R -> P B

data Bernoullis p #

Instances
Distribution Bernoullis RVec P BVec # 
Instance details

Defined in Data.Program

Methods

sample :: Bernoullis RVec -> P BVec

bernoulli :: Distribution Bernoulli s m t => s -> m t #

bernoullis :: Distribution Bernoullis s m t => s -> m t #

bernoulliLogit :: Distribution Bernoulli s m t => s -> m t #

Discrete

data Geometric a #

Instances
Distribution Geometric Double IO Integer # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Geometric R P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Geometric R -> P Z

data NegBinomial a #

Instances
Distribution NegBinomial (Double, Double) IO Integer # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution NegBinomial (R, R) P Z # 
Instance details

Defined in Data.Program

Methods

sample :: NegBinomial (R, R) -> P Z

data PMF a #

Instances
Distribution PMF RVec P Z # 
Instance details

Defined in Data.Program

Methods

sample :: PMF RVec -> P Z

Distribution PMF [Double] IO Integer # 
Instance details

Defined in Data.Random.Distribution.Abstract

Methods

sample :: PMF [Double] -> IO Integer

data Poisson a #

Instances
Distribution Poisson Double IO Integer # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Poisson R P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Poisson R -> P Z

geometric :: (Distribution Geometric t1 m t2, Num t2) => Integer -> t1 -> m t2 #

negBinomial :: Distribution NegBinomial (a, b) m t => a -> b -> m t #

pmf :: Distribution PMF s m t => s -> m t #

distribution over indices given by vector of probabilities

poisson :: Distribution Poisson s m t => s -> m t #

Continuous

data Beta a #

Instances
Distribution Beta (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Methods

sample :: Beta (Double, Double) -> IO Double

Distribution Beta (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Beta (R, R) -> P R

data Cauchy a #

Instances
Distribution Cauchy (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Cauchy (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Cauchy (R, R) -> P R

data Gamma a #

Instances
Distribution Gamma (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Methods

sample :: Gamma (Double, Double) -> IO Double

Distribution Gamma (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Gamma (R, R) -> P R

data InvGamma a #

Instances
Distribution InvGamma (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution InvGamma (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: InvGamma (R, R) -> P R

data Logistic a #

Instances
Distribution Logistic (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Logistic (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Logistic (R, R) -> P R

data Normal a #

Instances
Distribution Normal (Double, Double) IO Double # 
Instance details

Defined in Data.Random.Distribution.Abstract

Distribution Normal (RVec, RMat) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Normal (RVec, RMat) -> P RVec

Distribution Normal (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Normal (R, R) -> P R

data Normals a #

Instances
Distribution Normals (RMat, RMat) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: Normals (RMat, RMat) -> P RMat

Distribution Normals (RVec, RVec) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Normals (RVec, RVec) -> P RVec

data Uniform a #

Instances
Random t => Distribution Uniform (t, t) IO t # 
Instance details

Defined in Data.Random.Distribution.Abstract

Methods

sample :: Uniform (t, t) -> IO t

Distribution Uniform (Z, Z) P Z # 
Instance details

Defined in Data.Program

Methods

sample :: Uniform (Z, Z) -> P Z

Distribution Uniform (R, R) P R # 
Instance details

Defined in Data.Program

Methods

sample :: Uniform (R, R) -> P R

data Uniforms a #

Instances
Distribution Uniforms (RMat, RMat) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: Uniforms (RMat, RMat) -> P RMat

Distribution Uniforms (RVec, RVec) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: Uniforms (RVec, RVec) -> P RVec

beta :: Distribution Beta (a, b) m t => a -> b -> m t #

cauchy :: Distribution Cauchy (a, b) m t => a -> b -> m t #

gamma :: Distribution Gamma (a, b) m t => a -> b -> m t #

invGamma :: Distribution InvGamma (a, b) m t => a -> b -> m t #

logistic :: Distribution Logistic (a, b) m t => a -> b -> m t #

normal :: Distribution Normal (a, b) m t => a -> b -> m t #

normals :: Distribution Normals (a, b) m t => a -> b -> m t #

uniform :: Distribution Uniform (a, b) m t => a -> b -> m t #

uniforms :: Distribution Uniforms (a, b) m t => a -> b -> m t #

Vector

data OrderedSample a #

Instances
ExprType t => Distribution OrderedSample (Z, P (Expression t)) P (Expression [t]) # 
Instance details

Defined in Data.Program

Methods

sample :: OrderedSample (Z, P (Expression t)) -> P (Expression [t])

data PoissonProcess a #

Instances
Distribution PoissonProcess (R, R -> R, R) P RVec # 
Instance details

Defined in Data.Program

Methods

sample :: PoissonProcess (R, R -> R, R) -> P RVec

orderedSample :: Distribution OrderedSample (a, b) m t => a -> b -> m t #

orderedSample n d gives an ordered vector of n samples from a base distribution d

poissonProcess :: Distribution PoissonProcess (a, b, c) m t => a -> b -> c -> m t #

Matrix

data LKJ a #

Instances
Distribution LKJ (R, Interval Z) P RMat # 
Instance details

Defined in Data.Program

Methods

sample :: LKJ (R, Interval Z) -> P RMat

corrLKJ :: Distribution LKJ (a, b) m t => a -> b -> m t #

Logarithmic probability density functions

lpdf :: (ExprTuple t, Show t) => P t -> t -> R #

compute log pdf of distribution represented by probabilistic program

lpdfAux :: (ExprTuple t, Show t) => P t -> t -> R #

compute joint pdf of primitive random variables within the given program

lpdfAuxC :: (Constructor t, Show t) => P (Expression t) -> Expression t -> R #

lpdfCond :: (ExprTuple s, ExprTuple t, Show t) => (s -> P t) -> s -> t -> R #

pdf :: (ExprTuple t, Show t) => P t -> t -> R #

density :: ExprTuple t => P t -> t -> LogFloat #

density' :: ExprTuple t => P t -> t -> LogFloat #

Primitives

lpdfNormal :: Floating a => a -> a -> a -> a #

lpdfUniform :: (Ord p, Floating p) => p -> p -> p -> p #

lpdfDiscreteUniform :: (Floating p, Integral a) => a -> a -> a -> p #

Transformers

mixture :: forall t. ExprTuple t => [(R, P t)] -> P t #

creates a mixture distribution, eg.

mixture [(0.7, uniform 0 1), (0.3, normal 0 1)]

mixture' :: ExprTuple t => [(R, P t)] -> P t #

like mixture, but produces a flattened intermediate representation that uses a case expression rather than a switch statement

truncated :: Expression t -> Expression t -> P (Expression t) -> P (Expression t) #

truncate distribution to given bounds

foldP :: forall t f. (Traversable f, Constructor (f (FixE f)), ExprTuple t, ExprType (f (FixE f)), ExprType (f t)) => (Expression (f t) -> P t) -> FixE' f -> P t #

unfoldP :: forall t f. (Traversable f, Constructor (f t), ExprTuple t, ExprType (f (FixE f)), ExprType (f t)) => (t -> P (Expression (f t))) -> t -> P (FixE' f) #

Iteration

chain' :: ExprTuple t => Z -> (t -> P t) -> t -> P t #

convenience function for calling chainRange' starting at 1 and ignoring indices

chainRange' :: forall t. ExprTuple t => Interval Z -> (Z -> t -> P t) -> t -> P t #

iterate a Markov chain over the given integer range, eg.

chainRange' (1,10) (\i x -> normal x 1) 0 -- 10-step standard normal random walk from 0

Pre-defined probabilistic programs

lognormal :: (Distribution Normal (a, b1) m b2, Floating b2) => a -> b1 -> m b2 #

log-normal distribution

normalChol :: Z -> RVec -> RMat -> P RVec #

multivariate normal via Cholesky decomposition of covariance matrix

normalsChol :: Z -> Z -> RVec -> RMat -> P RMat #

iid normalChol samples as rows

normalCond :: Z -> (Expression t -> Expression t -> R) -> R -> Expression [t] -> RVec -> Expression t -> P R #

Gaussian process conditioned on observations

Sampling

compileCC :: forall s t. (ExprTuple s, ExprTuple t) => (s -> P t) -> IO (s -> IO t) #

compile probabilistic program to native machine code, via the C++ backend

runCC :: forall s t. (ExprTuple s, ExprTuple t) => (s -> P t) -> s -> IO t #

sample probabilistic program via compileCC

runStep :: forall t. ExprTuple t => (t -> P t) -> t -> IO t #

sample probabilistic program via Stochaskell's interpreter

simulate :: ExprTuple t => P t -> IO t #

like runStep for programs that don't take parameters

Inference

hmcStan :: ExprTuple t => Int -> P t -> IO [t] #

perform Hamiltonian Monte Carlo inference on the given posterior program, via the Stan code generation backend, returning the given number of samples

see runStan for a more advanced interface

hmcStanInit :: ExprTuple t => Int -> P t -> t -> IO [t] #

like hmcStan but specifying the initial MC state

rjmc :: (ExprTuple t, IfB t, BooleanOf t ~ B, Show t) => P t -> (t -> P t) -> t -> P t #

Reversible Jump Monte Carlo inference

rjmcC :: (Constructor t, Show t) => P (Expression t) -> (t -> P (Expression t)) -> Expression t -> P (Expression t) #

like rjmc but for ADTs that implement the Constructor typeclass

rjmc1 :: (ExprType t, ExprTuple t, IfB t, BooleanOf t ~ B, Show t) => P t -> (t -> P t) -> t -> P t #

like rjmc but assumes the Jacobian factor is equal to one

rjmc1Ratio :: (ExprTuple t, Show t) => P t -> (t -> P t) -> t -> t -> R #

acceptance ratio for rjmc1

Miscellaneous

binarize :: (forall a. (Num a, EqB a, OrdB a) => a -> BooleanOf a) -> ConstVal -> ConstVal #

map boolean function over elements of array

caseZ :: forall t. ExprTuple t => Z -> [t] -> t #

chain :: Monad m => Int -> (b -> m b) -> b -> m b #

like chain' but for arbitrary monads

chainRange :: (Num i, Monad m) => (Int, Int) -> (i -> x -> m x) -> x -> m x #

like chainRange' but for arbitrary monads

debug :: ExprTuple t => String -> t -> t #

Stochaskell equivalent of trace that runs within generated code

deepseq :: NFData a => a -> b -> b #

deepseq: fully evaluates the first argument, before returning the second.

The name deepseq is used to illustrate the relationship to seq: where seq is shallow in the sense that it only evaluates the top level of its argument, deepseq traverses the entire data structure evaluating it completely.

deepseq can be useful for forcing pending exceptions, eradicating space leaks, or forcing lazy I/O to happen. It is also useful in conjunction with parallel Strategies (see the parallel package).

There is no guarantee about the ordering of evaluation. The implementation may evaluate the components of the structure in any order or in parallel. To impose an actual order on evaluation, use pseq from Control.Parallel in the parallel package.

Since: deepseq-1.1.0.0

fromCase :: forall c t. (Constructor c, ExprTuple t) => (c -> t) -> Expr c -> t #

fromCaseP :: forall c t. (Constructor c, ExprTuple t) => (c -> P t) -> Expression c -> P t #

fromCaseP' :: forall c t. (Constructor c, ExprTuple t) => (c -> P t) -> Expression c -> P t #

fromRight' :: Either String b -> b #

extract result from an Either value when possible, throw an exception with the error string otherwise

interpolate :: (Ord a, Fractional a) => [(a, a)] -> a -> a #

piecewise linear interpolation

iterateLimit :: Monad m => Int -> (a -> m a) -> a -> m [a] #

parameter order equal to that of nest

linspace :: (IsList l, e ~ Item l, Fractional e, Integral i) => (e, e) -> i -> l #

evenly spaced points over interval

logFromLogFloat :: LogFloat -> Double #

Return the log-domain value itself without conversion.

loop :: Monad m => a -> (a -> m a) -> m () #

infinite loop

mean :: (Foldable t, Fractional a) => t a -> a #

calculate the mean of a set

qfDiag :: RMat -> RVec -> RMat #

\(\mathrm{qfDiag}\ A\ x = x^\top A x\)

readRealMatrix :: FilePath -> IO ConstVal #

read CSV file into a matrix

selectItems :: [a] -> [Bool] -> [a] #

extract elements of first list where second list contains True

setRandomSeed :: Int -> IO () #

sets the global random seed

Warning: does not yet cover all sources of randomness

silence' :: IO a -> IO a #

prevent console output

slice :: ConstVal -> AbstractArray Integer [Integer] -> ConstVal #

extract the given indices from an array, eg.

diagonal = table `slice` [[i,i] | i <- 1...n]

square :: Num a => a -> a #

convenience function for squaring a value

staircase :: Ord a => [a] -> [a] -> a -> a #

step function

stochaskell :: IO () #

perform initialisation for interactive use

tic :: IO NominalDiffTime #

start a stopwatch

toc :: NominalDiffTime -> IO NominalDiffTime #

read a stopwatch

vizIR :: ExprTuple t => P t -> IO String #

Re-exports

Data.List.Utils

uniq :: Eq a => [a] -> [a] #

Given a list, returns a new list with all duplicate elements removed. For example:

uniq "Mississippi" -> "Misp"

You should not rely on this function necessarily preserving order, though the current implementation happens to.

This function is not compatible with infinite lists.

This is presently an alias for Data.List.nub

subIndex :: Eq a => [a] -> [a] -> Maybe Int #

Similar to Data.List.elemIndex. Instead of looking for one element in a list, this function looks for the first occurance of a sublist in the list, and returns the index of the first element of that occurance. If there is no such list, returns Nothing.

If the list to look for is the empty list, will return Just 0 regardless of the content of the list to search.

Examples:

subIndex "foo" "asdfoobar" -> Just 3
subIndex "foo" [] -> Nothing
subIndex "" [] -> Just 0
subIndex "" "asdf" -> Just 0
subIndex "test" "asdftestbartest" -> Just 4
subIndex [(1::Int), 2] [0, 5, 3, 2, 1, 2, 4] -> Just 4

grab :: Int -> State [a] [a] #

Helps you pick out fixed-width components from a list.

Example:

conv :: String -> (String,String)
conv = runState $
        do f3 <- grab 3
           n2 <- grab 2
           return $ f3 ++ "," ++ n2

main = print $ conv "TestIng"

Prints:

("Tes,tI","ng")

fixedWidth :: [Int] -> WholeFunc a [a] #

A parser designed to process fixed-width input fields. Use it with wholeMap.

The Int list passed to this function is the list of the field widths desired from the input. The result is a list of those widths, if possible. If any of the input remains after processing this list, it is added on as the final element in the result list. If the input is less than the sum of the requested widths, then the result list will be short the appropriate number of elements, and its final element may be shorter than requested.

Examples:

wholeMap (fixedWidth [1, 2, 3]) "1234567890"
 --> ["1","23","456","7890"]
wholeMap (fixedWidth (repeat 2)) "123456789"
 --> ["12","34","56","78","9"]
wholeMap (fixedWidth []) "123456789"
 --> ["123456789"]
wholeMap (fixedWidth [5, 3, 6, 1]) "Hello, This is a test."
 --> ["Hello",", T","his is"," ","a test."]

wholeMap :: WholeFunc a b -> [a] -> [b] #

This is an enhanced version of the concatMap or map functions in Data.List.

Unlike those functions, this one:

  • Can consume a varying number of elements from the input list during each iteration
  • Can arbitrarily decide when to stop processing data
  • Can return a varying number of elements to insert into the output list
  • Can actually switch processing functions mid-stream
  • Is not even restricted to processing the input list intact

The function used by wholeMap, of type WholeFunc, is repeatedly called with the input list. The function returns three things: the function to call for the next iteration (if any), what remains of the input list, and the list of output elements generated during this iteration. The return value of wholeMap is the concatenation of the output element lists from all iterations.

Processing stops when the remaining input list is empty. An example of a WholeFunc is fixedWidth.

seqList :: [a] -> [a] #

Forces the evaluation of the entire list.

alwaysElemRIndex :: Eq a => a -> [a] -> Int #

Like elemRIndex, but returns -1 if there is nothing found.

elemRIndex :: Eq a => a -> [a] -> Maybe Int #

Returns the rightmost index of the given element in the given list.

countElem :: Eq a => a -> [a] -> Int #

Returns a count of the number of times the given element occured in the given list.

strToAL :: (Read a, Read b) => String -> [(a, b)] #

The inverse of strFromAL, this function reads a string and outputs the appropriate association list.

Like strFromAL, this is designed to work with [(String, String)] association lists but may also work with other objects with simple representations.

strFromAL :: (Show a, Show b) => [(a, b)] -> String #

Converts an association list to a string. The string will have one pair per line, with the key and value both represented as a Haskell string.

This function is designed to work with [(String, String)] association lists, but may work with other types as well.

flipAL :: (Eq key, Eq val) => [(key, val)] -> [(val, [key])] #

Flips an association list. Converts (key1, val), (key2, val) pairs to (val, [key1, key2]).

hasKeyAL :: Eq a => a -> [(a, b)] -> Bool #

Indicates whether or not the given key is in the AL.

valuesAL :: [(a, value)] -> [value] #

Returns the values the comprise the (key, value) pairs of the given AL.

Same as:

map snd

keysAL :: [(key, a)] -> [key] #

Returns the keys that comprise the (key, value) pairs of the given AL.

Same as:

map fst

delFromAL :: Eq key => [(key, a)] -> key -> [(key, a)] #

Removes all (key, value) pairs from the given list where the key matches the given one.

addToAL :: Eq key => [(key, elt)] -> key -> elt -> [(key, elt)] #

Adds the specified (key, value) pair to the given list, removing any existing pair with the same key already present.

contains :: Eq a => [a] -> [a] -> Bool #

Returns true if the given parameter is a sublist of the given list; false otherwise.

Example:

contains "Haskell" "I really like Haskell." -> True
contains "Haskell" "OCaml is great." -> False

This function was submitted to GHC and was applied as isInfixOf. This function therefore is deprecated and will be removed in future versions.

genericJoin :: Show a => String -> [a] -> String #

Like join, but works with a list of anything showable, converting it to a String.

Examples:

genericJoin ", " [1, 2, 3, 4] -> "1, 2, 3, 4"
genericJoin "|" ["foo", "bar", "baz"] -> "\"foo\"|\"bar\"|\"baz\""

replace :: Eq a => [a] -> [a] -> [a] -> [a] #

Given a list and a replacement list, replaces each occurance of the search list with the replacement list in the operation list.

Example:

replace "," "." "127,0,0,1" -> "127.0.0.1"

This could logically be thought of as:

replace old new l = join new . split old $ l

split :: Eq a => [a] -> [a] -> [[a]] #

Given a delimiter and a list (or string), split into components.

Example:

split "," "foo,bar,,baz," -> ["foo", "bar", "", "baz", ""]
split "ba" ",foo,bar,,baz," -> [",foo,","r,,","z,"]

breakList :: ([a] -> Bool) -> [a] -> ([a], [a]) #

Similar to Data.List.break, but performs the test on the entire remaining list instead of just one element.

spanList :: ([a] -> Bool) -> [a] -> ([a], [a]) #

Similar to Data.List.span, but performs the test on the entire remaining list instead of just one element.

spanList p xs is the same as (takeWhileList p xs, dropWhileList p xs)

dropWhileList :: ([a] -> Bool) -> [a] -> [a] #

Similar to Data.List.dropWhile, drops elements while the func is true. The function is given the remainder of the list to examine.

takeWhileList :: ([a] -> Bool) -> [a] -> [a] #

Similar to Data.List.takeWhile, takes elements while the func is true. The function is given the remainder of the list to examine.

hasAny #

Arguments

:: Eq a 
=> [a]

List of elements to look for

-> [a]

List to search

-> Bool

Result

Returns true if the given list contains any of the elements in the search list.

endswith :: Eq a => [a] -> [a] -> Bool #

Returns true if the given list ends with the specified elements; false otherwise. (This is an alias for "Data.List.isSuffixOf".)

Example:

endswith "lo" "Hello" -> True

startswith :: Eq a => [a] -> [a] -> Bool #

Returns true if the given list starts with the specified elements; false otherwise. (This is an alias for "Data.List.isPrefixOf".)

Example:

startswith "He" "Hello" -> True

mergeBy :: (a -> a -> Ordering) -> [a] -> [a] -> [a] #

Merge two sorted lists using into a single, sorted whole, allowing the programmer to specify the comparison function.

QuickCheck test property:

prop_mergeBy xs ys = mergeBy cmp (sortBy cmp xs) (sortBy cmp ys) == sortBy cmp (xs ++ ys) where types = xs :: [ (Int, Int) ] cmp (x1,_) (x2,_) = compare x1 x2

merge :: Ord a => [a] -> [a] -> [a] #

Merge two sorted lists into a single, sorted whole.

Example:

merge [1,3,5] [1,2,4,6] -> [1,1,2,3,4,5,6]

QuickCheck test property:

prop_merge xs ys = merge (sort xs) (sort ys) == sort (xs ++ ys) where types = xs :: [Int]

newtype WholeFunc a b #

The type used for functions for wholeMap. See wholeMap for details.

Constructors

WholeFunc ([a] -> (WholeFunc a b, [a], [b])) 

Data.Number.Transfinite

class PartialOrd a => Transfinite a where #

Many numbers are not Bounded yet, even though they can represent arbitrarily large values, they are not necessarily able to represent transfinite values such as infinity itself. This class is for types which are capable of representing such values. Notably, this class does not require the type to be Fractional nor Floating since integral types could also have representations for transfinite values. By popular demand the Num restriction has been lifted as well, due to complications of defining Show or Eq for some types.

In particular, this class extends the ordered projection to have a maximum value infinity and a minimum value negativeInfinity, as well as an exceptional value notANumber. All the natural laws regarding infinity and negativeInfinity should pertain. (Some of these are discussed below.)

Hugs (September 2006) has buggy Prelude definitions for isNaN and isInfinite on Float and Double. This module provides correct definitions, so long as Hugs.RealFloat is compiled correctly.

Minimal complete definition

infinity, negativeInfinity, notANumber, isInfinite, isNaN

Methods

infinity :: a #

A transfinite value which is greater than all finite values. Adding or subtracting any finite value is a no-op. As is multiplying by any non-zero positive value (including infinity), and dividing by any positive finite value. Also obeys the law negate infinity = negativeInfinity with all appropriate ramifications.

negativeInfinity :: a #

A transfinite value which is less than all finite values. Obeys all the same laws as infinity with the appropriate changes for the sign difference.

notANumber :: a #

An exceptional transfinite value for dealing with undefined results when manipulating infinite values. The following operations must return notANumber, where inf is any value which isInfinite:

  • infinity + negativeInfinity
  • negativeInfinity + infinity
  • infinity - infinity
  • negativeInfinity - negativeInfinity
  • inf * 0
  • 0 * inf
  • inf / inf
  • inf `div` inf
  • 0 / 0
  • 0 `div` 0

Additionally, any mathematical operations on notANumber must also return notANumber, and any equality or ordering comparison on notANumber must return False (violating the law of the excluded middle, often assumed but not required for Eq; thus, eq and ne are preferred over (==) and (/=)). Since it returns false for equality, there may be more than one machine representation of this value.

GHC.Exts

class IsList l where #

The IsList class and its methods are intended to be used in conjunction with the OverloadedLists extension.

Since: base-4.7.0.0

Minimal complete definition

fromList, toList

Associated Types

type Item l :: Type #

The Item type function returns the type of items of the structure l.

Methods

fromList :: [Item l] -> l #

The fromList function constructs the structure l from the given list of Item l

fromListN :: Int -> [Item l] -> l #

The fromListN function takes the input list's length as a hint. Its behaviour should be equivalent to fromList. The hint can be used to construct the structure l more efficiently compared to fromList. If the given hint does not equal to the input list's length the behaviour of fromListN is not specified.

toList :: l -> [Item l] #

The toList function extracts a list of Item l from the structure l. It should satisfy fromList . toList = id.

Instances
IsList CallStack

Be aware that 'fromList . toList = id' only for unfrozen CallStacks, since toList removes frozenness information.

Since: base-4.9.0.0

Instance details

Defined in GHC.Exts

Associated Types

type Item CallStack :: Type #

IsList Version

Since: base-4.8.0.0

Instance details

Defined in GHC.Exts

Associated Types

type Item Version :: Type #

IsList String 
Instance details

Defined in Basement.UTF8.Base

Associated Types

type Item String :: Type #

IsList IntSet

Since: containers-0.5.6.2

Instance details

Defined in Data.IntSet.Internal

Associated Types

type Item IntSet :: Type #

IsList ByteArray

Since: primitive-0.6.3.0

Instance details

Defined in Data.Primitive.ByteArray

Associated Types

type Item ByteArray :: Type #

IsList ShortText

Note: Surrogate pairs ([U+D800 .. U+DFFF]) character literals are replaced by U+FFFD.

Since: text-short-0.1.2

Instance details

Defined in Data.Text.Short.Internal

Associated Types

type Item ShortText :: Type #

IsList ConstVal # 
Instance details

Defined in Data.Expression.Const

Associated Types

type Item ConstVal :: Type #

IsList RMat # 
Instance details

Defined in Data.Expression.Eval

Associated Types

type Item RMat :: Type #

Methods

fromList :: [Item RMat] -> RMat #

fromListN :: Int -> [Item RMat] -> RMat #

toList :: RMat -> [Item RMat] #

IsList ZVec # 
Instance details

Defined in Data.Expression.Eval

Associated Types

type Item ZVec :: Type #

Methods

fromList :: [Item ZVec] -> ZVec #

fromListN :: Int -> [Item ZVec] -> ZVec #

toList :: ZVec -> [Item ZVec] #

IsList RVec # 
Instance details

Defined in Data.Expression.Eval

Associated Types

type Item RVec :: Type #

Methods

fromList :: [Item RVec] -> RVec #

fromListN :: Int -> [Item RVec] -> RVec #

toList :: RVec -> [Item RVec] #

IsList BVec # 
Instance details

Defined in Data.Expression.Eval

Associated Types

type Item BVec :: Type #

Methods

fromList :: [Item BVec] -> BVec #

fromListN :: Int -> [Item BVec] -> BVec #

toList :: BVec -> [Item BVec] #

IsList [a]

Since: base-4.7.0.0

Instance details

Defined in GHC.Exts

Associated Types

type Item [a] :: Type #

Methods

fromList :: [Item [a]] -> [a] #

fromListN :: Int -> [Item [a]] -> [a] #

toList :: [a] -> [Item [a]] #

Storable a => IsList (Vector a) 
Instance details

Defined in Data.Vector.Storable

Associated Types

type Item (Vector a) :: Type #

Methods

fromList :: [Item (Vector a)] -> Vector a #

fromListN :: Int -> [Item (Vector a)] -> Vector a #

toList :: Vector a -> [Item (Vector a)] #

IsList (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Exts

Associated Types

type Item (NonEmpty a) :: Type #

Methods

fromList :: [Item (NonEmpty a)] -> NonEmpty a #

fromListN :: Int -> [Item (NonEmpty a)] -> NonEmpty a #

toList :: NonEmpty a -> [Item (NonEmpty a)] #

PrimType ty => IsList (UArray ty) 
Instance details

Defined in Basement.UArray.Base

Associated Types

type Item (UArray ty) :: Type #

Methods

fromList :: [Item (UArray ty)] -> UArray ty #

fromListN :: Int -> [Item (UArray ty)] -> UArray ty #

toList :: UArray ty -> [Item (UArray ty)] #

PrimType ty => IsList (Block ty) 
Instance details

Defined in Basement.Block.Base

Associated Types

type Item (Block ty) :: Type #

Methods

fromList :: [Item (Block ty)] -> Block ty #

fromListN :: Int -> [Item (Block ty)] -> Block ty #

toList :: Block ty -> [Item (Block ty)] #

IsList c => IsList (NonEmpty c) 
Instance details

Defined in Basement.NonEmpty

Associated Types

type Item (NonEmpty c) :: Type #

Methods

fromList :: [Item (NonEmpty c)] -> NonEmpty c #

fromListN :: Int -> [Item (NonEmpty c)] -> NonEmpty c #

toList :: NonEmpty c -> [Item (NonEmpty c)] #

IsList (IntMap a)

Since: containers-0.5.6.2

Instance details

Defined in Data.IntMap.Internal

Associated Types

type Item (IntMap a) :: Type #

Methods

fromList :: [Item (IntMap a)] -> IntMap a #

fromListN :: Int -> [Item (IntMap a)] -> IntMap a #

toList :: IntMap a -> [Item (IntMap a)] #

IsList (Seq a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Item (Seq a) :: Type #

Methods

fromList :: [Item (Seq a)] -> Seq a #

fromListN :: Int -> [Item (Seq a)] -> Seq a #

toList :: Seq a -> [Item (Seq a)] #

Ord a => IsList (Set a)

Since: containers-0.5.6.2

Instance details

Defined in Data.Set.Internal

Associated Types

type Item (Set a) :: Type #

Methods

fromList :: [Item (Set a)] -> Set a #

fromListN :: Int -> [Item (Set a)] -> Set a #

toList :: Set a -> [Item (Set a)] #

IsList (DList a) 
Instance details

Defined in Data.DList

Associated Types

type Item (DList a) :: Type #

Methods

fromList :: [Item (DList a)] -> DList a #

fromListN :: Int -> [Item (DList a)] -> DList a #

toList :: DList a -> [Item (DList a)] #

PrimUnlifted a => IsList (UnliftedArray a)

Since: primitive-0.6.4.0

Instance details

Defined in Data.Primitive.UnliftedArray

Associated Types

type Item (UnliftedArray a) :: Type #

Prim a => IsList (PrimArray a)

Since: primitive-0.6.4.0

Instance details

Defined in Data.Primitive.PrimArray

Associated Types

type Item (PrimArray a) :: Type #

Methods

fromList :: [Item (PrimArray a)] -> PrimArray a #

fromListN :: Int -> [Item (PrimArray a)] -> PrimArray a #

toList :: PrimArray a -> [Item (PrimArray a)] #

IsList (SmallArray a) 
Instance details

Defined in Data.Primitive.SmallArray

Associated Types

type Item (SmallArray a) :: Type #

IsList (Array a) 
Instance details

Defined in Data.Primitive.Array

Associated Types

type Item (Array a) :: Type #

Methods

fromList :: [Item (Array a)] -> Array a #

fromListN :: Int -> [Item (Array a)] -> Array a #

toList :: Array a -> [Item (Array a)] #

(Eq a, Hashable a) => IsList (HashSet a) 
Instance details

Defined in Data.HashSet.Base

Associated Types

type Item (HashSet a) :: Type #

Methods

fromList :: [Item (HashSet a)] -> HashSet a #

fromListN :: Int -> [Item (HashSet a)] -> HashSet a #

toList :: HashSet a -> [Item (HashSet a)] #

Prim a => IsList (Vector a) 
Instance details

Defined in Data.Vector.Primitive

Associated Types

type Item (Vector a) :: Type #

Methods

fromList :: [Item (Vector a)] -> Vector a #

fromListN :: Int -> [Item (Vector a)] -> Vector a #

toList :: Vector a -> [Item (Vector a)] #

IsList (Vector a) 
Instance details

Defined in Data.Vector

Associated Types

type Item (Vector a) :: Type #

Methods

fromList :: [Item (Vector a)] -> Vector a #

fromListN :: Int -> [Item (Vector a)] -> Vector a #

toList :: Vector a -> [Item (Vector a)] #

(Eq k, Hashable k) => IsList (HashMap k v) 
Instance details

Defined in Data.HashMap.Base

Associated Types

type Item (HashMap k v) :: Type #

Methods

fromList :: [Item (HashMap k v)] -> HashMap k v #

fromListN :: Int -> [Item (HashMap k v)] -> HashMap k v #

toList :: HashMap k v -> [Item (HashMap k v)] #

Ord k => IsList (Map k v)

Since: containers-0.5.6.2

Instance details

Defined in Data.Map.Internal

Associated Types

type Item (Map k v) :: Type #

Methods

fromList :: [Item (Map k v)] -> Map k v #

fromListN :: Int -> [Item (Map k v)] -> Map k v #

toList :: Map k v -> [Item (Map k v)] #