GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bynect/algorithm-w: Type inference implementation in OCaml using Algorithm W

BranchesTags
Open more actions menu

Latest commit

 

History

27 Commits
27 Commits

Folders and files

NameName
Last commit message
Last commit date
LICENSE
LICENSE
 
 
README.md
README.md
 
 
ast.ml
ast.ml
 
 
dune
dune
 
 
dune-project
dune-project
 
 
infer.ml
infer.ml
 
 
lex.mll
lex.mll
 
 
main.ml
main.ml
 
 
parse.mly
parse.mly
 
 
state.ml
state.ml
 
 

Repository files navigation

Algorithm W implementation

The implementation is based on the paper Algorithm W Step by Step, with the addition of n-tuples, custom operators and if expressions.

Grammar

exp ::= x                           -- variable
      | exp exp                     -- application
      | exp `x` exp                 -- infix application
      | exp op exp                  -- infix operation
      | fun x0...xn -> exp          -- anonymous function
      | let x = exp in exp          -- let binding
      | if exp then exp else exp    -- if expression
      | exp, exp                    -- tuple
      | i                           -- int literal
      | b                           -- bool literal
      | exp :: ty                   -- type annotation

ty  ::= a0...an
      | int
      | bool
      | unit
      | ty -> ty
      | ty * ty

References

  • Algorithm W Step by Step: Original paper
  • Write you an inference in F#: Various type inference algorithm implemented in F#

About

Type inference implementation in OCaml using Algorithm W

Topics

functional-languagefunctional-programminghindley-milnerocamltype-inferencetype-system

Resources

Readme
MIT license
Activity

Stars

10 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.