Avatar billede sibga Nybegynder
27. oktober 2008 - 11:38

SML help !

Hello,

Can anyone help me on that... plsss I have to make a list..

composelist: (´ab -> ´ab)list -> ´ab -> ´ab, such that if
[f1, ..., fn] is a list of suncions of type ´ab -> ´ab and x is a value of type ´ab,  then the call composelist [f1, ..., fn] x will return the value vf1(f2(... fn-1(fn(x)))).
In the case where n = 0 (the list of dunction is empty) composelist [] x should return x.

composelist [fn y => Y*Y, fn z => z+1, fn w => div 2] 4

should return the value 9 (= ((4div2)+1)* ((4div2)+1)).

Thanks in advance...
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester