Sets symmetric difference

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Sets symmetric difference

Jenny678
Hello,

Know Somebody the code for symmetric difference (Sets)

examples

>symmetric_difference [1..8][5..7]
>[1,2,3,4,8]

>symmetric_ difference [1..8][]
>[1,2,3,4,5,6,7,8]

>symmetric_ difference [1..12][10..20]  
>[1,2,3,4,5,6,7,8,9,13,14,15,16,17,18,19,20]

Thanks for Help
Reply | Threaded
Open this post in threaded view
|

Re: Sets symmetric difference

Neil Mitchell
Hi,

This can quite easily be formulated in terms of union and \\ (set
difference), both available in Data.List.

Thanks

Neil

On 6/18/06, Jenny678 <[hidden email]> wrote:

>
> Hello,
>
> Know Somebody the code for symmetric difference (Sets)
>
> examples
>
> >symmetric_difference [1..8][5..7]
> >[1,2,3,4,8]
>
> >symmetric_ difference [1..8][]
> >[1,2,3,4,5,6,7,8]
>
> >symmetric_ difference [1..12][10..20]
> >[1,2,3,4,5,6,7,8,9,13,14,15,16,17,18,19,20]
>
> Thanks for Help
> --
> View this message in context: http://www.nabble.com/Sets-symmetric-difference-t1805165.html#a4919646
> Sent from the Haskell - Haskell-Cafe forum at Nabble.com.
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe