Merge branch 'master' into 1233-local

Conflicts:
	lib/linguist/language.rb
	lib/linguist/languages.yml
	lib/linguist/samples.json
This commit is contained in:
Arfon Smith
2014-11-01 09:59:29 -05:00
parent 12b78c5357
commit 9e50e188a8
77 changed files with 3066 additions and 74080 deletions

33
samples/Clean/stack.icl Normal file
View File

@@ -0,0 +1,33 @@
implementation module stack
import StdEnv
:: Stack a :== [a]
newStack :: (Stack a)
newStack = []
push :: a (Stack a) -> Stack a
push x s = [x:s]
pushes :: [a] (Stack a) -> Stack a
pushes x s = x ++ s
pop :: (Stack a) -> Stack a
pop [] = abort "Cannot use pop on an empty stack"
pop [e:s] = s
popn :: Int (Stack a) -> Stack a
popn n s = drop n s
top :: (Stack a) -> a
top [] = abort "Cannot use top on an empty stack"
top [e:s] = e
topn :: Int (Stack a) -> [a]
topn n s = take n s
elements :: (Stack a) -> [a]
elements s = s
count :: (Stack a) -> Int
count s = length s