Commit Graph

6437 Commits

Author SHA1 Message Date
Niklas Larsson
ffb7946730 Merge pull request #2469 from lenary/add-stack
Add Stackage Configuration for easy building
2015-07-25 21:45:58 +02:00
Niklas Larsson
54e4e41b49 Merge pull request #2468 from benjamin-hodgson/patch-1
Fix Multiplicative/Additive docs
2015-07-25 21:44:29 +02:00
Edwin Brady
740d82d7da Display normalised types on :t for expressions
Behaviour of :t on names remains the same (showing the non-normalised
type).
Added evaltypes option (on by default) so the old behaviour can be
regained with :unset evaltypes.

This means partially applied things with interesting types will be
displayed more helpfully, e.g.:

*printf> :t printf "%s %d"
printf "%s %d" : String -> Int -> String
2015-07-25 20:17:26 +01:00
Edwin Brady
bf52728c57 Normalise local variable types in metavariables 2015-07-25 20:17:26 +01:00
Sam Elliott
b6d0eacfb6 Add Stackage Configuration for easy building
Using a nightly stackage config to build on GHC 7.10, and there are some
dependencies that are more advanced than the most recent LTS stackage
config. This should just build using `stack build` in the Idris-dev root.
2015-07-25 19:14:28 +01:00
Benjamin Hodgson
37845e4c24 Fix Multiplicative/Additive docs
They had `(*)` and `(+)` the wrong way round 😉
2015-07-25 18:26:36 +01:00
Niklas Larsson
6b062beae0 Merge pull request #2466 from melted/doc_op
List unavailable operators
2015-07-24 15:42:36 +02:00
Niklas Larsson
fc4b908c80 List unavailable operators
Fixes #1162

There is already an error message for it
2015-07-24 13:17:00 +02:00
Niklas Larsson
dda41af21d Merge pull request #2463 from melted/cgoptions
Pass parameters to codegens with new cmdoption --cg-opt
2015-07-24 12:13:39 +02:00
Edwin Brady
a24c7d4f72 Finish WHNF for operators
It's a bit ugly for non-constant operators, but non-constant operators
are ugly anyway, and unusual, so I'm not going to worry too much about
that...

This should now be good enough to use in place of the old evaluator for
things which only need the constructor at the head (which includes
conversion, unification and partial evaluation.)
2015-07-24 01:45:38 +01:00
Edwin Brady
89566a8f51 Finish WHNF implementation for case trees
Some simplifying assumptions on operators, for the moment, in particular
that they are always implemented on constants (which isn't necessarily
true but is fine for most cases at the moment).
2015-07-24 01:45:38 +01:00
Edwin Brady
64df5f649b Added WHNF module
Reduction to weak head normal form. Currently includes structure of the
algorithm, but does not yet reduce function names.

Also removed ':hnf' from REPL commands and replaced with ':whnf'.
2015-07-24 01:45:38 +01:00
Edwin Brady
570a452544 Reword disambiguation error message 2015-07-24 01:45:38 +01:00
Niklas Larsson
f5bff01f6b Pass parameters to codegens with new cmdoption --cg-opt
Fixes #1482
2015-07-24 01:53:05 +02:00
Niklas Larsson
60f85ef82b Merge pull request #2462 from melted/help
Update codegen option help text
2015-07-23 22:50:45 +02:00
Niklas Larsson
632ff47258 Update codegen option help text
Remove Java and add node and javascript. Also hint that there can be more.
2015-07-23 22:42:28 +02:00
Niklas Larsson
cd4e91d9d3 Merge pull request #2461 from melted/issue_1134
Fix #1134 by saving same info in ibc on check
2015-07-23 19:33:06 +02:00
Niklas Larsson
585627b6ca Fix #1134 by saving same info in ibc on check
Otherwise addClause will fail as the ibc lacks that info
2015-07-23 18:09:21 +02:00
Niklas Larsson
4cd8854b74 Merge pull request #2459 from melted/fix_dynamic
Fix :dynamic with a lib arg
2015-07-23 16:16:56 +02:00
Niklas Larsson
f48665eb51 Fix :dynamic with a lib arg 2015-07-23 15:03:29 +02:00
Niklas Larsson
5a2f9fe070 Merge pull request #2458 from melted/fix_tot007
Fix expected result of totality007 on windows
2015-07-23 00:25:38 +02:00
Niklas Larsson
ad34ca53aa Merge pull request #2457 from melted/utf8
Ensure that the backend output is UTF8
2015-07-23 00:24:55 +02:00
Niklas Larsson
5feb424d8c Fix expected result of totality007 on windows 2015-07-22 23:47:42 +02:00
Niklas Larsson
8809bf2dd7 Ensure that the backend output is UTF8
Not really needed for C, but Javascript can have Unicode strings and identifiers.
2015-07-22 23:14:59 +02:00
Niklas Larsson
cf4489e3ef Merge pull request #2455 from melted/ffi_wrap
Fix callstack use in ffiWrap.
2015-07-22 16:05:37 +02:00
David Christiansen
91a8cc4e99 Merge pull request #2451 from cantora/imports-in-interp-example
make light of `Data.Vect` and `Data.Fin` imports in the interp example
2015-07-22 10:49:50 +02:00
Niklas Larsson
f605128f34 Merge pull request #2454 from melted/ffi_static
Abort compilation if compiling non-statically known ffi calls
2015-07-22 01:03:11 +02:00
Niklas Larsson
455f1477df Merge pull request #2453 from melted/issue_2043
Revert "Fix function wrapping bug in JavaScript RTS"
2015-07-22 01:02:43 +02:00
Niklas Larsson
275e95c584 Fix callstack use in ffiWrap.
Getting the old stack from the vm can't work as it's not
written back there.
2015-07-22 01:01:34 +02:00
Niklas Larsson
88e9228dc1 Abort compilation if compiling non-statically known ffi calls
fixes #2043, the other reported issue.
2015-07-21 23:04:55 +02:00
Niklas Larsson
57a4ed30ca Revert "Fix function wrapping bug in JavaScript RTS"
Fixes #2043, as originally reported.

