Commit graph

1698 commits

Author SHA1 Message Date
Justin Leitgeb
9ae1825939 Fix deserialization of interfaces in Prelude
We previously had to fix a corrupt Map by changing it to a List and then back
into a Map. It turns out we had to do this because the original data structure
on disk wasn't a Map to begin with, but a List. It was previously assumed to be
a Map by the compiler because the first function that it was passed to took a
type of `Interfaces` which is a Map of interface definitions. Unfortunately this
didn't cause a runtime error when Haskell found out that the structure wasn't
deserialized into a Map. Instead Haskell happily created a broken Map that
couldn't find members some of the members that it contained (it could find
somewhere around the first half of its members, but the second half it reported
as missing when they were clearly present).

Changing the type of the first function that the deserialized structure is
passed to from a Map (actually Interfaces which is a type of Map) to a List
allows Haskell to infer the correct type to deserialize into and makes
everything work as expected.
2013-11-07 10:21:37 -05:00
Evan Czaplicki
b3d5357287 Rename to findAll and find like everyone expects :/
It's not consistent with `split` but people seem okay with that.

Also make some examples nicer.
2013-11-04 17:06:48 +01:00
Evan Czaplicki
00dfb69367 Modify error messages for bad build artifacts to wrap more nicely on the terminal 2013-11-04 16:37:15 +01:00
Evan Czaplicki
5a1c9ed353 Unnecessary style changes
I don't really know why I felt the need to do this, but I am happier
now.
2013-11-04 13:28:03 +01:00
Evan Czaplicki
b1bca38488 Get rid of either-unwrap dependency and use fewer non-total library functions 2013-11-04 13:26:05 +01:00
Evan Czaplicki
0ffd3e20dd Merge pull request #319 from johnpmayer/dev
language-ecmascript before v0.15 does not have the Pretty(prettyPring) c...
2013-11-04 02:31:50 -08:00
Evan Czaplicki
5c5c05fed9 Merge pull request #320 from jsl/313_verify_serialized_interfaces
Give more helpful error messages when deserializing elmi files
2013-11-04 02:30:26 -08:00
Justin Leitgeb
c845e586ed Give more helpful error messages when deserializing elmi files
Provides an error message indicating incorrect compiler version or corrupt file.
Exit status will be 1 in either failure case and error message is printed to
stderr. Uses the same checks against interfaces.data as well as standard .elmi
files since both are susceptible to breaking in the same way.

The following will be displayed when an elmi file has a different compiler
version than the elm compiler that tries to load it:

    justin ~/Code/elm-lang.org/public/examples/Intermediate $ ~/Code/elm/dist/build/elm/elm Pong.elm
    Found build artifacts created by a different Elm compiler version. Please rebuilt cache/Pong.elmi and try again.

The following will be displayed when a file that cannot be deserialized is
encountered:

    justin ~/Code/elm-lang.org/public/examples/Intermediate $ ~/Code/elm/dist/build/elm/elm Pong.elm
    Got an error, 'demandInput: not enough bytes' at offset 10303 of cache/Pong.elmi.

    This error may be due to an outdated or corrupt artifact from a previous build. Please rebuild cache/Pong.elmi and try again.
