packages feed

futhark-0.7.3: futlib/prelude.fut

-- | The default prelude that is implicitly available in all Futhark
-- files.

open import "soacs"
open import "array"
open import "math"
open import "functional"

-- | Create single-precision float from integer.
let r32 (x: i32): f32 = f32.i32 x
-- | Create integer from single-precision float.
let t32 (x: f32): i32 = i32.f32 x

-- | Create double-precision float from integer.
let r64 (x: i32): f64 = f64.i32 x
-- | Create integer from double-precision float.
let t64 (x: f64): i32 = i32.f64 x

-- | Semantically just identity, but in `futharki` the argument value
-- will be printed.
let trace 't (x: t): t =
  intrinsics.trace x

-- | Semantically just identity, but acts as a break point in
-- `futharki`.
let break 't (x: t): t =
  intrinsics.break x