summaryrefslogtreecommitdiff
path: root/files/practicum/IKS.icl
blob: cdcdce98277ca544e0f3fa186a5d92d9e1af2dba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module IKS

import StdEnv
import StdMaybe
import StdDynamic, StdDynamicFileIO

/**	Een interpreter voor IKS.
*/
//	1. Creeer de dynamics op disk
Start :: *World -> *World
Start world 
# (_,world) = writeDynamic "I" (dynamic i :: A. a: a -> a) world
  ...
= world

i :: a -> a
i x = x

k :: a b -> a
k x y = x

s :: (a -> b -> c) (a -> b) a -> c
s x y z = x z (y z)


//	2. Parseren van IKS expressies
::	IKS = I | K | S | N Int | App IKS IKS

pIKS :: [Char] -> Maybe IKS
pIKS ...


//	3. Interpreteren van IKS expressies
interp :: (Dynamic,Dynamic,Dynamic) IKS -> Dynamic
interp ...


//	4. console
Start :: *World -> *World
Start ...