Recursion is a procedure that allows us to iterate through certain data structure. For example we can iterate through lists
sum : List Nat -> Nat
sum list =
import axios, { AxiosRequestConfig } from "axios"; | |
import router from "@/router"; //shortcut to src | |
import { Module } from "vuex"; | |
const authModule: Module<any, any> = { | |
state: { | |
loggedIn: false, | |
loginError: null, | |
username: null |
-module(pm). | |
-export([perimiter/1,area/1,enclosure/1,linearBits/1,bits/1]). | |
%% Shape objects: | |
%% | |
%% For the sake of brevity, all shape values | |
%% are expected to be positive integers. | |
%% | |
%% {circle, Radius} | |
%% {rectangle, {Width,Height}} |
#! /bin/env escript | |
% NAME | |
% fib_multi.erl -- Multiple algorithms for Fibonacci numbers | |
% | |
% SYNOPSIS | |
% fib_multi {from-integer} [{to-integer}] | |
% | |
% INSTALL | |
% ln -s fib_multi.erl fib_multi |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
#!/bin/bash | |
################ | |
# Uncomment if you want the script to always use the scripts | |
# directory as the folder to look through | |
#REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
REPOSITORIES=`pwd` | |
IFS=$'\n' |