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
0c14f6e8ec
add note about (,,) in types
2013-07-21 00:15:49 +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