
26 Apr
2015
26 Apr
'15
1:05 p.m.
Martin reacts to my non-answer:
Am 04/26/2015 um 05:28 PM schrieb Jerzy Karczmarczuk:
... and GHCi says:
*Main> ex10 *** Exception: Prelude.head: empty list This is because I have commented out two corner cases in tBind, to make sure it's not them. Remove the comments and it'll work Martin I sent you a private follow-up. I repeat it here.
I uncommented those lines. Your program goes until the end of the list, and returns the /*last*/ element (modified). The form *tBind tpr f ... (tTail tpr `tBind` f) * loops until ... Now, I know about laziness... It seems that it doesn't help. Most probably your hd is simply empty, and the tail gets stuck in an idle loop. Jerzy Karczmarczuk