diff --git a/src/Algebra/Graph/Relation/Internal.hs b/src/Algebra/Graph/Relation/Internal.hs index f47f88ce3..fd0583945 100644 --- a/src/Algebra/Graph/Relation/Internal.hs +++ b/src/Algebra/Graph/Relation/Internal.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Algebra.Graph.Relation.Internal @@ -171,7 +172,11 @@ instance NFData a => NFData (Relation a) where -- | Compute the Cartesian product of two sets. /Note: this function is for internal use only/. setProduct :: Set a -> Set b -> Set (a, b) +#if MIN_VERSION_containers(0,5,11) +setProduct = Set.cartesianProduct +#else setProduct x y = Set.fromDistinctAscList [ (a, b) | a <- Set.toAscList x, b <- Set.toAscList y ] +#endif instance (Ord a, Num a) => Num (Relation a) where fromInteger = vertex . fromInteger