Skip to content

quietfanatic/fp-oo-experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This was an experiment in the process of designing a larger language.
NOTE: At some point I busted something in the scoping and haven't bothered to fix it.


You can build objects:
	my_object = {
		a = 1;
		b = 2;
	}
define interfaces:
	vecish = {
		x : int;
		y : int;
	}
and write functions:
	add5 = x : int -> add x 5
Functions can be nested and can take types as parameters.

You can apply functions concatenatively and acces object members with '.':
	eight = add 5 { x = 4; y = 3}.y


The builtin things are:

add : int -> int -> int
sub : int -> int -> int
mul : int -> int -> int
int : Type
Func : Type -> Type -> Type
Type : Type
Thing : Type (Thing is a superset of all other types)


About

An experiment in merging functional and OO programming, implemented with Haskell

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published