Weak Head Normal Form

haskell Is the expression (_, 'b') in Normal Form? in Weak Head

Weak Head Normal Form. Now, i have following expression: Weak head normal form means, the expression will only evaluate as far as necessary to reach to a data constructor.

haskell Is the expression (_, 'b') in Normal Form? in Weak Head
haskell Is the expression (_, 'b') in Normal Form? in Weak Head

Web weak head normal form. Reduction strategies [ edit ] But more importantly, working through the theory from its original viewpoint exposes us to different ways of thinking. An expression in weak head normal form has been evaluated to the outermost data constructor or lambda abstraction (the head). The first argument of seq will only be evaluated to weak head normal form. Normal form means, the expression will be fully evaluated. This means a redex may appear inside a lambda body. Now, i have following expression: But then i read this wikipedia article where whnf is defined for the lambda calculus as follows: A constructor (eventually applied to arguments) like true, just (square 42) or (:) 1.

The first argument of seq will only be evaluated to weak head normal form. Web there is also the notion of weak head normal form: Therefore, every normal form expression is also in weak head normal form, though the opposite does not hold in general. But then i read this wikipedia article where whnf is defined for the lambda calculus as follows: Web reduce terms to weak normal forms only. Aside from a healthy mental workout, we find lambda calculus is sometimes superior: Normal form means, the expression will be fully evaluated. Seq is defined as follows. And once i read through them i thought i got it. (f x) ] = false (2) whnf [ x y ] = whnf [ x ] (3) in all other cases whnf [x] = true (4) An expression in weak head normal form has been evaluated to the outermost data constructor or lambda abstraction (the head).