User loginNavigation |
archivesWhat's the type of an optional parameter?Functions in the language I'm building may have optional parameters, i.e. parameters that may or may not be supplied by the caller. In Common Lisp, unsupplied optional parameters receive NIL as their value. I want to avoid NIL, because I'd like to add an optional type system to the language later, and I don't want to have NIL as a value that's "in every type". So I've thought of making the type of optional parameters be like Haskell's Maybe: when the parameter is supplied with a value X, the function body receives it as Just X, and when the parameter is not supplied, it's Nothing (this means that for optional parameters, matching against Just or Nothing is always required in the function body). Thoughts? Handlers of Algebraic EffectsMatija Pretnar, Gordon Plotkin (2009) Handlers of Algebraic Effects:
Handling a computational effect, such as raising an exception, amounts to homomorphically mapping the handled computation onto another computation. So, for example, While encompassing both returning and non-returning handlers, this idea becomes more interesting when you start to handle the other effects, such as If you want a gentler introduction to the subject (along with Plotkin's algebraic theory of effects and Levy's Call-by-Push-Value), try Pretnar's 2010 thesis. |
Browse archivesActive forum topics |
Recent comments
22 weeks 4 days ago
22 weeks 4 days ago
22 weeks 4 days ago
44 weeks 5 days ago
49 weeks 14 hours ago
50 weeks 4 days ago
50 weeks 4 days ago
1 year 1 week ago
1 year 5 weeks ago
1 year 5 weeks ago