Re: [Haskell-cafe] beginner question: assigning local variable to a function

2009-05-07 Thread Brandon S. Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On May 7, 2009, at 14:03 , Magnus Therning wrote: adam vogt wrote: This is most likely attributable to the use of different compilers. I don't see how accepting such a variant can cause ambiguity, but I'm not quite sure whether it is legal H98. Ju

Re: [Haskell-cafe] beginner question: assigning local variable to a function

2009-05-07 Thread Magnus Therning
adam vogt wrote: This is most likely attributable to the use of different compilers. I don't see how accepting such a variant can cause ambiguity, but I'm not quite sure whether it is legal H98. Just a bit curious then what compiler Brandon was using. I'm using GHC 6.10.2 on AMD64 Linux (Arc

Re: [Haskell-cafe] beginner question: assigning local variable to a function

2009-05-07 Thread adam vogt
This is most likely attributable to the use of different compilers. I don't see how accepting such a variant can cause ambiguity, but I'm not quite sure whether it is legal H98. On 5/6/09, Magnus Therning wrote: > Brandon S. Allbery KF8NH wrote: > > On May 6, 2009, at 12:18 , Nico Rolle wrote: >

Re: [Haskell-cafe] beginner question: assigning local variable to a function

2009-05-06 Thread Magnus Therning
Brandon S. Allbery KF8NH wrote: On May 6, 2009, at 12:18 , Nico Rolle wrote: why does this don't work? test = let a = (>) in 1 `a` 2 Works fine here once I correct your indentation (the "in" needs to be indented at least as far as the "l" in "let"). Really? For me it's enough to have

Re: [Haskell-cafe] beginner question: assigning local variable to a function

2009-05-06 Thread Nico Rolle
Oh sorry guys was rlly a stupid indentation mistake next time i'll post the error message too thanks regards 2009/5/6 Brandon S. Allbery KF8NH : > On May 6, 2009, at 12:18 , Nico Rolle wrote: >> >> why does this don't work? >> >> test = let a = (>) >>   in 1 `a` 2 > > > Works fine here once I corr

Re: [Haskell-cafe] beginner question: assigning local variable to a function

2009-05-06 Thread Brandon S. Allbery KF8NH
On May 6, 2009, at 12:18 , Nico Rolle wrote: why does this don't work? test = let a = (>) in 1 `a` 2 Works fine here once I correct your indentation (the "in" needs to be indented at least as far as the "l" in "let"). -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf

[Haskell-cafe] beginner question: assigning local variable to a function

2009-05-06 Thread Nico Rolle
hi why does this don't work? test = let a = (>) in 1 `a` 2 regards ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Beginner question

2009-01-02 Thread Benjamin Bach
>>> module Main(main) where >>> main = putStr (show []) > > What type is your "[]" here? > (...) > You may think it's irrelevant, since empty lists are showed the same; but > they are not: for example, ([] :: [Char]) would be shown as '""' (empty > string). Of course you're right. Didn't know ho

Re: [Haskell-cafe] Beginner question

2009-01-02 Thread Miguel Mitrofanov
On 2 Jan 2009, at 19:57, Benjamin Bach wrote: Supposing I have the following code: module Main(main) where main = putStr (show []) What type is your "[]" here? main :: IO () putStr :: String -> IO () show [] :: String show :: Show a => a -> String Now, how is Hugs or GHCi supposed t

Re: [Haskell-cafe] Beginner question

2009-01-02 Thread Colin Paul Adams
> "Benjamin" == Benjamin Bach writes: Benjamin> Supposing I have the following code: >> module Main(main) where main = putStr (show []) Benjamin> I will get these errors from GHC and Hugs respectively: >> Main.hs:2:16: Ambiguous type variable `a' in the constraint: >> `S

[Haskell-cafe] Beginner question

2009-01-02 Thread Benjamin Bach
Supposing I have the following code: > module Main(main) where > main = putStr (show []) I will get these errors from GHC and Hugs respectively: > Main.hs:2:16: > Ambiguous type variable `a' in the constraint: > `Show a' arising from a use of `show' at Main.hs:2:16-22 > Probabl

Re: [Haskell-cafe] beginner question re example in Hutton's "Programming in Haskell"y

2007-02-23 Thread Stefan O'Rear
On Fri, Feb 23, 2007 at 11:18:46PM -0500, David Cabana wrote: > I have been trying to work through Graham Hutton's "Programming in > Haskell", but have hit something of a snag in chapter 8.4. Hutton > presents some sample code which I am trying to run, with no luck so > far. Here is the code

[Haskell-cafe] beginner question re example in Hutton's "Programming in Haskell"

2007-02-23 Thread David Cabana
I have been trying to work through Graham Hutton's "Programming in Haskell", but have hit something of a snag in chapter 8.4. Hutton presents some sample code which I am trying to run, with no luck so far. Here is the code as I constructed it by gathering snippets presented across three pag

Re: [Haskell-cafe] Beginner Question

2007-02-10 Thread Rafael Almeida
On 2/9/07, vishy anand <[EMAIL PROTECTED]> wrote: I have just started on my journey in learning Haskell.I have started off reading wikibook,then will read yet another tutorial on haskell.Please guide me if I am on right track The book I used on my learning was "Haskell: the craft of functional

Re: [Haskell-cafe] Beginner Question

2007-02-09 Thread Yitzchak Gale
Hi Vishy, You wrote: I have just started on my journey in learning Haskell. Welcome aboard! We all wish you an enjoyable and (type)safe trip. I have started off reading wikibook, then will read yet another tutorial on haskell. Please guide me if I am on right track Those are both great tut

[Haskell-cafe] Beginner Question

2007-02-08 Thread vishy anand
I have just started on my journey in learning Haskell.I have started off reading wikibook,then will read yet another tutorial on haskell.Please guide me if I am on right track thks ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell

Re: [Haskell-cafe] beginner question - file handling

2006-03-05 Thread Neil Mitchell
Hi do x <- readFile "test.txt" print (length (lines x)) That prints out the number of lines in a file, but once you have done lines x, you can do anything you want to the lines Thanks Neil On 3/5/06, Richard Gooding <[EMAIL PROTECTED]> wrote: > Hi, > > can someone please point me at some

[Haskell-cafe] beginner question - file handling

2006-03-05 Thread Richard Gooding
Hi, can someone please point me at some code to read in the lines for a file - a working example ? I've have checked the tutorials on the wiki (some broken links) but couldn't find anything. - and my "The craft of functiional programming" doesn't have an example either ! thanks Rich __