Giter Club home page Giter Club logo

tix's Introduction

Abandonned see https://github.com/regnat/ptyx

% tix % A (wip) type-inference engine for nix

There is currently not much, hardly a parser for a small subset of the language.

Build

Assuming you got nix installed on your computer, run nix-shell to enter a well-configured environment, and then:

$ make configure
$ make
$ make test

tix's People

Contributors

thufschmitt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

marwahaha

tix's Issues

Fix list regexes

The compilation of list regexes is buggy.

For example, [ (t1 | t2)* ] is interpreted as [ t1 t2*]

Fix subtyping of the gradual type

Currently, the gradual type is nothing but a type constant, i.e. it is a subtype only of itself and Any (and a supertype only of itself and Emply), which makes it rather useless

Rewrite boolean combinations in "if" clauses

An expression such as if e || e' then e1 else e2 should be rewritten to if e then e1 else if e' then e1 else e2 (and likewise for other boolean connectives).

This allows the type-checker to detect more cases where it can refine without complicating it too much.

Allow any order for annotation in record pattern fields

Currently { x /*: Int */ ? 1 }:x is valid, while { x ? 1 /*: Int */ } isn't. Imho, both should be valid.

Proposal : give them different typing semantics:

  • { x /*: τ */ ? c }:x : {x=τ} → (τ | B(c))
  • { x ? c /*: τ */ } : {x=τ} → τ if B(c) ≤ τ

(ie require only in the second case that the default value has the annotated type).

This makes the behaviour slightly more complex, but remains quite logical and allows distinguishing the case where the argument is not given, which isn't possible to do as directly now:

{ x /*: Int */ ? true }:
if x == true then
  "x wasn't defined"
else
  "x was defined, with value ${x}"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.