Content deleted Content added
Re-organize and clarify |
No edit summary |
||
Line 10:
}}
Elm is a [http://en.wikipedia.org/wiki/Functional_programming functional programming] language for [http://en.wikipedia.org/wiki/Declarative_programming declaratively] creating [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces]. Elm uses the [http://en.wikipedia.org/wiki/Functional_reactive_programming Functional Reactive Programming] style and [http://en.wikipedia.org/wiki/Purely_functional purely functional] graphical layout to build user interface without any destructive updates.
== Description ==
Line 17:
Elm allows [http://en.wikipedia.org/wiki/Markdown Markdown] to be embedded directly, so users can create text content in a familiar and natural way.
Elm's version of [http://en.wikipedia.org/wiki/Functional_reactive_programming Functional Reactive Programming] is event-driven, meaning that updates are only performed as necessary. It shares the closest resemblance to Event-Driven FRP and Arrowized FRP.
== Code Examples ==
The following program displays the position of the mouse as it moves around the screen, automatically updating the screen in real-time.
<source lang="haskell">
main = lift asText Mouse.position
</source>
The value of main is displayed on screen. Function asText turns any value into a displayable textual representation. Mouse.position is a value that changes over time, called a signal. Function lift ensures that asText is applied to Mouse.position every time the mouse moves.
Elm's list interpolation allows sequences of numbers to be easily created.
<source lang="haskell">
factorial n = product [1..n]
</source>
== External links ==
|