
3 Apr
2011
3 Apr
'11
10:31 a.m.
HI Cafe I have problem with this function value :: Theorm-> [(String,Int)] -> Tem -> Int value _ env (Var s) = maybe (error "Unknown variable.") id (lookup s env) value mdl env (OP s _ _ l) = maybe (error "Function not defined.") id (lookup (map (value mdl env) l) (S.toList $ maybe (error "Uknown function.") id (fmap snd (multiLookup s (operations mdl))))) This function is working fine, but I want to change error function to fail function to be able use it in my GUI application. I can't change the output of value function to IO Int,any idea will help. Thanks Nour.