The CSL Standard Library¶
This section gives an overview of the types and functions which are currently available from the CSL standard library. A number of types are built-in and therefore not defined in the standard library. The complete source code of the standard library can be seen here.
- Functions operating on numbers
- String functions
- Boolean functions
- Time and date functions
- Duration functions
Duration::fromSeconds : Float -> Duration
Duration::fromMinutes : Float -> Duration
Duration::fromHours : Float -> Duration
Duration::fromDays : Float -> Duration
Duration::toSeconds : Duration -> Float
Duration::addSeconds : DateTime -> Float -> DateTime
Duration::between : DateTime -> DateTime -> Duration
Duration::diffDateTimes : DateTime -> DateTime -> Duration
Duration::addDurations : Duration -> Duration -> Duration
Duration::subDurations : Duration -> Duration -> Duration
Duration::addToDateTime : Duration -> Duration -> DateTime
Duration::negate : Duration -> Duration -> Duration
Duration::components : Duration -> Duration::Components
- Signed functions
- General combinators
Tuple
Maybe
Ordering
List
- Folding lists with
foldl
andfoldr
- Choosing between
foldr
andfoldl
List::head : List a -> Maybe a
List::headOrDefault : a -> List a -> a
List::tail : List a -> Maybe a
List::sort : (a -> a -> Ordering) -> List a -> List a
List::length : List a -> Int
List::isEmpty : List a -> Boolean
List::map : (a -> b) -> List a -> List b
List::mapMaybe : (a -> Maybe b) -> List a -> List b
List::filter : (a -> Bool) -> List a -> List a
List::zipWith : (a -> b -> c) -> List a -> List b -> List c
List::any : (a -> Bool) -> List a -> Bool
List::all : (a -> Bool) -> List a -> Bool
List::first : (a -> Bool) -> List a -> Maybe a
List::last : (a -> Bool) -> List a -> Maybe a
List::append : List a -> List a -> List a
List::concat : List (List a) -> List a
List::concatMap : (a -> List b) -> List a -> List b
List::reverse : List a -> List a
List::take : Int -> List a -> List a
List::drop : Int -> List a -> List a
List::equalsWith : (a -> b -> Bool) -> List a -> List b -> Bool
List::Int::equals : List Int -> List Int -> Bool
List::Float::equals : List Float -> List Float -> Bool
List::String::equals : List String -> List String -> Bool
List::DateTime::equals : List DateTime -> List DateTime -> Bool
- Folding lists with
Event
- Built-in functions and types
- CSL standard library source code