After taking a programming languages class, we became intrigued with functional programming via OCaml.
While we loved OCaml, we realized that it seemed to be limiting itself as a truly modern programming tool.
It had so much power, yet it seemed to fall short.
So much of today's world is done on the web that JavaScript has become one of the most popular
languages in the world. It only made sense to harness the power of OCaml and combine it with
the ubiquity of JavaScript.
JCaml is statically-typed and statically-scoped, it has pattern-matching,
dictionary capabilities, list comprehension, recursive functions, higher-order functions,
currying, and tuples. It is designed to be a functional programming language for the modern era,
with browser compatibility through JavaScript compilation.
spit("Hello, World");;
console.log("Hello World");
let fun fib = (int a) => (int):
  if(a == 0 or a == 1):
    hump 1
  else:
    hump fib(a-1) + fib(1-2)
;;
let fib = (a) => {
  if (a == 0 || a == 1) {
    return 1;
  } else {
    return fib(a - 1) + fib(a - 2);
  }
};
let fibDict = []
let fun fibMem = (int a) => (int):
  if (a == 0 or a == 1):
    hump 1
  else if (a in fibDict):
    hump fibDict[a]
  else:
    fibDict[a] = fibMem(a-1) + fibMem(a-2)
    hump fibDict[a]
;;
let dictionary = {};
let fibMem = (a) => {
  if(a == 0 || a == 1) {
    return 1;
  } else if(a in dictionary) {
    return dictionary[a];
  } else {
    dictionary[a] = fibMem(a - 1) + fibMem(a - 2);
    return dictionary[a];
  }
};
let fun add = (int a, int b) => (int):
  hump a + b;
;;
let fun add2 = add(2);;
let add = (a) => {
  return (b) => {
    return a + b;
  };
};
let add2 = add(2);
let fun count_occurences = (int v, int list l) => (int):
  match l with:
  | [] -> 0
  | hd::[] -> hump hd == v ? 1 : 0
  | hd::tl -> hump hd == v ? 1 + count_occurences(v, tl) ; count_occurences(v, tl)
;;
let count_occurences = (v, l) => {
let sum = 0;
for (let value of l) {
  if(v === value) {
    sum++;
  }
}
  return sum;
};