This reverts commit 15590d7107.
2015-07-21 22:42:17 +02:00
David Christiansen
7a2dc7b150 Merge pull request #2450 from david-christiansen/parser-hl-decls
Highlight all keywords with the parser
2015-07-20 09:04:52 +02:00
anthony cantor
f236bfffa3 make light of Data.Vect and Data.Fin imports in the interp example
the interp documentation section assumes that these types are in the
prelude.
2015-07-19 15:06:39 -07:00
David Raymond Christiansen
42975007aa Highlight all keywords with the parser
Now, editors do not need to implement their own regexp-based
highlighting, as all keywords are highlighted by Idris's parser. This
also means that the data exported by --highlight can be used to fully
annotate a source file, either for HTML data or for LaTeX.
2015-07-19 22:54:12 +02:00
David Christiansen
00cffbd7fc Merge pull request #2449 from david-christiansen/parser-highlights
Semantic highlighting of implicit fromInteger
2015-07-19 21:15:50 +02:00
David Raymond Christiansen
c9c3bfa650 Semantic highlighting of implicit fromInteger
Now, editors get highlighting information for integer literals according
to the following rules:

 1. If the constant elaborates to a constant (such as the fromInteger
    implementations for Integer, Int, Bits8, etc), then the constant
    itself is used for highlighting informating, as it would be in the
    pretty printer.

 2. If the constant elaborates to an inductive datatype, the outermost
    constructor is used for highlighting (e.g., the Nat 4 highlights as
    S, and the Nat 0 highlights as Z)

 3. Otherwise, no highlighting is performed.
2015-07-19 20:27:03 +02:00
Jan de Muijnck-Hughes
062b06944e Merge pull request #2447 from cantora/imports-in-interp-example
need to import `Data.Vect` and `Data.Fin` for `interp.idr` to compile
2015-07-19 11:50:32 +01:00
anthony cantor
8518aa37e9 need to import Data.Vect and Data.Fin for interp.idr to compile 2015-07-19 00:47:04 -07:00
David Christiansen
ca623ceee4 Merge pull request #2444 from Melvar/add-divmod
Add inductive divMod to contrib
2015-07-18 11:15:19 +02:00
Edwin Brady
212587bc46 Remove 'score' and guesswork from error messages
In a try or handleError, just take the message from the second thing
that failed. (This may turn out to need more control depending on the
use of the try/handleError. We'll see.)
2015-07-18 02:16:51 +01:00
Edwin Brady
e1c79ef07d Better error when no alternative is valid
Instead of guessing the error for the thing that's closest to working,
better to say that no alternative works.
(This makes the bizarre 'score' heuristic for error messages obsolete,
so that'll be removed soon too.)
2015-07-17 23:37:19 +01:00
David Christiansen
452b3c627f Merge pull request #2445 from david-christiansen/parser-highlights
Highlighting for pairs, lists and sigmas
2015-07-18 00:36:44 +02:00
David Raymond Christiansen
bc2915c390 Merge remote-tracking branch 'upstream/master' into parser-highlights
Conflicts:
	src/Idris/AbsSyntax.hs
	src/Idris/AbsSyntaxTree.hs
	src/Idris/DSL.hs
	src/Idris/Elab/Term.hs
	src/Idris/Elab/Value.hs
	src/Idris/ElabQuasiquote.hs
	src/Idris/Error.hs
	src/Idris/IBC.hs
	src/Idris/IdrisDoc.hs
	src/Idris/ParseExpr.hs
2015-07-17 23:22:17 +02:00
Edwin Brady
5da0d60564 Faster processing of alternatives
Mostly by delaying the expensive checking for uniqueness of names until
the point where we actually need the branch, thus removing a significant
amount of unnecesary work.
2015-07-17 20:56:55 +01:00
Melvar Chen
bcfced2167 Add inductive divMod to contrib, move the wellfounded one 2015-07-17 21:11:09 +02:00
David Raymond Christiansen
a54852bb11 Highlighting for pairs, lists and sigmas
Now, the elaborator supports highlighting of pairs, lists, and sigmas in
their sugared for, revealing the underlying names in the highlight. This
means that tooltips in Emacs and any other editor supporting
highlighting can now show how a particular notation was disambiguated -
Vects and Lists give different tooltips, and pair types have blue
parentheses and commas while pair values have red ones. Likewise for
dependent pairs.
2015-07-17 20:54:30 +02:00
David Christiansen
8b252bdc52 Merge pull request #2442 from david-christiansen/parser-highlights
More parser-driven highlighting
2015-07-17 20:53:58 +02:00
David Raymond Christiansen
3cd25e67ff Add extra HL information to PRef
This allows PRef to refer to multiple regions in the source file, which
allows for highlighting of desugarings.
2015-07-17 16:13:13 +02:00
Edwin Brady
8addb63388 Add missing NFData case for TryImplicit 2015-07-17 14:53:08 +01:00
Edwin Brady
0dd2f066b0 Restrict (and speed up) implicit coercions
'implicit' will now only work if there is a concrete argument type and a
concrete return type. This means we can rule out impossible coercions
much quicker, and has the effect of speeding up error reporting by not
trying to fix up the error with coercions which are never going to work.

There's a special case for "lend" but UniqueType is experimental and
probably needs a rethink, so I'm okay with this at least for now.
2015-07-17 12:19:18 +01:00