[Haskell-cafe] ~ operator ?

2013-02-18 Thread briand
Hi all, I was creating bigger uncurries which I am simply extending from an existing uncurry I found some where, e.g. uncurry4 :: (a - b - c - d - e) - ((a, b, c, d) - e) uncurry4 f ~(a,b,c,d) = f a b c d when I realized, what's the ~ for ? I've only been able to find a partial explanation

Re: [Haskell-cafe] ~ operator ?

2013-02-18 Thread Patrick Palka
The difference the ~ makes in this case is that `uncurry4 (\_ _ _ _ - ()) undefined` evaluates to `()` instead of bottom. The ~ is called an irrefutable pattern, and it helps make code that pattern matches on constructors more lazy. This seems like a good explanation of the subject:

Re: [Haskell-cafe] ~ operator ?

2013-02-18 Thread briand
On Mon, 18 Feb 2013 19:13:13 + Mateusz Kowalczyk fuuze...@fuuzetsu.co.uk wrote: On 18/02/13 19:02, bri...@aracnet.com wrote: Hi all, I was creating bigger uncurries which I am simply extending from an existing uncurry I found some where, e.g. uncurry4 :: (a - b - c - d - e) -

Re: [Haskell-cafe] Operator precedence and associativity with Polyparse

2011-10-26 Thread Christian Maeder
Am 26.10.2011 01:49, schrieb Tom Hawkins: Can someone provide guidance on how handle operator precedence and associativity with Polyparse? Do you mean parsing something like 1 + 2 * 3 ? I don't think there's any real difference in using Polyparse vs Parsec for this, except for doing p

[Haskell-cafe] Operator precedence and associativity with Polyparse

2011-10-25 Thread Tom Hawkins
Hi, Can someone provide guidance on how handle operator precedence and associativity with Polyparse? Thanks in advance. -Tom ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Operator precedence and associativity with Polyparse

2011-10-25 Thread Ivan Lazar Miljenovic
On 26 October 2011 06:37, Tom Hawkins tomahawk...@gmail.com wrote: Hi, Can someone provide guidance on how handle operator precedence and associativity with Polyparse? Do you mean parsing something like 1 + 2 * 3 ? I don't think there's any real difference in using Polyparse vs Parsec for

Re: [Haskell-cafe] Operator precedence and associativity with Polyparse

2011-10-25 Thread Tom Hawkins
Can someone provide guidance on how handle operator precedence and associativity with Polyparse? Do you mean parsing something like 1 + 2 * 3 ?  I don't think there's any real difference in using Polyparse vs Parsec for this, except for doing p `orElse` q rather than try p | q. Actually, I

Re: [Haskell-cafe] Operator precedence and associativity with Polyparse

2011-10-25 Thread Ivan Lazar Miljenovic
On 26 October 2011 10:49, Tom Hawkins tomahawk...@gmail.com wrote: Can someone provide guidance on how handle operator precedence and associativity with Polyparse? Do you mean parsing something like 1 + 2 * 3 ?  I don't think there's any real difference in using Polyparse vs Parsec for this,

[Haskell-cafe] Operator #

2010-12-09 Thread c8h10n4o2
What does # mean in this code ? (from Data.List) findIndices p ls = loop 0# ls where loop _ [] = [] loop n (x:xs) | p x = I# n : loop (n +# 1#) xs | otherwise = loop (n +# 1#) xs -- View this

Re: [Haskell-cafe] Operator #

2010-12-09 Thread Daniel Fischer
On Thu, Dec 9, 2010 at 8:31 PM, c8h10n4o2 asaferibei...@ymail.com wrote: What does # mean in this code ? (from Data.List) It's a magic hash denoting here on the one hand unboxed machine ints (0#) and on the other the constructor wrapping such a raw machine int to a Haskell boxed Int (I#). GHC

[Haskell-cafe] Operator precedence

2010-09-06 Thread michael rice
Is there a handy list of operators and their precedence somewhere? Michael ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Operator precedence

2010-09-06 Thread Daniel Díaz
Take a look to the Haskell Report: http://www.haskell.org/onlinereport/haskell2010/haskellch9.html#x16-1710009 -- Daniel Díaz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Operator precedence

2010-09-06 Thread michael rice
, Daniel Díaz lazy.dd...@gmail.com wrote: From: Daniel Díaz lazy.dd...@gmail.com Subject: Re: [Haskell-cafe] Operator precedence To: michael rice nowg...@yahoo.com, haskell-cafe@haskell.org Date: Monday, September 6, 2010, 1:06 PM Take a look to the Haskell Report:   http://www.haskell.org

Re: [Haskell-cafe] Operator precedence

2010-09-06 Thread Daniel Díaz
Those are all operators in Prelude. See a concrete library for their operator precedences. -- Daniel Díaz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Operator precedence

2010-09-06 Thread michael rice
Subject: Re: [Haskell-cafe] Operator precedence To: michael rice nowg...@yahoo.com, haskell-cafe@haskell.org Date: Monday, September 6, 2010, 1:17 PM Those are all operators in Prelude. See a concrete library for their operator precedences. -- Daniel Díaz

