Interpreter in FP

allgemein:

interpreter :: Programm -> Daten -> Resultat

Beispiel

data Colour = Red | Green
data Car = Car { wheels :: Integer , colour :: Colour }

data Property = Colour_Is Colour
              | Max_Wheels Integer
              | And Property Property

evaluate :: Property -> Car -> Bool

Anwendung:

filter ( evaluate p ) cars



Johannes Waldmann 2011-07-07