
Em Qui, 2007-01-11 às 06:37 -0800, Tom Titchener escreveu:
ERROR - Cannot find "show" function for:
*** Expression : eval answer
*** Of type : Int -> (Int,Int)
type M a = State -> (a, State) -- higher-order type, e.g. function type
type State = Int -- type synonym
So M a = Int -> (a, Int)
eval :: Term -> M Int
So eval :: Term -> Int -> (Int, Int)
answer, error :: Term
I get the “ERROR” message when I type “eval answer” at the Hugs prompt.
eval answer :: M Int eval answer :: Int -> (Int, Int) Then you got to the error: there's no instance Show (Int -> (Int, Int)) To call eval (x :: Term) you must pass a initial State, say 0. eval answer 0 :: (Int, Int) -- malebria Marco Túlio Gontijo e Silva Correio (MSN): malebria@riseup.net Jabber (GTalk): malebria@jabber.org Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil