1. 18 Mar, 2015 1 commit
  2. 18 Feb, 2015 1 commit
    • Kim Nguyễn's avatar
      Implement a safety-check to guarantee that recursive parametric types · 3aab1b01
      Kim Nguyễn authored
      remain regular. Within their recursive definitions, parametric types
      must always be instantiated with their original parameters and all
      types of mutually recursive definitions must have the same parameters.
      
      We use Tarjan's strongly connected components algorithm to group type definitions accordingly.
      3aab1b01
  3. 16 Feb, 2015 3 commits
    • Kim Nguyễn's avatar
      Remove the a workaround the AST for patterns that was used to · 4f49a2af
      Kim Nguyễn authored
      correctly handle insantiated types in regular expressions.
      4f49a2af
    • Kim Nguyễn's avatar
    • Kim Nguyễn's avatar
      Implement the syntax ``t (t1, …, tn)'' for type instantiation, without · 07bc7bc1
      Kim Nguyễn authored
      requiring an abscence of whitespace between ``t'' and ``(''.  Outside
      of regular expression contexts, ``t (t1, …, tn)'' is parsed with a
      higher precedence than & and \, to allow one to write
      ``t (Int) & Bool'' without extra parentheses (i.e.
      ``(t (Int)) & Bool'').  Inside a regular expression, type
      instantiation and sequencing become ambiguous, and there is no way to
      distinguish syntactically: ``[ Int (Int, Int) ]'' from
      ``[ t (Int, Int) ]''. The former should resolve to a sequence while
      the latter only makes sense as an instantiation (if ``t'' is a
      parametric type). Both are treated as element sequencing and
      disambiguated during identifier resolution (more precisely during the
      "derecurse" phase, before typechecking).
      
      Note that due to the lower precedence of sequencing w.r.t to other
      regular expression constructs, a type ``[ t (Int)* ]'' will be parsed
      correctly, but yield an error message saying that t is not fully
      intantiated. One has to write ``[ (t (Int))* ]'' which is similar to
      function applications for expressions.
      
      Finally, we also re-order sequencing after typing to always group a
      potential type instantiation with its argument, i.e. we transform
      sequences such as
      ``[ t1 t2 t3 ... tn ]'' (which are parsed as
      ``[ (((t1 t2) t3) ... tn) ]'' because sequence concatenation is
      left-associative) into ``[ ... (ti tj) ... ]'' if ``ti'' is an
      identifier and ``tj'' is of the form ``(s1,...,sk)''. This is sound
      because concatenation of regular expression is associative (and the
      original sequence would fail, anyway).
      07bc7bc1
  4. 08 Sep, 2014 2 commits
    • Pietro Abate's avatar
      Add parametric type to patterns · 0d3a9e60
      Pietro Abate authored
      - change syntax to avoid conflicts ( tried "((", "[<", "<[", "(" )
         type t {[ 'a,'b ]} = (Int,[ 'b* ]) ;;
         let app (f : 'a -> t {[Int,Int]} )(a : 'a) : t = f a;;
      0d3a9e60
    • Pietro Abate's avatar
      Add syntax for parametric types · 8c0a08c4
      Pietro Abate authored
      - type t 'a = ('a,'a)
      - type t ('a,'b) = ('a,'b)
      
      Fix Typer.pp_env printer for types
      Minor code refactring
      8c0a08c4
  5. 28 Aug, 2014 1 commit
    • Pietro Abate's avatar
      More var.ml cleanup · 737730a2
      Pietro Abate authored
      - Var identifiers are now of type U.t instead of string
      - Remove TVar from ast. Polymorphic variables are just types
      737730a2
  6. 19 Aug, 2014 1 commit
  7. 23 Jul, 2014 1 commit
  8. 22 Jun, 2014 1 commit
  9. 17 Feb, 2014 1 commit
  10. 07 Feb, 2014 1 commit
  11. 15 Jan, 2014 1 commit
    • Pietro Abate's avatar
      Parse type variables as patterns · 6ee8a6b0
      Pietro Abate authored
      - type variables are now correctly parsed as patterns
        and not as expressions
      
      - Add a new module Var that contains all the type variables
        related machinery
      
      - Remove old functions and unit tests about BoolVar of only
        variables, since now variables are always stored associated
        with one or more kinds
      6ee8a6b0
  12. 06 Jan, 2014 1 commit
  13. 11 Dec, 2013 1 commit
  14. 03 Dec, 2013 2 commits
  15. 05 Oct, 2007 22 commits