On 12/01/10 21:35, Larry Evans wrote:
[snip]
> Hi Noah,
> 
> The attached is my attempt at reproducing your code
[snip]
> However, ghci compilation of bifold produces an error message:
> 
>   BifoldIfRecur.hs:20:19: parse error on input `='
> 
[snip]
Apparently I had some extra leading spaces in the last line.
Taking those out (as shown in attached) results in a good
reading of the file by ghci.

-Larry
{-
  Purpose:
    Test bifold code shown in post:
      http://article.gmane.org/gmane.comp.lang.haskell.cafe/83874
-}

module Bifold where
  {--}
  bifold :: (l -> a -> r -> (r,l)) -> (l,r) -> [a] -> (r,l)
  bifold _ (l,r) [] = (r,l)
  bifold f (l,r) (a:as) = (ra,las)
   where (ras,las) = bifold f (la,r) as
         (ra,la) = f l a ras
  {--}
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to