on master help sign in
Merge branch 'dev' of https://github.com/evancz/Elm into dev
commit4bb23bc904eaa16923ba3f99ed09d1ee3f2c5d35 authorevancz <info@elm-lang.org> dateTue 14 May 2013, 16:30 (13 years ago) parentb04e97ac575e4c
5 files changed+15−8
compiler/Gen/GenerateHtml.hs+1−1 libraries/Graphics/Collage.elm+6 libraries/Json.elm+2−2 libraries/Signal.elm+5−4 libraries/Time.elm+1−1
compiler/Gen/GenerateHtml.hs+1−1
@@ -44,7 +44,7 @@ generateHtml libLoc title source =
4444 case buildFromSource True source of
4545 Right modul -> modulesToHtml Readable title libLoc [] True [modul]
4646 Left err -> createHtml Readable libLoc title (Right $ showErr err)
47− (H.noscript "") "Elm.Main"
47+ (H.noscript "") "Main"
4848
4949
5050modulesToHtml jsStyle title libLoc jss nscrpt modules =
libraries/Graphics/Collage.elm+6
@@ -46,6 +46,7 @@ defaultLine = {
4646 miterLimit = 10
4747 }
4848
49+-- default LineStyles
4950solid : Color -> LineStyle
5051solid clr = { defaultLine | color <- clr }
5152dashed : Color -> LineStyle
@@ -79,6 +80,11 @@ outlined style shape = form (FShape (Left style) shape)
7980traced : LineStyle -> Path -> Form
8081traced style path = form (FPath style path)
8182
83+-- Draw a sprite
84+-- w width
85+-- h height
86+-- pos (px,py) coordinates into the sprite map
87+-- src The location of the image
8288sprite : Int -> Int -> (Int,Int) -> String -> Form
8389sprite w h pos src = form (FImage w h pos src)
8490
libraries/Json.elm+2−2
@@ -38,12 +38,12 @@ toJSString : Value -> JSString
3838toJSString v = Native.toPrettyJSString "" v
3939
4040-- Parse a string representation of a proper JSON object into
41−-- its Elm's representation.
41+-- its Elm representation.
4242fromString : String -> Maybe Value
4343fromString s = Native.fromJSString (JS.fromString s)
4444
4545-- Parse a JavaScript string representation of a proper JSON object into
46−-- its Elm's representation.
46+-- its Elm representation.
4747fromJSString : JSString -> Maybe Value
4848
4949
libraries/Signal.elm+5−4
@@ -3,7 +3,7 @@
33-- working with time (e.g. setting FPS) and combining signals and time (e.g.
44-- delaying updates, getting timestamps) can be found in the
55-- [`Time`](/docs/Signal/Time.elm) library.
6−--
6+--
77-- Note: There are lift functions up to `lift8`.
88module Signal where
99
@@ -29,7 +29,7 @@ lift8 : (a -> b -> c -> d -> e -> f -> g -> h -> i) -> Signal a -> Signal b -> S
2929
3030-- Create a past-dependent signal. Each value given on the input signal will
3131-- be accumulated, producing a new output value.
32−--
32+--
3333-- For instance, `(foldp (\\t acc -> acc + 1) 0 (Time.every second))` increments every second.
3434foldp : (a -> b -> b) -> b -> Signal a -> Signal b
3535
@@ -41,6 +41,7 @@ merge : Signal a -> Signal a -> Signal a
4141-- signals update simultaneously.
4242merges : [Signal a] -> Signal a
4343
44+-- Combine many signals into one, with an array of results.
4445combine : [Signal a] -> Signal [a]
4546combine = L.foldr (S.lift2 (::)) (S.constant [])
4647
@@ -104,9 +105,9 @@ delay : Time -> Signal a -> Signal a
104105
105106-- Signal application. This takes two signals, holding a function and
106107-- a value. It applies the current function to the current value.
107−--
108+--
108109-- So the following expressions are equivalent:
109−--
110+--
110111-- scene <~ Mouse.x ~ Mouse.y
111112-- lift2 scene Mouse.x Mouse.y
112113(~) : Signal (a -> b) -> Signal a -> Signal b
libraries/Time.elm+1−1
@@ -39,7 +39,7 @@ inHours t = t / hour
3939fps : Number a -> Signal Time
4040
4141-- Same as the fps function, but you can turn it on and off. Allows you
42−-- to do brief animations based on user input without major ineffeciencies.
42+-- to do brief animations based on user input without major inefficiencies.
4343-- The first time delta after a pause is always zero, no matter how long
4444-- the pause was. This way summing the deltas will actually give the amount
4545-- of time that the output signal has been running.