Commit graph

28 commits

Author SHA1 Message Date
Evan Czaplicki
74d0482ace Move show function to String library and get rid of Prelude library 2014-03-01 13:58:02 -05:00
Evan Czaplicki
2cfb343e93 Move getDataFile function so that it is not exposed to the outside world 2014-02-13 09:31:19 +01:00
Evan Czaplicki
33bd016678 Check environment variable ELM_HOME if the files were not placed by cabal 2014-02-10 23:03:13 +01:00
Evan Czaplicki
7e2deceb9a Add Native.Ports to prelude for user defined modules 2014-01-06 07:48:22 +01:00
Evan Czaplicki
c03049a960 Simplify Build.Interface API, do not read "interfaces.data" when the --no-prelude flag is used 2014-01-04 15:59:24 +01:00
Evan Czaplicki
170006534d Rename InterfaceSerialization file and change the function names in it 2014-01-04 15:19:30 +01:00
Evan Czaplicki
defb47db75 Get rid of warnings 2014-01-04 11:34:09 +01:00
Evan Czaplicki
c966776788 Add -W flag to many files, mostly getting rid of dead imports 2014-01-04 10:54:46 +01:00
Evan Czaplicki
9ff26223d8 Handle --no-prelude flag in the Metadata.Prelude module rather than distributed across many modules
Good in case the meaning of —no-prelude changes
2014-01-04 09:35:26 +01:00
Evan Czaplicki
3af5c2a652 Switch to new format for Expr, Def, and Module 2014-01-02 23:37:52 -08:00
Justin Leitgeb
8fc72d2b30 Remove instance of unsafePerformIO 2013-11-12 22:22:49 -05:00
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
b1bca38488 Get rid of either-unwrap dependency and use fewer non-total library functions 2013-11-04 13:26:05 +01: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
a446d609f2 Ensure that binary serialization works on Windows. Previously had issues with line ending conversions messing with binary data. 2013-08-06 00:36:07 -07:00
Evan Czaplicki
a268421893 Get show, readInt, and readFloat working again 2013-08-04 12:22:58 -07:00
Evan Czaplicki
8bc39cd620 change error message 2013-08-02 01:53:40 -07:00
Evan Czaplicki
f9cc4516d8 Import qualified Text module by default 2013-07-31 23:47:29 -07:00
Evan Czaplicki
fa132ea6a8 Change name of Prelude to Basic, matching change in libraries/ 2013-07-28 02:35:52 +02:00
Evan Czaplicki
0a6bd8bd96 Generate and use interfaces.data so standard library types are available 2013-07-28 02:24:17 +02:00
Evan Czaplicki
016a199b50 Start using Metadata.Prelude 2013-07-25 20:53:22 +02:00
Evan Czaplicki
d4b23664e4 Rename Metadata.Libraries to Metadata.Prelude 2013-07-25 20:44:41 +02:00
Evan Czaplicki
a4468d2eac Combine two Metadata files into one 2013-07-25 20:39:23 +02:00
Evan Czaplicki
e702370b9e Rename a module 2013-07-25 20:21:17 +02:00
Evan Czaplicki
4c02f6ba7d Start reworking the Metadata modules 2013-07-25 20:20:33 +02:00
Evan Czaplicki
0070a844d0 Switch the internal data constructor name for tuples. Before tuple
constructors could be shadowed by user defined ADT's such as "Tuple0",
"Tuple2", etc. Now it uses "_Tuple0" to make it impossible to overlap
with user defined ASTs.
2013-07-14 19:52:50 +02:00
evancz
9a40249e05 Fix the confusion with "Cons" and "Nil" in issue #176.
Also add the ExplicitList expression.
2013-06-20 21:25:10 -07:00
evancz
272ecc67fd Rename Model/ to Metadata/ because it now only holds info about the types of library functions. 2013-06-13 20:45:12 -07:00