Giter Club home page Giter Club logo

disjoint-polymorphism's Introduction

SEDEL: Safe and Expressive Delegation-Based Programming

wercker status

SEDEL is a new statically-typed and delegation-based object-oriented programming language that supports dynamic composable traits, disjoint polymorphism, intersection types and a merge construct.

SEDEL is written in the Haskell language.

Build and Run

This project can be built with cabal or stack.

  • cabal
cabal sandbox init
cabal install --only-dependencies
cabal build
cabal exec SEDEL-exe
  • stack
stack build
stack exec SEDEL-exe

REPL

The REPL prompt is >:

  • type :q to quit or input any expression in the source language to check its result
  • type :load to load a file
> 2
Typing result
: Double

Evaluation result
=> 2.0

Quick Reference

A program consists of list of declarations, ending with a single expression. Like Haskell, a line comment starts with -- and a comment block is wrapped by {- and -}. Declarations include type (type ...) and term (def/defrec ...) declarations:

program := decl ... decl expr
decl    := def ... | type ... | defrec ...
  • Primitive type: Double, Bool, String
  • Top type/value: () : T
  • Type annotation: 2 : Double
  • Merge: true ,, 3
  • Intersection type: Bool & (Double -> Double)
  • If: if x == 0 then true else false
  • λ term: (\x -> x+1) : Double -> Double
  • Λ term: /\ (A * Double) . (\x -> x) : A -> A
  • Disjoint (universal) quantification: forall (A*Int) . A -> A
  • Term declaration: def id A (x : A) = x
  • Type declaration: type Person = {name : String, male : Bool}

Examples and Case Study

See the examples/ directory. All examples can be tested:

stack test

disjoint-polymorphism's People

Contributors

bixuanzju avatar brunocdsoliveira avatar lihuanglx avatar

Watchers

 avatar  avatar

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.