
2 Jun
2011
2 Jun
'11
6:02 a.m.
On Wed, Jun 1, 2011 at 10:56 PM, Christoph Bussler
Hi,
In Data.Set there is a function splitLookup
splitLookup :: Ord a => a -> Set a -> (Set a,Maybe a,Set a)
that is not exported, but would precisely give me the functionality that I need. Not sure why it is not exported, but is there a way to use it?
No but splitMember is exported and give you strictly the same functionality, if you really want to rewrite splitLookup, you can just do :
splitLookup x s = let (inf, b, sup) in (inf, if b then Just x else Nothing, sup)
-- Jedaï