Eff (programming language)

Jump to content
From Wikipedia, the free encyclopedia
Eff
ParadigmsMulti-paradigm: functional, imperative
FamilyML: Caml: OCaml
Designed byAndrej Bauer, Matija Pretnar
First appearedMarch 5, 2012; 13 years ago (2012-03-05)
Stable release
5.1 / October 19, 2021; 4 years ago (2021-10-19)
Implementation languageOCaml
Platformx86-64
OSCross-platform: macOS, Linux, Windows
LicenseBSD 2-clause
Websitewww.eff-lang.org
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]
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]
  1. ^ "Eff Programming Language". Eff-lang.org. Retrieved 2019-11-18.
  2. ^ Bauer, Andrej; Pretnar, Matija (March 2012). Programming with Algebraic Effects and Handlers (PDF) (Report). Department of Mathematics and Physics, University of Ljubljana, Slovenia.
[edit]


    Eff
    ParadigmsMulti-paradigm: functional, imperative
    FamilyML: Caml: OCaml
    Designed byAndrej Bauer, Matija Pretnar
    First appearedMarch 5, 2012; 13 years ago (2012-03-05)
    Stable release
    5.1 / October 19, 2021; 4 years ago (2021-10-19)
    Implementation languageOCaml
    Platformx86-64
    OSCross-platform: macOS, Linux, Windows
    LicenseBSD 2-clause
    Websitewww.eff-lang.org
    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

    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

    1. ^ "Eff Programming Language". Eff-lang.org. Retrieved 2019-11-18.
    2. ^ Bauer, Andrej; Pretnar, Matija (March 2012). Programming with Algebraic Effects and Handlers (PDF) (Report). Department of Mathematics and Physics, University of Ljubljana, Slovenia.


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Eff_(programming_language)&oldid=1256361436"