pub enum FutharkExpr {
Show 34 variants
IntLit(i64, FutharkType),
FloatLit(f64, FutharkType),
BoolLit(bool),
Var(String),
ArrayLit(Vec<FutharkExpr>),
Index(Box<FutharkExpr>, Box<FutharkExpr>),
Slice(Box<FutharkExpr>, Option<Box<FutharkExpr>>, Option<Box<FutharkExpr>>),
Map(Box<FutharkExpr>, Box<FutharkExpr>),
Map2(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>),
Reduce(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>),
Scan(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>),
Filter(Box<FutharkExpr>, Box<FutharkExpr>),
Zip(Box<FutharkExpr>, Box<FutharkExpr>),
Unzip(Box<FutharkExpr>),
Iota(Box<FutharkExpr>),
Replicate(Box<FutharkExpr>, Box<FutharkExpr>),
IfThenElse(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>),
Lambda(Vec<(String, FutharkType)>, Box<FutharkExpr>),
LetIn(String, Option<FutharkType>, Box<FutharkExpr>, Box<FutharkExpr>),
Loop(String, Box<FutharkExpr>, String, Box<FutharkExpr>, Box<FutharkExpr>),
BinOp(String, Box<FutharkExpr>, Box<FutharkExpr>),
UnOp(String, Box<FutharkExpr>),
Apply(Box<FutharkExpr>, Vec<FutharkExpr>),
TupleLit(Vec<FutharkExpr>),
RecordLit(Vec<(String, FutharkExpr)>),
FieldAccess(Box<FutharkExpr>, String),
Ascribe(Box<FutharkExpr>, FutharkType),
Scatter(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>),
Rotate(Box<FutharkExpr>, Box<FutharkExpr>),
Transpose(Box<FutharkExpr>),
Flatten(Box<FutharkExpr>),
Unflatten(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>),
Size(usize, Box<FutharkExpr>),
With(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>),
}Expand description
Futhark expression representation.
Variants§
IntLit(i64, FutharkType)
Integer literal: 42i32
FloatLit(f64, FutharkType)
Float literal: 3.14f64
BoolLit(bool)
Bool literal: true / false
Var(String)
Variable reference: x
ArrayLit(Vec<FutharkExpr>)
Array literal: [e1, e2, ...]
Index(Box<FutharkExpr>, Box<FutharkExpr>)
Array index: a[i]
Slice(Box<FutharkExpr>, Option<Box<FutharkExpr>>, Option<Box<FutharkExpr>>)
Array slice: a[lo:hi]
Map(Box<FutharkExpr>, Box<FutharkExpr>)
map f a
Map2(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>)
map2 f a b
Reduce(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>)
reduce op ne a
Scan(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>)
scan op ne a
Filter(Box<FutharkExpr>, Box<FutharkExpr>)
filter f a
Zip(Box<FutharkExpr>, Box<FutharkExpr>)
zip a b
Unzip(Box<FutharkExpr>)
unzip a
Iota(Box<FutharkExpr>)
iota n
Replicate(Box<FutharkExpr>, Box<FutharkExpr>)
replicate n x
IfThenElse(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>)
if cond then t else e
Lambda(Vec<(String, FutharkType)>, Box<FutharkExpr>)
Lambda: \\ x -> body
LetIn(String, Option<FutharkType>, Box<FutharkExpr>, Box<FutharkExpr>)
Let-in: let x = e in body
Loop(String, Box<FutharkExpr>, String, Box<FutharkExpr>, Box<FutharkExpr>)
Loop: loop (acc = init) for i < n do body
BinOp(String, Box<FutharkExpr>, Box<FutharkExpr>)
Binary operation: e1 op e2
UnOp(String, Box<FutharkExpr>)
Unary operation: op e
Apply(Box<FutharkExpr>, Vec<FutharkExpr>)
Function application: f a1 a2 ...
TupleLit(Vec<FutharkExpr>)
Tuple construction: (e1, e2, ...)
RecordLit(Vec<(String, FutharkExpr)>)
Record construction: {field = e, ...}
FieldAccess(Box<FutharkExpr>, String)
Field access: r.field
Ascribe(Box<FutharkExpr>, FutharkType)
Type ascription: e : t
Scatter(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>)
Scatter: scatter a is vs
Rotate(Box<FutharkExpr>, Box<FutharkExpr>)
rotate n a
Transpose(Box<FutharkExpr>)
transpose a
Flatten(Box<FutharkExpr>)
Flatten: flatten a
Unflatten(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>)
unflatten n m a
Size(usize, Box<FutharkExpr>)
Size expression: #(e)
With(Box<FutharkExpr>, Box<FutharkExpr>, Box<FutharkExpr>)
with update: a with [i] = v
Trait Implementations§
Source§impl Clone for FutharkExpr
impl Clone for FutharkExpr
Source§fn clone(&self) -> FutharkExpr
fn clone(&self) -> FutharkExpr
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FutharkExpr
impl RefUnwindSafe for FutharkExpr
impl Send for FutharkExpr
impl Sync for FutharkExpr
impl Unpin for FutharkExpr
impl UnsafeUnpin for FutharkExpr
impl UnwindSafe for FutharkExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more