Die Suche ergab 22 Treffer

von Nori
25. Jul 2009 17:59
Forum: Archiv
Thema: Y-Combinator
Antworten: 7
Zugriffe: 486

Re: Y-Combinator

By the way.

Is it possible to wirte doen the type signature of the Y-combinator? Would it be 'endless' ?
von Nori
22. Jul 2009 19:01
Forum: Archiv
Thema: Y-Combinator
Antworten: 7
Zugriffe: 486

Y-Combinator

In the lambda lecture, on slide 29 a Y combinator is defined: Y := ((lambda (f) (lambda (x) (f (x x)))) (lambda (f) (lambda (x) (f (x x))))) however, I couldn't prove it really is one [satisfies (Y g) == (g (Y g))] could it be this Y-Combinator was meant instead (defined in wikipedia)? Y := ((lambda...
von Nori
19. Jul 2009 18:50
Forum: Archiv
Thema: Enviroment-passing style
Antworten: 3
Zugriffe: 353

Re: Enviroment-passing style

As far as I understood, store-passing-style is needed to distinguish between variable definitions, and value updates. In enviroment-passing-style, a local definition of a variable in the first statement of a seqn would still be visible in the second statement of the seqn, because it was added to the...
von Nori
15. Jul 2009 23:35
Forum: Archiv
Thema: Topics for last lecture/exercise sought
Antworten: 6
Zugriffe: 479

Re: Topics for last lecture/exercise sought

It is clear now. I repeated that part today. Thanks.
von Nori
15. Jul 2009 15:07
Forum: Archiv
Thema: Topics for last lecture/exercise sought
Antworten: 6
Zugriffe: 479

Re: Topics for last lecture/exercise sought

My (additional) late questions:

- difference between type and newtype.
- what exactly does unit " () " do?
- recursion, p31: "how would you extend a CFWAE interpreter that employs immediate substitution to support recursive functions"
von Nori
10. Jul 2009 14:44
Forum: Archiv
Thema: [Ex 10, Task 2]
Antworten: 1
Zugriffe: 121

[Ex 10, Task 2]

Quick question:

Should "greater" and "smaller" be strict (greater two two) => no ?
The last two test cases suggest so:

Code: Alles auswählen

(test ((greater (succ three) (exp two two)) true false) false)
(test ((smaller (succ three) (exp two two)) true false) false)
von Nori
25. Jun 2009 15:07
Forum: Archiv
Thema: [Ex 7, Task 3]
Antworten: 3
Zugriffe: 190

Re: [Ex 7, Task 3]

Thanks for the offer, it is working now (after trashing the fold approach).
von Nori
24. Jun 2009 22:53
Forum: Archiv
Thema: [Ex 7, Task 3]
Antworten: 3
Zugriffe: 190

[Ex 7, Task 3]

Hi, I think I almost got it, but one problem remains. To create the cyclic enviroment in which every function definition is visible, I fold all given definitions inside rec over the ambient environment. This way I call cyclically-bind-and-interp for every definition on the same environment. However,...
von Nori
11. Jun 2009 01:13
Forum: Archiv
Thema: Ass. 6 Task 8
Antworten: 6
Zugriffe: 548

Re: Ass. 6 Task 8

An evil difference is, that s and a are switched(!) Cost me about 1 hour to find that out.
von Nori
10. Jun 2009 15:52
Forum: Archiv
Thema: Ass. 6 Task 8
Antworten: 6
Zugriffe: 548

Ass. 6 Task 8

Hi again,
I was wondering if the type signature in task 8 is correct. It is similar to the signatures on slide 20 in monads.pdf (addRec, delRec), but aren't both missing the "db" as a parameter? Isn't addSheep as well?

I'm really not quite sure.
von Nori
1. Jun 2009 21:33
Forum: Archiv
Thema: Fifth assignment now available
Antworten: 10
Zugriffe: 560

Re: Fifth assignment now available

In task 7.1, when interpreting "if" should the "then-clause" and the "else-clause" also be eagerly evaluated, or just the "conditional-clause"?
von Nori
19. Mai 2009 22:41
Forum: Archiv
Thema: assignment 4, task 1
Antworten: 11
Zugriffe: 541

Re: assignment 4, task 1

Hello, I'm also struggling with this task. I added a type variable a to both FAE and FAEValue and now ghci complains I did paremeterize the FAEValues in the defintion of the environment (env). I think I should use a wildcard (live Java "?") here, but I don't know how to do that in haskell. Am I even...
von Nori
13. Mai 2009 11:54
Forum: Archiv
Thema: Third assignment now available
Antworten: 11
Zugriffe: 556

Re: Third assignment now available

Thanks, it's solved now. Now, a question for task 1 remains: Should the function definitions also be stored in the environment? The evaluate function seems to distinguish between the fun-defs as a list, and the environment as a hash-table. So it seems like only variables should get stored in the has...
von Nori
12. Mai 2009 01:13
Forum: Archiv
Thema: Third assignment now available
Antworten: 11
Zugriffe: 556

Re: Third assignment now available

I'm struggling with Task 3. As far as I understand, the preproc not just has to nest function definitions, but also their calls. So {{f {x y} {+x y}} 2 3} expands to {{{f {x} {fun {y} {+ x y}}} 2} 3} I find this difficult to implement, since preproc has to recognize not just function definitions, bu...
von Nori
30. Apr 2009 11:56
Forum: Archiv
Thema: Ex. 2.4: Lazy Evaluation
Antworten: 5
Zugriffe: 338

Re: Ex. 2.4: Lazy Evaluation

got it, sorry.

Zur erweiterten Suche