
21 Aug
2013
21 Aug
'13
1:37 p.m.
Peter Jones
Your `symbolToConstructor' function is too specific for both cases you describe. You'd need to change the `String' argument to `a' and put it back in the type class or write it like this:
symbolToInfixLevel :: (Foo a) => a -> Int symbolToInfixLevel s = infixLevel $ (symbolToConstructor s) undefined
Actually, the problem is with your `symbolToConstructor' function. It needs to look like this: symbolToConstructor :: (Foo a) => String -> a Then symbolToInfixLevel can be: symbolToInfixLevel :: String -> Int -- Peter Jones, Founder, Devalot.com Defending the honor of good code