Commit graph

16 commits

Author SHA1 Message Date
evancz
6b28feaa2b Switch name of Context to Located. Whoo static types :) 2013-05-29 16:20:38 -07:00
evancz
b359fd0b47 Revise elm-docs to copy the names of type variables in type annotations directly. 2013-05-04 18:19:54 -07:00
evancz
6ca373bdeb Move Geometry into Collage. Get rid of Graphics prefix as appropriate. 2013-04-28 20:57:48 -07:00
evancz
00d3ad2db6 Shorten Libraries.hs, and fix some types in some of the libraries. 2013-04-22 02:36:11 -07:00
evancz
cf2357f527 Remove testing via unsafePerformIO 2013-04-09 19:49:35 -07:00
evancz
5d536d129a Get prelude added in all cases. 2013-04-08 01:48:30 -07:00
evancz
703508f1c3 Fix prelude imports and correctly generalize for library types that use Number. 2013-04-07 17:55:34 -07:00
evancz
5faf79c6da Also hide height from the Text module, which overlaps with the Element version of the function. 2013-04-05 09:53:15 -07:00
evancz
1af2ff9a01 Get the API for Language.Elm in better shape. Trying to get elm-lang.org working again. 2013-04-04 10:37:43 -07:00
evancz
82f888cb3d Get the type-checker running based on docs.json information. Also add rules for Nil and Tuple0, Tuple2, etc. 2013-04-04 01:09:35 -07:00
evancz
294fdfdaa5 Add prelude in compiler with flag. Re-add the hiding option for modules internally. 2013-04-03 00:32:21 -07:00
ngunn
175f268622 Fix cabal install missing docs.json (followup)
See: 14e32add30
for discussion on first attempt

Changed Librarys.hs and LoadLibraries.hs from TemplateHaskell to usafeIO.
Avoids needing to touch LoadLibraries after we change docs.json (as the file is loaded at runtime).
Also removes need for using CPP
Drawback of using unsafeIO is fairly well known/understood + this is a classic use-case.
Added error handling to LoadLibraries.hs

Setup.hs now uses "runProcess" instead of "system" to invoke elm compiler.
This allows us to set the environment variable "Elm_datadir" which is picked up by LoadLibraries and makes sure we get the just-built version in dist/data.
Also explicitly sets the RTS file to make sure we're not using one (as we're currently building it!)
Also change the folder the compiled JavaScript ends up in to dist/js.  Writing to the source tree, then deleting isn't very nice + this should make it easier to find elm compilation errors.  cabal clean handles the file deletion, too.

I think this fixes all the defects of the first version:
1. CPP is not needed
2. touch is not needed
3. building elm-runtime.js uses dist/data/docs.json
4. running elm after install uses the installed elm-runtime.js and docs.json
5. LoadLibraries.hs is simpler.  Doesn't use CPP or TemplateHaskell.  Has error handling and a decent error message
6. cabal clean && cabal install builds everything with the right data in the right order

(tested on ghc 7.4.1)
2013-03-22 15:52:40 +00:00
ngunn
14e32add30 Fix cabal install missing docs.json
See: https://github.com/evancz/Elm/issues/120

Add build-hook to Setup.hs so that elm-doc gets build and executed before library or elm exec gets built.
Add preprocessor to Elm.cabal so LoadLibraries.hs can load docs.json from the build folder instead of installed folder
Add touch to Setup.hs otherwise LoadLibraries.hs doesn't get recompiled.  This is non-portable, but I can't find a portable way (see Setup.hs for details)

cabal clean && cabal install now works
(tested on ghc 7.4.1)
2013-03-21 13:31:55 +00:00
evancz
131a2b6818 Get sprites working in collage. temporary fix for docs.json issue. Looks like git thinks we're in the past, so a bunch of changes that have already happened as well. 2013-03-21 02:29:23 -07:00
evancz
7dbb052b22 Load json representation of types with Template Haskell, so library files are the base truth of type information.
Make minor fixes in libraries, such as adding the Char labrary and fixing the types in the Dict library.
2013-03-16 22:24:18 -07:00
evancz
99ae5c6ba0 Finish moving the compiler down a directory. 2013-03-16 12:07:32 -07:00