GitHunt
JO

JoeyEremondi/elm-pattern-effects

Type and effect system for Pattern match analysis in Elm

Migrated to https://codeberg.org/JoeyEremondi/elm-pattern-effects

Modified Elm Compiler

Here is the Extended Abstract which was accepted to the POPL 2016 Student Research Competition.

The main changes can be found in the Type.Effect modules.

State of the implementation:

  • Implement Constraint Generation
  • Worklist algorithm to solve constraints
  • Instantiation and Generalization
  • (Almost done) Transfer annotations and constraints across modules
  • Fix bugs in Constructor types
  • Proper types for recursive values
  • Implication constraints for branch results
  • Implication constraints for matched variables within branch (implemented but buggy)
  • Track Control-flow along with patterns
  • Change complete pattern matches to Top
  • Implement case optimizations for if expressions
  • Support for Elm's record types

Since module-support isn't there yet, this version
won't properly compile the core libraries.

To test it, clone this repository, and execute the function Compile.compileFile "Test.elm" where Test.elm is whatever
Elm file you use. Make sure that it doesn't contain
any imports or references to standard library functions.

Languages

Haskell76.9%JavaScript19.8%Elm3.3%
BSD 3-Clause "New" or "Revised" License
Created November 27, 2015
Updated February 18, 2025
JoeyEremondi/elm-pattern-effects | GitHunt