
2 Jun
2011
2 Jun
'11
6:07 a.m.
On Thu, Jun 2, 2011 at 12:02 PM, Chaddaï Fouché
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)
oops, I obviously meant :
splitLookup x s = let (inf, b, sup) = splitMember x s in (inf, if b then Just x else Nothing, sup)
And for what you want :
yourSplit x s = let (inf, b, sup) = splitMember x s in if b then Right x else Left (findMax inf, findMin sup)
-- Jedaï