[Haskell-cafe] request for code review

Brian Hulley brianh at metamilk.com
Sun Mar 5 09:05:11 EST 2006


Neil Mitchell wrote:
>> stackTop ctx =
>>   let (x:xs) = stack ctx in x
> stackTop ctx = head ctx

stackTop ParseContext{stack=x:_} = x

or:

stackTop ctx = head (stack  ctx)

===            stackTop ctx = head . stack $ ctx
===            stackTop = head . stack

Regards, Brian.



More information about the Haskell-Cafe mailing list