Evan Czaplicki
6fb2fa9ee0
Chose the best alias when many apply (fixes issue #227 )
2013-09-02 14:59:22 -07:00
Evan Czaplicki
128e21db21
Prettier printing
2013-09-01 22:51:04 -07:00
Evan Czaplicki
a4fdf0664c
Add names to functions in generated JS.
2013-09-01 22:20:08 -07:00
Evan Czaplicki
7e1d95a108
Move the markdown
function to the text library
2013-09-01 22:20:07 -07:00
Evan Czaplicki
aed6d9547a
Merge branch 'experimental' into dev
...
Conflicts:
compiler/Generate/JavaScript.hs
2013-09-01 01:43:51 -07:00
Evan Czaplicki
6b855f932e
Fix problem with overlapping variable names in generated code
2013-09-01 01:25:10 -07:00
Evan Czaplicki
1f48a279eb
Properly generate infix ops not in Basics
2013-08-31 21:12:11 -07:00
Evan Czaplicki
3a072982ac
Get generation working
...
move `makeSafe` over and make floats work
2013-08-31 13:22:00 -07:00
Evan Czaplicki
3921ac232e
Switch to using Double to represent floats internal
2013-08-31 13:14:39 -07:00
Evan Czaplicki
966e725f5e
Finish converting the JS generator, still needs testing
2013-08-31 12:14:23 -07:00
Evan Czaplicki
10734a1b0b
get jsImport working
2013-08-31 04:41:36 -07:00
Evan Czaplicki
5b263aa124
Add markdown and make . notation nicer
2013-08-31 04:19:18 -07:00
Evan Czaplicki
394d398512
Get case expressions working
2013-08-31 04:01:00 -07:00
Evan Czaplicki
eafdaa20f4
add type annotation
2013-08-31 04:00:40 -07:00
Evan Czaplicki
545e51c611
Remove the Unique library, which is no longer in use
2013-08-31 03:08:00 -07:00
Evan Czaplicki
42fb11eabd
Stop using the Unique library
2013-08-31 03:07:19 -07:00
Evan Czaplicki
4e8898bef1
Remove unused references to Unique
2013-08-31 02:59:43 -07:00
Evan Czaplicki
bd445c4e22
Get closer to full conversion to language-ecmascript
2013-08-31 01:56:17 -07:00
Evan Czaplicki
8c50652e09
Begin conversion to language-ecmascript
2013-08-30 23:18:54 -07:00
Evan Czaplicki
6ba2d70365
Revert 95ec3a8..1a093ac
...
This rolls back to commit 95ec3a822e
.
2013-08-29 16:43:54 -07:00
Evan Czaplicki
7c159b294a
Enable parsing of basic markdown interpolation
...
No interpolated values are actually used, but they are type checked.
2013-08-29 13:00:38 -07:00
Evan Czaplicki
1a093ac53a
Properly turn off custom OpTables
...
oops!
2013-08-29 02:57:01 -07:00
Evan Czaplicki
65dcc0b57e
Turn off custom OpTables for now
2013-08-29 02:55:49 -07:00
Evan Czaplicki
d7c89ee07c
support cross-module OpTables
2013-08-29 02:53:20 -07:00
Evan Czaplicki
f1a88975d2
Add iParse that takes a table
2013-08-29 00:55:32 -07:00
Evan Czaplicki
6d27c5eee7
Move OpTable into IParser user state
2013-08-29 00:54:54 -07:00
Evan Czaplicki
fea6e5d408
Add fixities to module interfaces
2013-08-29 00:06:37 -07:00
Evan Czaplicki
95ec3a822e
Stop using error
when constraining patterns and when instantiating source types
2013-08-25 20:23:49 -07:00
Evan Czaplicki
7785eb8e48
Remove dead code
2013-08-25 19:24:45 -07:00
Evan Czaplicki
d3dc74325d
Remove dead code
2013-08-25 19:23:45 -07:00
Evan Czaplicki
082e6a20c0
Throw proper parse errors, stop using error
2013-08-25 19:22:41 -07:00
Evan Czaplicki
ca75e60628
Make sure that modules are only instantiated once.
2013-08-25 15:23:30 -07:00
Evan Czaplicki
9346d2e516
Remove two unused modules
2013-08-25 01:39:12 -07:00
Evan Czaplicki
40ea6df24b
Make sure that generated JS does not use JS's reserved words as variables
2013-08-24 15:00:23 -07:00
Evan Czaplicki
60e90c0f95
Add a note about what canonicalRealias does
2013-08-24 14:50:40 -07:00
Evan Czaplicki
4f6973024b
Export record constructors by default
2013-08-22 12:16:39 -07:00
Evan Czaplicki
18c67cb345
Properly perform extraChecks
2013-08-21 19:45:23 -07:00
Evan Czaplicki
11294300fc
Prettier printing for list types
2013-08-21 19:44:57 -07:00
Evan Czaplicki
7c58089090
Remove unused import
2013-08-21 19:09:07 -07:00
Evan Czaplicki
4d25352f90
Show realiased types when printing errors and when printing module types
2013-08-21 19:08:03 -07:00
Evan Czaplicki
e6be50ecc0
Add the Type.Alias file to do realiasing when printing types
2013-08-21 19:07:03 -07:00
Evan Czaplicki
7093436b13
Switch to SrcTypes after type inference, not in compiler
2013-08-21 14:23:11 -07:00
Evan Czaplicki
5251be331a
Reformat addError
code
2013-08-21 11:57:07 -07:00
Evan Czaplicki
a7b0d3fa15
Make nested record types prettier.
2013-08-20 01:13:37 -07:00
Evan Czaplicki
b5979b4aaf
Add occurs check and a test to make sure it works
2013-08-19 22:39:41 -07:00
Evan Czaplicki
70f1242bd0
Check that main is a Signal or (Signal Element), add tests for this case
2013-08-19 17:47:37 -07:00
Evan Czaplicki
4da7588d10
Add the ExtraChecks module to do occurs check and check the type of main
2013-08-19 16:54:46 -07:00
Evan Czaplicki
c2329d0aff
Fix generation of JS code for pattern matching on literals
2013-08-16 12:41:30 -07:00
Evan Czaplicki
5fd85cd9c5
Permit single line comments intermingled with types
2013-08-15 23:29:29 -07:00
Evan Czaplicki
7c19935d86
reprime when printing types
2013-08-14 00:44:40 -07:00
Evan Czaplicki
0e62924aaf
reprime when printing expressions and patterns
2013-08-14 00:44:29 -07:00
Evan Czaplicki
9ec51f558d
deprime on parsing, not on JS generation
2013-08-14 00:42:26 -07:00
Evan Czaplicki
d9918e0ac2
Convince parser to commit to lists, records, and tuples
2013-08-13 23:41:44 -07:00
Evan Czaplicki
61b5d8fbfa
Nicer messages on specific parse failures
2013-08-13 23:11:23 -07:00
Evan Czaplicki
ab83c78d8d
Remove dead code
2013-08-13 23:09:46 -07:00
Evan Czaplicki
cd84e06695
Make pattern exhaustive, giving parse error when someone uses binops with different associativity
2013-08-13 22:20:00 -07:00
Evan Czaplicki
47d68d8bf2
Succeed on programs that have no expressions
2013-08-13 22:12:45 -07:00
Evan Czaplicki
bc0c6a4410
Fix #209 , bad JS generation for primes in patterns
2013-08-13 18:10:17 -07:00
Evan Czaplicki
b7eb1335b0
Fix subtle bug with rigidVars vs rigidQuantifiers, was quantifing over the wrong variables in a forall
2013-08-12 14:32:51 -07:00
Evan Czaplicki
e4fc35c901
Make impossible error more specific
2013-08-12 14:30:32 -07:00
Evan Czaplicki
a3f62bdd14
style tweaks
2013-08-12 14:29:38 -07:00
Evan Czaplicki
1609e61cba
Fix accidental creation of rigid variables when type-checking mixed record types when a type alias is given
...
Fixes the issue raised by Alexander
2013-08-12 14:27:42 -07:00
Evan Czaplicki
a736a28a43
Properly quantify variables in Data expressions.
2013-08-12 01:09:26 -07:00
Evan Czaplicki
585107eaed
Fix variable shadowing when pattern matching on a pattern with only one variable, when it appears in a let-expression
2013-08-11 12:45:59 -07:00
Evan Czaplicki
9e58bdbc54
Canonicalize patterns in lambda expressions
2013-08-10 15:48:18 -07:00
Evan Czaplicki
47aa48d9fd
Preemptively add "number" as a kind of flexible variable that can unify with an (Is Number)
...
This is similar to the recent issue with comparable brought up by Max.
2013-08-10 14:26:01 -07:00
Evan Czaplicki
3b27395e62
Fix issue unifying comparables brought up by Max on the lists
...
A flexible comparable should be able to unify with another comparable
2013-08-10 14:20:36 -07:00
Evan Czaplicki
9bba47c791
compute a flexibility mark, just so it's easier to turn on and off later
2013-08-10 14:18:59 -07:00
Evan Czaplicki
c54dbf38af
Get rid of dead code and bad exports
2013-08-09 23:21:58 -07:00
Evan Czaplicki
5b6773c3ec
Fix extra space in error message
2013-08-08 18:05:21 -07:00
Evan Czaplicki
623741877b
Fix problems generating functions with 10 or more arguments
...
Mainly useful for record constructors which are automatically generated.
2013-08-08 16:04:40 -07:00
Evan Czaplicki
143547e766
Fix problem with variable shadowing when instantiating aliased types
2013-08-08 15:45:22 -07:00
Evan Czaplicki
0b9317124d
Give more specific errors when a variable cannot be found during canonicalization
2013-08-07 09:38:30 -07:00
Evan Czaplicki
d85c01ebbc
Merge pull request #204 from lambdatoast/patch-1
...
Remove extra "is" from defaultMessage.
2013-08-07 09:14:56 -07:00
Evan Czaplicki
9821e12a4c
Strip \r from multiline strings
2013-08-07 09:12:53 -07:00
Alexander
a043b95f0c
Remove extra "is" from defaultMessage.
2013-08-07 06:12:11 -03:00
Evan Czaplicki
cc81b1e22b
Make sure that all directories in build/ are properly constructed
2013-08-06 22:51:21 -07:00
Evan Czaplicki
f7db7a3b47
Add a default error message for beginners
2013-08-06 22:12:26 -07:00
Evan Czaplicki
50dada1f22
Fix very silly error, default module name is "Main" not "Name"
2013-08-06 21:40:54 -07:00
Evan Czaplicki
53ef6d33c9
Give a better error message when trying to unify rigid type variables in a bad way
2013-08-06 21:20:32 -07:00
Evan Czaplicki
ed6b255ba5
Properly parse out module names, defaulting to Main if no name is given.
2013-08-06 21:20:08 -07:00
Evan Czaplicki
43b604e0ca
Introduce cache/ and build/ directories
...
Switch from using --output-directory for all generated files, to using
--cache-dir for .elmo and .elmi files and using --build-dir for .html
and .js files.
2013-08-06 18:34:23 -07:00
Evan Czaplicki
2e38f7b061
Give line numbers when there is a kind error in a pattern
2013-08-06 15:44:19 -07:00
Evan Czaplicki
a3f62c34c3
Make errors a little bit better when a type alias gets the wrong number of arguments.
2013-08-06 15:43:59 -07:00
Evan Czaplicki
7af7c1f98d
Change "line" to "on line" in the string representation of one line SrcSpan
s
2013-08-06 15:43:31 -07:00
Evan Czaplicki
97ab6199bd
Make sure that the user defined module name is used in generated HTML
2013-08-06 13:41:17 -07:00
Evan Czaplicki
97a4628976
Get rid of dead code: showErr
is not used any more
2013-08-06 13:40:54 -07: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
1df206dcc9
Clean up mistakes from the merge
2013-08-04 15:44:47 -07:00
Evan Czaplicki
51dfa676d9
Merge branch 'types'
...
Conflicts:
compiler/Compiler.hs
compiler/Model/Ast.hs
libraries/Automaton.elm
libraries/Dict.elm
2013-08-04 15:40:24 -07:00
Evan Czaplicki
62bb8ab3ad
Add missing paren
2013-08-04 12:52:33 -07:00
Evan Czaplicki
0cd594c13c
Better JS for function composition, runtime errors report which module they came from
2013-08-04 12:51:52 -07:00
Evan Czaplicki
a268421893
Get show, readInt, and readFloat working again
2013-08-04 12:22:58 -07:00
Evan Czaplicki
e1bccca1de
Nicer error messages for unfound variables
2013-08-03 12:55:07 -07:00
Evan Czaplicki
3c05f538d0
Make error messages prettier
2013-08-03 12:28:59 -07:00
Evan Czaplicki
cb1a7a2355
Make formatting nicer for type errors
2013-08-03 12:02:59 -07:00
Evan Czaplicki
20047ec0eb
Show source strings in error messages when possible
2013-08-03 11:41:47 -07:00
Evan Czaplicki
51bc878b51
Use new Located datastructure, add source strings where appropriate
2013-08-03 11:41:33 -07:00
Evan Czaplicki
177a03750b
Add source code to locations for better error messages
2013-08-03 11:40:53 -07:00
Evan Czaplicki
1f390072c6
Add more space between type errors
2013-08-03 11:39:56 -07:00
Evan Czaplicki
37417e154c
print file path when compiling and enable multithreaded execution
2013-08-02 22:20:55 -07:00
Evan Czaplicki
8000b8b4b9
Stop exposing the QuasiQuoting library.
...
I have not looked at this code in many versions, so I don't think it's
good for me to keep "maintaining" it even though I don't think people
should really use this.
2013-08-02 17:37:30 -07:00
Evan Czaplicki
e4e8d89393
Fix "hiding" of thing that does not exist
2013-08-02 16:51:29 -07:00
Evan Czaplicki
9f2b81e4a9
Unhide thing that does not exist
2013-08-02 16:09:06 -07:00
Evan Czaplicki
520c81f9d4
Better names for files when no name is given
2013-08-02 15:01:03 -07:00
Evan Czaplicki
78c6db644e
Fix problem in generating pattern matching code for records
2013-08-02 14:49:31 -07:00
Evan Czaplicki
28d256876d
Fix record constructor for extension
2013-08-02 10:51:12 -07:00
Evan Czaplicki
070d02c914
deprime all exports, fix accidental variable capture in (.)
2013-08-02 10:50:54 -07:00
Evan Czaplicki
8bc39cd620
change error message
2013-08-02 01:53:40 -07:00
Evan Czaplicki
96136beaf5
Get the correct exports
2013-08-01 22:48:05 -07:00
Evan Czaplicki
c85fed1024
Put exports at the end of a file, making sure the value is always defined.
2013-08-01 21:46:58 -07:00
Evan Czaplicki
dd8843f8e4
Take correct file path, even if module name is not given
2013-08-01 17:22:44 -07:00
Evan Czaplicki
8e54751626
Correctly generate a type for markdown blocks
2013-08-01 17:19:34 -07:00
Evan Czaplicki
20e2ff0a28
Properly handle the qualified Text
type
2013-08-01 15:38:40 -07:00
Evan Czaplicki
51ba512914
Parse qualified infix functions
...
It is okay to say
4 `Time.since` Mouse.clicks
2013-08-01 15:38:19 -07:00
Evan Czaplicki
66e2a97d2a
Allow prefixes on FFI types
2013-08-01 15:37:34 -07:00
Evan Czaplicki
f9cc4516d8
Import qualified Text module by default
2013-07-31 23:47:29 -07:00
Evan Czaplicki
8f1f15cfeb
Fix pattern matching
2013-07-31 23:47:16 -07:00
Evan Czaplicki
ce527c0c07
Style change
2013-07-31 12:12:57 -07:00
Evan Czaplicki
4f595c2ca5
Eliminate dead code and reduce dependencies
2013-07-31 12:12:52 -07:00
Evan Czaplicki
a56efd851b
Check that imports actually exist in the known interfaces
2013-07-31 12:12:30 -07:00
Evan Czaplicki
2c96bf0c33
Get the haskell library working
2013-07-31 09:31:48 -07:00
Evan Czaplicki
e677f27bc5
add a type signature
2013-07-31 07:42:31 -07:00
Evan Czaplicki
a400ab140a
Get compling
2013-07-31 07:42:21 -07:00
Evan Czaplicki
3ef5284afd
Stop using the MultiWayIf extension
2013-07-30 22:57:13 -07:00
Evan Czaplicki
8006d8e54a
Report line numbers in type errors
2013-07-30 16:22:20 -07:00
Evan Czaplicki
b1f53d04ed
Pipe source locations through the type checker
2013-07-30 16:01:20 -07:00
Evan Czaplicki
c6868f1bd6
cosmetic change
2013-07-30 11:57:58 -07:00
Evan Czaplicki
a4c4cf0493
Use Location.none
less
2013-07-30 11:55:41 -07:00
Evan Czaplicki
b26edcc46e
Simplify representation of source locations
2013-07-30 11:43:42 -07:00
Evan Czaplicki
3065f58924
Support appendable types
2013-07-30 08:58:09 -07:00
Evan Czaplicki
ae6a3b36b5
Fix runtime code for comparing things
2013-07-30 08:44:23 -07:00
Evan Czaplicki
fa448548b8
Make error messages nicer
2013-07-30 08:31:05 -07:00
Evan Czaplicki
a1b7336547
Make comparable work fully and clean up code
2013-07-30 08:30:49 -07:00
Evan Czaplicki
3da8a71d00
Add ability to collect App1's into a Type constructor
...
Useful for determining if something is a Tuple or List
2013-07-30 08:29:52 -07:00
Evan Czaplicki
dfb27a7c67
Get rid of Paths_Elm to make sure things build properly for people.
2013-07-29 19:48:04 -07:00
Evan Czaplicki
1273f4deb3
Make sure that basic math operations generate the correct JS code.
2013-07-29 19:34:00 -07:00
Evan Czaplicki
25474f8310
Function args were in the reverse order!
2013-07-29 23:44:15 +02:00
Evan Czaplicki
a98a7be9f8
Export ADT constructors too
2013-07-29 23:43:57 +02:00
Evan Czaplicki
2d4afca06f
Fix JS generation
...
correct generation of binops
use correct calling conventions for defining functions
only import modules by name since everything is canonical (no more
eval!)
simplify exports
have _op be a per module object (resolves "overwriting" problem)
2013-07-29 23:22:33 +02:00
Evan Czaplicki
2f6d3227e9
If no exports are listed, everything gets exported
2013-07-29 23:19:32 +02:00
Evan Czaplicki
66515259cf
Only deprime when generating JavaScript, better to preserve information
2013-07-29 23:19:16 +02:00
Evan Czaplicki
f8fe8e4495
Properly convert Type.Type to SourceSyntax.Type
2013-07-29 20:23:42 +02:00
Evan Czaplicki
ac450ae944
restrict exports to def
and term
2013-07-29 19:49:09 +02:00
Evan Czaplicki
ec24738e9c
Get rid of dead code
2013-07-29 19:25:58 +02:00
Evan Czaplicki
fda1d2f979
Add canonicalization for aliases and ADTs
2013-07-29 19:25:24 +02:00
Evan Czaplicki
6ace8a0bf7
Move the definition of the Signal type out of the compiler and into the Signal library
2013-07-29 15:47:48 +02:00
Evan Czaplicki
0f3910d59e
Make SortDefinitions aware of ADT constructors, gave incorrect sorts before
2013-07-29 15:29:23 +02:00
Evan Czaplicki
46cb850570
Whitespace cleanup
2013-07-29 13:23:14 +02:00
Evan Czaplicki
3f96acf1f1
Get rid of logging and add Int, Float, Char, Bool to the global environment
2013-07-29 13:23:02 +02:00
Evan Czaplicki
2f49151c29
Cosmetic changes
2013-07-29 13:22:23 +02:00
Evan Czaplicki
ab00bce769
Remove SourceSyntax.Rename
...
I think keeping this file up to date is unnecessary
2013-07-29 13:21:59 +02:00
Evan Czaplicki
f8182740bc
Prettify code to print program
2013-07-29 13:21:34 +02:00
Evan Czaplicki
2f5639c4fb
Introduce Transform.Canonicalize
...
Run this to create a properly formatted ModuleInterface
2013-07-29 11:59:55 +02:00
Evan Czaplicki
02ab90e794
No need to derename, names will be preserved
2013-07-29 11:55:17 +02:00
Evan Czaplicki
1418bde44d
Remove use of SourceSyntax.Rename, which no longer exists
2013-07-29 11:54:50 +02:00
Evan Czaplicki
e22c7d455e
Add types and deprime
function to SourceSyntax.Helpers
2013-07-29 11:54:33 +02:00
Evan Czaplicki
eb96d7ad8d
Get rid of current canonicalization code
2013-07-29 11:53:45 +02:00
Evan Czaplicki
e8ab1c28ae
Remove SourceSyntax.Rename, which was unused
2013-07-29 11:52:34 +02: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
da346ea6a1
Show type errors in the order they appear in the source file
2013-07-27 00:53:34 +02:00
Evan Czaplicki
272557d785
Fix for "trying to write to a file in a non-existant directory"
2013-07-27 00:39:40 +02:00
Evan Czaplicki
fd63aff70b
Correct the code that unifies records
2013-07-27 00:15:26 +02:00
Evan Czaplicki
576e979483
Simplify code to generate record constraints
2013-07-27 00:14:38 +02:00
Evan Czaplicki
ab41d0c0e8
Take out types that were listed as "builtin"
2013-07-26 21:19:08 +02:00
Evan Czaplicki
c1d5f86e82
Simplify type error messages
2013-07-26 21:18:44 +02:00
Evan Czaplicki
42065eb075
Generate fewer intermediate variables during record unification
2013-07-26 19:39:42 +02:00
Evan Czaplicki
ebcaad0004
Fix possibility of calling maximum
on empty lists
2013-07-26 19:39:12 +02:00
Evan Czaplicki
2a51470fc1
Implement unification for records
2013-07-26 19:04:43 +02:00
Evan Czaplicki
760ad905cf
Add record constructors, begin using lists to represent fields in record types to maintain ordering from the source program
2013-07-26 18:20:57 +02:00
Evan Czaplicki
2a5bee06fc
Include type aliases from dependencies
2013-07-26 17:35:48 +02:00
Evan Czaplicki
39f2a8717d
Rewrite readDeps
so that modules are never read more than once
2013-07-26 16:38:40 +02:00
Evan Czaplicki
0f85a2fcfa
Resolve type aliases in instantiator
2013-07-26 15:08:04 +02:00
Evan Czaplicki
46631c3616
Remove dead code
2013-07-26 15:07:35 +02:00
Evan Czaplicki
637c7e0da0
Put type aliases in ModuleInterface
2013-07-26 15:06:35 +02:00
Evan Czaplicki
6948858f78
Allow multiple different imports of the same module, clean up canonicalize
code
2013-07-26 12:56:36 +02:00
Evan Czaplicki
938675110d
Fix parser for "import List" which before was not importing anything.
2013-07-26 12:31:49 +02:00
Evan Czaplicki
0681fbe583
Get rid of dead function and give instantiateTypeWithContext a shorter name
2013-07-26 12:22:15 +02:00
Evan Czaplicki
32a331b3b0
Load ADTs into the environment to fix constraint generation for patterns
2013-07-26 12:19:24 +02:00
Evan Czaplicki
2b2bc087e4
Minor cosmetic change
2013-07-26 11:40:44 +02:00
Evan Czaplicki
ff67c667a0
Get Matrix2D and Signal compiling
2013-07-26 00:33:59 +02:00
Evan Czaplicki
c19ccfe56a
Stop importing the Native library by default
2013-07-26 00:19:43 +02:00
Evan Czaplicki
727d708289
Get libraries to compile
2013-07-26 00:19:21 +02:00
Evan Czaplicki
ec8687610f
Move type annotations out of Environment and into the Basics library
2013-07-26 00:06:52 +02:00
Evan Czaplicki
eba7e6292e
Trim some unused dependencies
2013-07-25 20:53:54 +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
0db809ff4c
Switch formatting for language pragmas
2013-07-25 20:34:04 +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
6c808aaa47
change whitespace
2013-07-25 20:19:50 +02:00
Evan Czaplicki
9fe6c9a564
Change functions for creating type variables, distinguish names of different constraint type variables
2013-07-25 18:07:04 +02:00
Evan Czaplicki
642b1f7fcc
Properly handle constrained variables when converting from Src.Type to Type.Type
2013-07-25 17:36:52 +02:00
Evan Czaplicki
609cc3df96
Unify any constrained variables with the same super-type
2013-07-25 17:10:01 +02:00
Evan Czaplicki
a05c82f58b
Mess with whitespace
2013-07-25 17:09:23 +02:00
Evan Czaplicki
d9c1317a25
Add pretty printing for record types
2013-07-25 17:09:10 +02:00
Evan Czaplicki
d059c362d9
Fix the type of String literals
2013-07-25 16:02:49 +02:00
Evan Czaplicki
abb6dc19f6
Prettier printing for infix functions like div
2013-07-25 15:55:55 +02:00
Evan Czaplicki
b6144aeb07
Properly unify constrained variables, serious changes here!!!
...
I also rewrote merge1 and merge2 which are dangerous functions to touch.
2013-07-25 15:48:58 +02:00
Evan Czaplicki
856360bd94
Get rid of unused part of the type error message
2013-07-25 15:46:48 +02:00
Evan Czaplicki
4e7ef5f177
Add definitions for functions that act on numbers and comparables
...
This will get moved into Elm code eventually
2013-07-25 14:54:21 +02:00
Evan Czaplicki
d456cec5c8
Overload literal numbers without a decimal point to be either Ints or Floats
2013-07-25 01:25:17 +02:00
Evan Czaplicki
82ca695dca
Add support for "number" type which can be either an Int or Float
2013-07-25 01:24:16 +02:00
Evan Czaplicki
666d9f8ca3
Assume all variables with the "Native." prefix exist and have type "a"
2013-07-25 01:23:30 +02:00
Evan Czaplicki
2609f5dda7
Add support for let (==>) = Lambda in …
2013-07-23 17:00:05 +02:00
Evan Czaplicki
7b90975dad
Simplify code to check for structural errors
2013-07-23 16:15:56 +02:00
Evan Czaplicki
8ffcf9e80e
Prettier printing for infix operator definitions
2013-07-23 15:43:21 +02:00
Evan Czaplicki
802be96e57
Fix issue in which patterns could become too general
2013-07-23 15:32:08 +02:00
Evan Czaplicki
175798f6d2
Fix type constraints for case-expressions
2013-07-23 14:59:53 +02:00
Evan Czaplicki
f37e05af5e
Fix type constraints for PData
...
Was generating functions based on free type variables, not on the kind
of the constructor.
2013-07-23 14:59:34 +02:00
Evan Czaplicki
d15d84deba
Get patterns to type-check with the value in the case expression
2013-07-22 15:10:48 +02:00
Evan Czaplicki
eaa751d987
Make pretty printing for types prettier
2013-07-22 14:52:57 +02:00
Evan Czaplicki
138e99cc81
Begin to canonicalize imported values and types
2013-07-22 14:42:45 +02:00
Evan Czaplicki
eb722a20dc
Make a type less general
2013-07-22 14:41:55 +02:00
Evan Czaplicki
d9471f6c62
Add flexible variables for type annotated values
...
Without this, things are not generalized properly.
2013-07-22 14:41:12 +02:00
Evan Czaplicki
6f94400f2d
Begin parsing types and patterns such as A.B.C
2013-07-22 14:40:32 +02:00
Evan Czaplicki
97bd68a796
Make parse errors print more nicely
2013-07-22 14:40:00 +02:00
Evan Czaplicki
81522b306a
Make cross-module types aware of user-specified aliases
2013-07-22 00:23:26 +02:00
Evan Czaplicki
c140d690fc
First draft of cross-module type checking
...
Currently, all top-level types are imported. No alias resolution
happens so you need to use "import open M" atm.
2013-07-21 22:50:48 +02:00
Evan Czaplicki
4bcde7e799
Add flag for printing a whole program
2013-07-21 22:49:42 +02:00
Evan Czaplicki
1f8b7bbc98
Introduce TypeLibrary alias, a minor cosmetic change
2013-07-21 09:23:01 +02:00
Evan Czaplicki
0fd1f677a5
Get things in place to pass Prelude interfaces
2013-07-21 07:17:01 +02:00
Evan Czaplicki
b1dd1574a8
Begin passing module interfaces when compiling dependencies
2013-07-21 07:14:13 +02:00
Evan Czaplicki
22f7f8a43a
Create a serializable interface for a module's type information
...
Also add a flag to print out top-level types
2013-07-21 06:08:08 +02:00
Evan Czaplicki
fa11f8e390
get rid of unused imports
2013-07-21 00:15:35 +02:00
Evan Czaplicki
5cb82c6891
Add support for "(,,) a b c" as a valid type annotation
2013-07-20 18:53:41 +02:00
Evan Czaplicki
1a4732a436
Start building a .elmi file that contains the types of all top-level functions
2013-07-20 18:53:15 +02:00
Evan Czaplicki
c9a1cc96f6
Minor reformatting and removing unused dependencies
2013-07-20 18:52:43 +02:00
Evan Czaplicki
23758290d9
Improve pretty printing for types
2013-07-19 19:17:51 +02:00
Evan Czaplicki
9592d286bb
Start using Data.Graph to work out dependency problems and other minor tweaks
...
Print out the saved type environment, and get things working with the
program field in MetadataModule.
2013-07-19 18:05:31 +02:00
Evan Czaplicki
ca4502b70a
Save the current environment on CSaveEnv
2013-07-19 18:03:28 +02:00
Evan Czaplicki
b0f96a2eab
Switch from [Def t v] to (LExpr t v) for program representation
2013-07-19 18:02:24 +02:00
Evan Czaplicki
4dc68acd60
Stop creating types for ADT's, use Constant and Flexible in the right place
2013-07-19 18:01:26 +02:00
Evan Czaplicki
4c0f716aef
Change the representation of SolverState to have a "saved environment", recognize the "Save the Environment" variable
2013-07-19 17:50:16 +02:00
Evan Czaplicki
807076ad57
Add CSaveEnv, optimize CAnd, make it prettier
...
CSaveEnv is a special constraint that indicates that the current
environment should be saved for later use.
(/\) now optimizes away arguments that are already CTrue.
2013-07-19 17:48:41 +02:00
Evan Czaplicki
648cbd49dd
Use letters for arguments in adt constructors
2013-07-19 17:46:03 +02:00
Evan Czaplicki
c942afea6a
Nicer pretty printing and a special variable to "Save the Environment"
2013-07-19 17:45:16 +02:00
Evan Czaplicki
c1aef789ee
Flatten lets only during JavaScript generation
2013-07-19 17:43:37 +02:00
Evan Czaplicki
ce652d9a35
Print errors more nicely
2013-07-19 15:40:37 +02:00
Evan Czaplicki
45b43e8757
When creating a named var, allow it to be flexible.
2013-07-19 13:25:51 +02:00
Evan Czaplicki
26738907c6
Make error message in solver slightly more specific
2013-07-19 12:41:37 +02:00
Evan Czaplicki
b540fb43b0
Fix bug in generating Def for ADT constructors
...
Accidentally used the type name instead of the constructor name.
2013-07-19 12:39:38 +02:00
Evan Czaplicki
b87e45a27d
Change module prefixes for some values
2013-07-19 11:19:51 +02:00
Evan Czaplicki
c881bd8ef2
Fix bug in type application when converting SourceSyntax.Type to Type.Type
...
Also get rid of some print statements.
2013-07-18 18:16:54 +02:00
Evan Czaplicki
901179c10f
Marginally better errors when a variable is undefined.
2013-07-17 19:30:40 +02:00
Evan Czaplicki
a3a7b3ef62
Refactor type environment
...
Migrate some functions to Environment.hs, add built-in types like _List
and _Tuple2.
2013-07-17 19:29:27 +02:00
Evan Czaplicki
90c5c7d21c
Add terse way to do type application
2013-07-17 19:26:42 +02:00
Evan Czaplicki
334d39c644
Manual dead code elimination ;)
2013-07-17 19:25:17 +02:00