Built-in functions and types

The following types are built-in and not defined in the standard library:

  • Bool, List, Ordering, DateTime::Components, DateTime::DayOfWeek, Agent, and Event

In addition to the built-in types, there are a number of built-in functions:

  • prim__foldl : (b -> a -> b) -> b -> List a -> b
  • prim__foldr : (a -> b -> b) -> b -> List a -> b
  • prim__List_sort : List a -> (a -> a -> Ordering) -> List a
  • prim__DateTime_addSeconds : DateTime -> Int -> DateTime
  • prim__DateTime_components : DateTime -> DateTime::Components
  • prim__DateTime_dayOfWeek : DateTime -> DateTime::DayOfWeek
  • prim__Int_toFloat : Int -> Float
  • prim__Int_toString : Int -> String
  • prim__String_append : String -> String -> String
  • prim__getEvents : String -> List Event

The built-in functions are used in the definition of the standard library. E.g. foldl and foldr are just shorthands for respectively prim__foldl and prim_foldr. A user should always use the version in the standard library and never explicitly make use of the built-in functions.