Eff (programming language)

{{Short description|Functional programming language}}

{{Multiple issues|{{more citations needed|date=November 2019}}{{primary sources|date=November 2019}}

}}

{{Infobox programming language

| title = Eff

| paradigms = Multi-paradigm: functional, imperative

| family = ML: Caml: OCaml

| designers = Andrej Bauer, Matija Pretnar

| released = {{Start date and age|2012|03|05}}

| latest release version = 5.1

| latest release date = {{Start date and age|2021|10|19}}

| programming language = OCaml

| platform = x86-64

| operating system = Cross-platform: macOS, Linux, Windows

| license = BSD 2-clause

| website = {{URL|www.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.{{Cite web |url=https://www.eff-lang.org/ |title=Eff Programming Language |website=Eff-lang.org |access-date=2019-11-18}}{{Cite report |last1=Bauer |first1=Andrej |last2=Pretnar |first2=Matija |date=March 2012 |url=https://math.andrej.com/wp-content/uploads/2012/03/eff.pdf |title=Programming with Algebraic Effects and Handlers |publisher=Department of Mathematics and Physics, University of Ljubljana, Slovenia}}

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

{{Reflist}}