What is "~" ?

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

What is "~" ?

TG
Looking at the definition of "partition", it calls

    select :: (a -> Bool) -> a -> ([a], [a]) -> ([a], [a])
    select p x ~(ts,fs) | p x       = (x:ts,fs)
                        | otherwise = (ts, x:fs)

what does the "~" do?
Can't seem to find it in the documentation, or see a difference in
output without it.
Thank you.
--
  TG
  [hidden email]

--
http://www.fastmail.fm - Email service worth paying for. Try it for free

Reply | Threaded
Open this post in threaded view
|

What is "~" ?

Rahul Kapoor
~ signifies a lazy pattern.

See: http://www.haskell.org/tutorial/patterns.html
for more details.

Rahul

What kind of art do you like?
http://www.artquiver.com

On Thu, Apr 2, 2009 at 7:18 PM, TG <[hidden email]> wrote:

> Looking at the definition of "partition", it calls
>
> ? ?select :: (a -> Bool) -> a -> ([a], [a]) -> ([a], [a])
> ? ?select p x ~(ts,fs) | p x ? ? ? = (x:ts,fs)
> ? ? ? ? ? ? ? ? ? ? ? ?| otherwise = (ts, x:fs)
>
> what does the "~" do?
> Can't seem to find it in the documentation, or see a difference in
> output without it.
> Thank you.
> --
> ?TG
> ?[hidden email]
>
> --
> http://www.fastmail.fm - Email service worth paying for. Try it for free
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/beginners
>