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
@danabr raised a point about type definitions vs types themselves in PR #116 , e.g.
type opt 'a = Some 'a | None
type int_opt = opt int
The name in the left-hand side of each of these could be viewed in a similar manner as function names in let bindings, that is, independent of their variables and members/bodies whereas opt int is a concrete type. Similarly as raised by @ypaq and others elsewhere:
let f x = x + x
could be viewed as syntactic sugar for
let f = fun x -> x + x
or something to that effect.
We might then add an alpaca_type_def node that binds variables and members to a type name while a member of a type binding stays as an alpaca_type AST node since it is in fact a concrete type. Functions then might be decomposed into two things as well:
an alpaca_fun node that lists function versions, each of which has their associated variables and bodies.
alpaca_fun_def that binds a name and arity (the latter for convenience) to a single alpaca_fun AST node.
This should make lambdas fairly simple to implement and makes types, functions, and values all operate in a similar manner.
Thoughts?
The text was updated successfully, but these errors were encountered:
@danabr raised a point about type definitions vs types themselves in PR #116 , e.g.
The name in the left-hand side of each of these could be viewed in a similar manner as function names in
let
bindings, that is, independent of their variables and members/bodies whereasopt int
is a concrete type. Similarly as raised by @ypaq and others elsewhere:could be viewed as syntactic sugar for
or something to that effect.
We might then add an
alpaca_type_def
node that binds variables and members to a type name while a member of a type binding stays as analpaca_type
AST node since it is in fact a concrete type. Functions then might be decomposed into two things as well:alpaca_fun
node that lists function versions, each of which has their associated variables and bodies.alpaca_fun_def
that binds a name and arity (the latter for convenience) to a singlealpaca_fun
AST node.This should make lambdas fairly simple to implement and makes types, functions, and values all operate in a similar manner.
Thoughts?
The text was updated successfully, but these errors were encountered: