Eff (programming language)
Jump to navigation
Jump to search
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
| Eff | |
|---|---|
| Paradigms | Multi-paradigm: functional, imperative |
| Family | ML: Caml: OCaml |
| Designed by | Andrej Bauer, Matija Pretnar |
| First appeared | March 5, 2012 |
| Stable release | 5.1
/ October 19, 2021 |
| Implementation language | OCaml |
| Platform | x86-64 |
| OS | Cross-platform: macOS, Linux, Windows |
| License | BSD 2-clause |
| Website | www |
| Influenced by | |
| OCaml | |
Eff is a general-purpose, high-level, multi-paradigm, functional programming language similar in syntax to OCaml which integrates the functions of algebraic effect handlers.[1][2]
Example
[edit | edit source]effect Get_next : (unit -> unit) option
effect Add_to_queue : (unit -> unit) -> unit
let queue initial = handler
| effect Get_next k ->
( fun queue -> match queue with
| [] -> (continue k None) []
| hd::tl -> (continue k (Some hd)) tl )
| effect (Add_to_queue y) k -> ( fun queue -> (continue k ()) (queue @ [y]))
| x -> ( fun _ -> x)
| finally x -> x initial
;;
References
[edit | edit source]External links
[edit | edit source]