{-# LANGUAGE OverloadedLists #-} import Data.Set as S main :: IO () main = do let x = fromList [a+b | a<-[1,2,3], b<-[2,3,4]] :: S.Set Int -- x = [1,2,3] :: S.Set Int -- this works print x