3 ms·
The paper is quite old, Num is no longer a subclass of Eq: ghci> :i Num class Num a where (+) :: a -> a -> a thus ‘memsq’ would look as follows:
by Iceland_jack 12y ago
The paper is quite old, Num is no longer a subclass of Eq:
ghci> :i Num
class Num a where
(+) :: a -> a -> a
thus ‘memsq’ would look as follows:
memsq :: (Eq a, Num a) => [a] -> a -> Bool
memsq xs x = square x `elem` xs