
I'm not sure what you're using at the end of the identifier "search'", but
it needs to be the single quote that's on the same key as the double quotes.
I suspect that's where it's blowing up.
On Thu, May 28, 2009 at 9:56 PM, michael rice
This code, from YAHT (Section 8.4.2, PDF pg. 119 of 192) seems to have a problem. Code below.
Michael
=================
[michael@localhost ~]$ ghci GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> :l graph [1 of 1] Compiling Main ( graph.hs, interpreted )
graph.hs:6:24: lexical error at character '\8217' Failed, modules loaded: none.
==============
Prelude> data Graph v e = Graph [(Int,v)] [(Int,Int,e)]
search :: Graph v e -> Int -> Int -> Maybe [Int] search g@(Graph vl el) src dst | src == dst = Just [src] | otherwise = search’ el where search’ [] = Nothing search’ ((u,v,_):es) | src == u = case search g v dst of Just p -> Just (u:p) Nothing -> search’ es | otherwise = search’ es
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe