on master help sign in
Merge branch 'dev' into input
commitd5df18d51a43bd6fbf70dd886e172c6fbeb212ed authorEvan Czaplicki <info@elm-lang.org> dateTue 18 Feb 2014, 14:24 (13 years ago) parenta35f47f8aba726
11 files changed+28−21
changelog.txt+1 compiler/Parse/Helpers.hs+2−1 compiler/Parse/Module.hs+15−10 libraries/Dict.elm+2−2 libraries/Graphics/Collage.elm+1−1 libraries/Graphics/Element.elm+2−2 libraries/Http.elm+1−1 libraries/Json.elm+1−1 libraries/List.elm+1−1 libraries/Text.elm+1−1 libraries/Time.elm+1−1
changelog.txt+1
@@ -1,6 +1,7 @@
11
22## next
33
4+ * Change syntax for "import open List" to "import List (..)"
45 * Support Trampolining (thanks to Max New and Tim Hobbs)
56 * Drastically improved performance on markdown parsing (thanks to @Dandandan)
67 * Improved JSON format for types generated by elm-doc
compiler/Parse/Helpers.hs+2−1
@@ -169,7 +169,8 @@ betwixt a b c = do char a ; out <- c
169169 char b <?> "closing '" ++ [b] ++ "'" ; return out
170170
171171surround a z name p = do
172− char a ; v <- padded p
172+ char a
173+ v <- padded p
173174 char z <?> unwords ["closing", name, show z]
174175 return v
175176
compiler/Parse/Module.hs+15−10
@@ -8,7 +8,7 @@ import Parse.Helpers
88import SourceSyntax.Module (ImportMethod(..), Imports)
99
1010varList :: IParser [String]
11−varList = parens $ commaSep1 (var <|> parens symOp)
11+varList = commaSep1 (var <|> parens symOp)
1212
1313getModuleName :: String -> Maybe String
1414getModuleName source =
@@ -27,7 +27,7 @@ moduleDef = do
2727 whitespace
2828 names <- dotSep1 capVar <?> "name of module"
2929 whitespace
30− exports <- option [] varList
30+ exports <- option [] (parens varList)
3131 whitespace <?> "reserved word 'where'"
3232 reserved "where"
3333 return (names, exports)
@@ -38,17 +38,22 @@ imports = option [] ((:) <$> import' <*> many (try (freshLine >> import')))
3838import' :: IParser (String, ImportMethod)
3939import' =
4040 do reserved "import"
41− whitespace
42− open <- optionMaybe (reserved "open")
4341 whitespace
4442 name <- intercalate "." <$> dotSep1 capVar
45− case open of
46− Just _ -> return (name, Hiding [])
47− Nothing -> let how = try (whitespace >> (as' <|> importing'))
48− in (,) name <$> option (As name) how
43+ (,) name <$> option (As name) method
4944 where
45+ method :: IParser ImportMethod
46+ method = try $ do whitespace
47+ as' <|> importing'
48+
5049 as' :: IParser ImportMethod
51− as' = reserved "as" >> whitespace >> As <$> capVar <?> "alias for module"
50+ as' = do
51+ reserved "as"
52+ whitespace
53+ As <$> capVar <?> "alias for module"
5254
5355 importing' :: IParser ImportMethod
54− importing' = Importing <$> varList <?> "listing of imported values (x,y,z)"
56+ importing' =
57+ parens (choice [ const (Hiding []) <$> string ".."
58+ , Importing <$> varList
59+ ] <?> "listing of imported values (x,y,z)")
libraries/Dict.elm+2−2
@@ -31,8 +31,8 @@ Insert, remove, and query operations all take *O(log n)* time.
3131-}
3232
3333
34−import open Basics
35−import open Maybe
34+import Basics (..)
35+import Maybe (..)
3636import Native.Error
3737import List
3838import String
libraries/Graphics/Collage.elm+1−1
@@ -30,7 +30,7 @@ it as a single unit.
3030
3131-}
3232
33−import open Basics
33+import Basics (..)
3434import List
3535import Either (Either, Left, Right)
3636import Transform2D (Transform2D, identity)
libraries/Graphics/Element.elm+2−2
@@ -37,12 +37,12 @@ If you need more precision, you can create custom positions.
3737 midRightAt, topLeftAt, topRightAt, bottomLeftAt, bottomRightAt
3838-}
3939
40−import open Basics
40+import Basics (..)
4141import Native.Utils
4242import JavaScript as JS
4343import JavaScript (JSString)
4444import List as List
45−import open Color
45+import Color (..)
4646import Maybe (Maybe, Just, Nothing)
4747
4848type Properties = {
libraries/Http.elm+1−1
@@ -14,7 +14,7 @@ you have very strict latency requirements.
1414@docs Response
1515-}
1616
17−import open Signal
17+import Signal (..)
1818import Native.Http
1919
2020{-| The datatype for responses. Success contains only the returned message.
libraries/Json.elm+1−1
@@ -17,7 +17,7 @@ module Json where
1717
1818-}
1919
20−import open Basics
20+import Basics (..)
2121import Dict
2222import Maybe (Maybe)
2323import JavaScript as JS
libraries/List.elm+1−1
@@ -25,7 +25,7 @@ list must have the same type.
2525@docs sort, sortBy, sortWith
2626-}
2727
28−import open Basics
28+import Basics (..)
2929import Native.List
3030
3131{-| Add an element to the front of a list `(1 :: [2,3] == [1,2,3])` -}
libraries/Text.elm+1−1
@@ -16,7 +16,7 @@ module Text where
1616
1717-}
1818
19−import open Basics
19+import Basics (..)
2020import Color (Color)
2121import Graphics.Element (Element, Three, Pos, ElementPrim, Properties)
2222import Maybe (Maybe)
libraries/Time.elm+1−1
@@ -14,7 +14,7 @@ module Time where
1414
1515-}
1616
17−import open Basics
17+import Basics (..)
1818import Native.Time
1919import Signal (Signal)
2020