Dan Lior | 8 Mar 2013 01:45
Picon

Newbie

Hello, 

I'm new to Haskell and this is my first post to this forum. 

A few questions right off the bat:

1) Is this the right place for newbies to post questions about Haskell?
2) Is there a FAQ for Haskell questions? 
3) Are there any active Haskell user groups in the Chicago area?

A more technical question:

I'm messing around with basic Haskell examples on eclipse using the FP add-on running over GHC. 

The following code works:

pred :: Int -> Int
pred 0 = 0
pred n = n-1

The following code doesn't:

pred :: Int -> Int
pred 0 = 0
pred n+1 = n

Does anyone know why this might be? 

"Thanks" and "I apologize" in advance. 

(Continue reading)

Brandon Allbery | 8 Mar 2013 01:56
Picon
Gravatar

Re: Newbie

On Thu, Mar 7, 2013 at 7:45 PM, Dan Lior <sitiposit <at> gmail.com> wrote:
1) Is this the right place for newbies to post questions about Haskell?


This is most a list for announcements; beginners <at> haskell.org is better for these kinds of questions, and haskell-cafe <at> haskell.org for general discussion.

pred :: Int -> Int
pred 0 = 0
pred n+1 = n

n+k patterns were part of Haskell '98, but removed from Haskell 2010. You may be able to use the pragma

    {-# LANGUAGE NPlusKPatterns #-}

to turn them back on.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Haskell mailing list
Haskell <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell
Ivan Lazar Miljenovic | 8 Mar 2013 02:43
Picon
Gravatar

Re: Newbie

On 8 March 2013 11:56, Brandon Allbery <allbery.b <at> gmail.com> wrote:
> On Thu, Mar 7, 2013 at 7:45 PM, Dan Lior <sitiposit <at> gmail.com> wrote:
>>
>> 1) Is this the right place for newbies to post questions about Haskell?
>
>
>
> This is most a list for announcements; beginners <at> haskell.org is better for
> these kinds of questions, and haskell-cafe <at> haskell.org for general
> discussion.
>
>> pred :: Int -> Int
>> pred 0 = 0
>> pred n+1 = n
>
>
> n+k patterns were part of Haskell '98, but removed from Haskell 2010. You
> may be able to use the pragma
>
>     {-# LANGUAGE NPlusKPatterns #-}
>
> to turn them back on.

Even then, you need to have "pred (n+1) = n".

>
> --
> brandon s allbery kf8nh                               sine nomine associates
> allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
>
> _______________________________________________
> Haskell mailing list
> Haskell <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>

--

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic <at> gmail.com
http://IvanMiljenovic.wordpress.com
Henning Thielemann | 8 Mar 2013 10:21
Picon

Re: Newbie


On Thu, 7 Mar 2013, Dan Lior wrote:

> Hello,
>
> I'm new to Haskell and this is my first post to this forum.
>
> A few questions right off the bat:
>
> 1) Is this the right place for newbies to post questions about Haskell?
> 2) Is there a FAQ for Haskell questions?

    http://www.haskell.org/haskellwiki/Category:FAQ

> 3) Are there any active Haskell user groups in the Chicago area?

I don't know, but user groups can be found at:
    http://www.haskell.org/haskellwiki/Category:Community

Gmane