[Haskell-cafe] Equality Contstraint?

Proclivis mike at proclivis.com
Fri May 15 02:50:31 UTC 2015


Thanks, is there a recommended tutorial that walks through the type signatures of Arrow and sample implementations, and use in practice? Where the newbie reading it may need more hand holding.

Sent from my iPad

> On May 14, 2015, at 7:26 PM, Alexey Shmalko <rasen.dubi at gmail.com> wrote:
> 
> Hi, Michael,
> 
> It's irrefutable pattern - the pattern that matches lazily. You can get more info here [1].
> 
> Hope this helps,
> Alexey Shmalko
> 
> [1]: http://en.wikibooks.org/wiki/Haskell/Laziness#Lazy_pattern_matching
> 
>> On Fri, May 15, 2015 at 4:17 AM Michael Jones <mike at proclivis.com> wrote:
>> I am poking around in Arrow to understand it better. There is the following definition:
>> 
>>     second :: a b c -> a (d,b) (d,c)
>>     second f = arr swap >>> first f >>> arr swap
>>       where
>>         swap :: (x,y) -> (y,x)
>>         swap ~(x,y) = (y,x)
>> 
>> Can someone explain what the ~ is? Searching the net resulted in frustration.
>> 
>> 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.
>> 
>> Thanks
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150514/885638ce/attachment.html>


More information about the Haskell-Cafe mailing list