Top Qs
Timeline
Chat
Perspective
Eff (programming language)
Functional programming language From Wikipedia, the free encyclopedia
Remove ads
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]
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)
|
Remove ads
Example
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
;;
Remove ads
References
External links
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads