You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Morel, a query is an expression, and a function is a parameterized expression. What a database would call a 'view' is, in Morel, just a function that returns a relation.
You can substitute expressions, predicates (lambda expressions that return bool), and even other functions/views into views.
For example, here we define an empsIn view whose parameters are emps (a table) and predicate (a condition to apply to each row):
let
fun empsIn emps predicate =
from e in emps
where predicate e
in
from e in (empsIn emps (fn e => e.deptno = 30))
yield e.name
end;
val it = ["Shaggy","Scooby"] : string list
The text was updated successfully, but these errors were encountered:
In Morel, a query is an expression, and a function is a parameterized expression. What a database would call a 'view' is, in Morel, just a function that returns a relation.
You can substitute expressions, predicates (lambda expressions that return
bool
), and even other functions/views into views.For example, here we define an
empsIn
view whose parameters areemps
(a table) andpredicate
(a condition to apply to each row):The text was updated successfully, but these errors were encountered: