From 4aecebb6c577d2a7e9a5bdfda002d4b81c79194d Mon Sep 17 00:00:00 2001 From: Karlis Lauva Date: Sat, 5 Dec 2015 22:21:06 +0200 Subject: [PATCH] use Data.Map.keys in toList implements #29 --- src/Data/Set.purs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Data/Set.purs b/src/Data/Set.purs index be20175..16a846d 100644 --- a/src/Data/Set.purs +++ b/src/Data/Set.purs @@ -29,7 +29,6 @@ import Prelude import Data.Foldable (Foldable, foldMap, foldl, foldr) import Data.List (List()) import Data.Monoid (Monoid) -import Data.Tuple (fst) import qualified Data.Map as M import Control.Monad.Eff (runPure, Eff()) @@ -102,7 +101,7 @@ fromFoldable = foldl (\m a -> insert a m) empty -- | Convert a set to a list toList :: forall a. Set a -> List a -toList (Set m) = map fst (M.toList m) +toList (Set m) = M.keys m -- | Create a set from a list of elements fromList :: forall a. (Ord a) => List a -> Set a