[Haskell-cafe] Equality Contstraint?
hyarion at iinet.net.au
Fri May 15 01:44:42 UTC 2015
Just in case it helps anyone's confusion, your equality constraint
idea was on a reasonable track. When the ~ symbol appears *in a type
signature* it is indeed an equality constraint. But in a pattern
expression it's the marker for an irrefutable pattern.
----- Original Message -----
From: "Alexey Shmalko"
To:"Michael Jones" , ""
Sent:Fri, 15 May 2015 01:26:23 +0000
Subject:Re: [Haskell-cafe] Equality Contstraint?
It's irrefutable pattern - the pattern that matches lazily. You can
get more info here .
Hope this helps,Alexey Shmalko
On Fri, May 15, 2015 at 4:17 AM Michael Jones wrote:
I am poking around in Arrow to understand it better. There is the
second :: a b c -> a (d,b) (d,c)
second f = arr swap >>> first f >>> arr swap
swap :: (x,y) -> (y,x)
swap ~(x,y) = (y,x)
Can someone explain what the ~ is? Searching the net resulted in
I kind of think it is some kind of equality constraint but can’t
find documentation. Perhaps if I knew what it was called I might
succeed in finding something If it is an equality constraint, please
provide a reference if you have one. I did not find anything in a
search including GHC, etc.
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org 
 mailto:mike at proclivis.com
 mailto:Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe