That works. Thanks. I didn't realize you could put types in the
expression itself.
On 12/20/06, Greg Buchholz <[EMAIL PROTECTED]> wrote:
Joshua Ball wrote:
> Here is how I am trying to solve the problem, using multi-parameter
> type classes.
>
> class NPProblem inst cert where
>validates ::
Joshua Ball wrote:
> Here is how I am trying to solve the problem, using multi-parameter
> type classes.
>
> class NPProblem inst cert where
>validates :: cert -> inst -> Bool
>certificates :: inst -> [cert]
>decide :: inst -> Bool
>decide i = any (\x -> x `validates` i) $ certific
Hi all,
For my own study, I've been playing around with various NP complete
problems. Previuosly I was doing so in Java, but because I want to
learn Haskell, I'm trying to port the algorithms. In Java, I had an
abstract class called AbstractNPProblem which looked like this:
public abstract class