
5 Dec
2015
5 Dec
'15
5:35 p.m.
I have the following code: {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} class Graph g a where vertices :: g a -> [a] edges :: g a-> [(a, a)] type AdjList a = [(a,[a])] instance Graph AdjList Int where vertices g = map fst g edges g = concatMap listEdges g where listEdges (startV, edges) = map (\endV -> (startV, endV)) edges but the compiler complains: """Type synonym ���AdjList��� should have 1 argument, but has been given none In the instance declaration for ���Graph AdjList Int��� """ How can I fix this error? Thanks!