Re: [Haskell-cafe] Operator precedence

2010-09-06 Thread Bulat Ziganshin
Hello michael, Monday, September 6, 2010, 9:00:32 PM, you wrote: Is there a handy list of operators and their precedence somewhere? unlike most languages, operators are user-definable in haskell. so there is no comprehensive list any function with two arguments van be used as operator: a

Re: [Haskell-cafe] Operator precedence

2010-09-06 Thread David Menendez
On Mon, Sep 6, 2010 at 1:37 PM, michael rice nowg...@yahoo.com wrote: A concrete library? I'm playing around with Data.Bits. It has .. and .|. which I assume are functions (rather than operators) because I don't see and infix statement for them. Correct? .|. and .. are operators because

Re: [Haskell-cafe] Operator precedence

2010-09-06 Thread michael rice
Hi David, You're right, I keep forgetting to look at the source code. And I wasn't aware of the info (:i) command. Should come in handy in the future. Michael --- On Mon, 9/6/10, David Menendez d...@zednenem.com wrote: From: David Menendez d...@zednenem.com Subject: Re: [Haskell-cafe

Re: [Haskell-cafe] Operator precedence

2010-09-06 Thread Daniel Díaz
El Lun, 6 de Septiembre de 2010, 7:50 pm, David Menendez escribió: Operators default to infixl 9 unless specified otherwise, so no infix declaration is needed. Why there is a default infix? Why it is 9? -- Daniel Díaz ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Operator precedence

2010-09-06 Thread David Menendez
On Mon, Sep 6, 2010 at 2:21 PM, Daniel Díaz danield...@asofilak.es wrote: El Lun, 6 de Septiembre de 2010, 7:50 pm, David Menendez escribió: Operators default to infixl 9 unless specified otherwise, so no infix declaration is needed. Why there is a default infix? Why it is 9? That's what

[Haskell-cafe] Operator precedence and associativity on happy grammars

2009-05-07 Thread j . romildo
Hello. I am learning how to use Happy (a LALR(1) parser generator) and I have a question on a grammar based on an example from the manual. The input file to Happy is attached to this message. The grammar is: Exp - let var = Exp in Exp Exp - Exp + Exp Exp - Exp - Exp Exp - Exp * Exp

[Haskell-cafe] Operator cheat sheet, and monadic style q

2008-11-22 Thread Owen Smith
Greetings, I'm a longtime Haskell-curious programmer who, after a few aborted attempts at getting started and long nights staring at academic papers, finally managed to get the bug. I've been pleased with my progress so far, but a couple of things have bugged me enough to seek advice from the

Re: [Haskell-cafe] Operator cheat sheet, and monadic style q

2008-11-22 Thread Andrew Coppin
Owen Smith wrote: 1. Contending with the use of frequently unfamiliar non-alphanumeric operators has been an uphill battle for me. I think the main reason for this is that I've had no luck in Googling up their definitions (my primary approach for dealing with every other unknown in the Haskell

Re: [Haskell-cafe] Operator cheat sheet, and monadic style q

2008-11-22 Thread Max Rabkin
On Sat, Nov 22, 2008 at 11:31 AM, Owen Smith [EMAIL PROTECTED] wrote: I'm a longtime Haskell-curious programmer who, after a few aborted attempts at getting started and long nights staring at academic papers, finally managed to get the bug. I've been pleased with my progress so far, but a

Re: [Haskell-cafe] Operator cheat sheet, and monadic style q

2008-11-22 Thread Luke Palmer
On Sat, Nov 22, 2008 at 2:31 AM, Owen Smith [EMAIL PROTECTED] wrote: 2. There's a lot I need to learn about good Haskell style, especially coming from a C++ background. Even my experience in Lisp seems to result in way more parentheses than Haskell coders are comfortable with. :-) In

Re: [Haskell-cafe] Operator overloading

2007-08-09 Thread Brent Yorgey
On 8/9/07, rodrigo.bonifacio [EMAIL PROTECTED] wrote: Hi all. I want to overload the operator ^ for working instead of the following +++ operator: (+++) :: String - [[String]] - [[String]] x +++ y = [ x:e | e-y ] How can I overload the ^ operator? import Prelude hiding ( (^) ) -- this

[Haskell-cafe] (!!) operator usage

2006-03-24 Thread Neil Rutland
Hi there, I hope i have sent this in the right format - i gather i may have been rude by sending it incorrectly - if this is still wrong give me a shout. Anyway today i am enquiring about how to use the !! operator - i have looked at Zvons Haskell refeernce and it says that it takes a list(

Re: [Haskell-cafe] (!!) operator usage

2006-03-24 Thread Stefan Holdermans
Neil, Basically in this example i would like to return the value 4 type Bob = [(Int, Int)] newLine :: Bob newLine = [(1,4)] i have tried to use the follwing but it returns the error below it. newLine !! 0 - (so that should give it the newLine list and try and return the 1st element of the