2013-11-03 20:35:10 -05:00
Evan Czaplicki
82e9acf16e Change the internal representation of Text
Now generates significantly fewer spans and is a bit faster.
I also removed the `header` function.
2013-11-03 15:20:30 +01:00
Evan Czaplicki
46b9558b1a Get rid of unnecessary logging 2013-11-03 15:11:09 +01:00
Evan Czaplicki
b4440ad607 Stop creating dummy divs around every Element in a collage, fixes ordering issue in elm-at-pldi-2013 2013-11-03 02:29:51 +01:00
Evan Czaplicki
1e1b0c1281 merge find and replace in docs 2013-11-03 01:06:19 +01:00
Evan Czaplicki
ef2b38fe11 Always switch out Text elements 2013-11-02 23:17:29 +01:00
Evan Czaplicki
dd9c90d457 add note about Regex library 2013-11-02 19:47:21 +01:00
Evan Czaplicki
90e007730d introduce the padded function to use fewer whitespace markers 2013-11-02 19:21:26 +01:00
Evan Czaplicki
934e590a7b Be sure to avoid variable shadowing when generating temporary variables, fix for # 318 2013-11-02 19:05:07 +01:00
John P Mayer Jr
2ad4394eb1 language-ecmascript before v0.15 does not have the Pretty(prettyPring) class 2013-11-02 13:47:53 -04:00
Evan Czaplicki
a24872f330 cosmetic: remove a blank line 2013-11-01 23:51:49 +01:00
Evan Czaplicki
e411990a87 Create a Regex library 2013-11-01 23:51:23 +01:00
Evan Czaplicki
d1cee239d3 Add a couple type annotations 2013-11-01 13:58:18 +01:00
Evan Czaplicki
5eaa5b1c1e Merge branch 'master' into dev 2013-10-31 15:54:44 +01:00
Evan Czaplicki
e3c3d217f9 Merge branch 'dev' of https://github.com/evancz/Elm into dev 2013-10-31 15:53:35 +01:00
Tobias Hermann
1ed37fee60 type annotation of String.isEmpty: "isEmpty : String" => isEmpty : String -> Bool 2013-10-31 15:52:35 +01:00
Evan Czaplicki
4991cb17fa Add note about Transform2D improvements 2013-10-31 15:52:18 +01:00
Evan Czaplicki
a1b1b7473d Merge pull request #316 from Dobiasd/patch-1
type annotation of String.isEmpty: "isEmpty : String" => isEmpty : Strin...
2013-10-31 07:51:10 -07:00
Evan Czaplicki
0ec031440a Merge pull request #317 from Sheeo/dev-patch
[Cosmetic] Whitespace/indentation fixes in JS runtime
2013-10-31 07:31:42 -07:00
Michael Sondergaard
d57762e3ce Fix mixed indent and whitespace in Utils.js 2013-10-31 14:51:12 +01:00
Michael Sondergaard
9aa468e59a Fix newline at EOF in Element.js 2013-10-31 14:50:21 +01:00
Michael Sondergaard
3c5d415c77 Fix whitespace and mixed indent in Collage.js 2013-10-31 14:48:47 +01:00
Michael Sondergaard
db7e3f618f Fix whitespace in Init.js 2013-10-31 14:47:31 +01:00
Tobias Hermann
167298290b type annotation of String.isEmpty: "isEmpty : String" => isEmpty : String -> Bool 2013-10-31 14:25:22 +01:00
Evan Czaplicki
65509d7991 Correct the scaleY function, get rid of a 3x3 matrix in docs, use 3x3 matrices in multiply docs to clarify how two 3x2 matrices can be multiplied 2013-10-31 12:23:42 +01:00
Evan Czaplicki
b89ace01cf Merge branch 'master' into dev 2013-10-31 12:16:14 +01:00
Evan Czaplicki
5edfdb0bdd Merge pull request #307 from Sheeo/transform
Improve Transform2D
2013-10-31 04:12:33 -07:00
Michael Sondergaard
76de6741c3 Use s for scaling variable 2013-10-31 12:01:41 +01:00
Evan Czaplicki
b89694116f Merge pull request #314 from jsl/304_print_program_fix
Remove the --print-program option
2013-10-30 13:43:04 -07:00
Evan Czaplicki
9235464276 update for 0.10 and 0.11 so far 2013-10-30 21:27:03 +01:00
Evan Czaplicki
d1af099b33 Merge pull request #315 from thSoft/patch-1
Fix grammar
2013-10-30 08:40:11 -07:00
Dénes Harmath
36fca0bbea Accepted another grammar fix proposal 2013-10-30 16:37:28 +01:00
Evan Czaplicki
5d1ba746ac Merge branch 'master' into dev 2013-10-30 16:34:29 +01:00
Evan Czaplicki
427ac521a3 Hide internal structure of Elements, Forms, and Positions 2013-10-30 16:34:06 +01:00
Evan Czaplicki
117294ee94 Provide a fake window in needed, making runtime run on node.js 2013-10-30 16:33:44 +01:00
Evan Czaplicki
d57b91c537 Stop using a custom cache directory, and stop deleting the cache immediately. Also clean up related code. 2013-10-30 16:31:29 +01:00
Dénes Harmath
68101742c9 Fix grammar 2013-10-30 16:19:02 +01:00
Justin Leitgeb
006e086cd5 Remove print_program option
This option was applied inconsistently based on whether previous build
artifacts existed, and isn't incredibly useful anyway for users of the
language.
2013-10-30 08:52:24 -05:00
Evan Czaplicki
9c9fcc7a1e Actually switch to the new module name 2013-10-29 19:50:55 +01:00
Evan Czaplicki
904c22450b Rename Bits to Bitwise
A substitute for being streetwise
2013-10-29 19:42:04 +01:00
Evan Czaplicki
abf05d70c8 Make explanations a bit more helpful 2013-10-29 19:06:55 +01:00
Evan Czaplicki
2f7739949f Add a library for bitwise operators 2013-10-29 18:47:37 +01:00
Justin Leitgeb
17f407adda Trim trailing whitespace 2013-10-29 11:22:33 -05:00