prob-fx-0.1.0.2: A library for modular probabilistic modelling
Safe HaskellSafe-Inferred
LanguageHaskell2010

Util

Description

Some minor utility functions

Synopsis

Documentation

boolToInt :: Bool -> Int Source #

Return True for 1 and otherwise False

safeHead :: [a] -> Maybe a Source #

Safely attempt to return the head of a list

safeTail :: [a] -> [a] Source #

Return the tail of a list, behaving as the identity function upon an empty list

findIndexes :: Eq a => [a] -> a -> [Int] Source #

Return all the positions that a value occurs within a list