[Haskell-cafe] Re: Embedding newlines into a string?

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Tue Apr 15 00:31:34 EDT 2008


On Apr 14, 2008, at 23:45 , Benjamin L. Russell wrote:

> hanoi_shower :: Show a => [(a, a)] -> String
> hanoi_shower ((a, b) : moves)
>     | null moves = "Move " ++ show a ++ " to "++ show b ++ "."
>     | otherwise == "Move " ++ show a ++ " to "++ show b ++ "." ++  
> hanoi_shower moves

`==' after the `otherwise'?  (I think the error involving `}' is a  
side effect of the single ugliest part of Haskell syntax, which  
specifies the parser inserting `}' as necessary to try to get a parse.)

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list