Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #30 from skazhy/set-tolist
Browse files Browse the repository at this point in the history
use Data.Map.keys in toList
  • Loading branch information
garyb committed Jan 15, 2016
2 parents 6f63c1a + 4aecebb commit cac3607
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Data/Set.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cac3607

Please # to comment.