I have a question about the Main.main naming convention. Would it be a
good idea to lift the restriction and allow any module which exports a
function main :: IO () to be compiled into a separate binary?
You'd need to specify which module should be the top-level module when
compiling, of course.
FINAL CALL FOR PAPERS
TLDI'03
The ACM SIGPLAN Workshop on
Types in Language Design and Implementation
(Formerly called TIC, The International Workshop on Types in Compilation)
I have a question about the Main.main naming convention. Would it be a
good idea to lift the restriction and allow any module which exports a
function main :: IO () to be compiled into a separate binary?
You'd need to specify which module should be the top-level module when
compiling, of course.
| In 7.1, the Report says of getChar, getContents and friends:
|
| "By default, these input functions echo to standard output."
|
| This would mean that the example given:
|
| main = interact (filter isAscii)
|
| would print the input with all ASCII characters duplicated.
|
| Sur
Folks
As you know, the Haskell Report (both language and libraries) is going
to be published by CUP, both as a special issue of the Journal of
Functional Programming (13.1) and as a book.
I have to deliver the final copy by the end of the month. So the gate
really is closing. In a few days I'l
Simon Peyton-Jones wrote:
> | In 7.1, the Report says of getChar, getContents and friends:
> |
> | "By default, these input functions echo to standard output."
> |
> | This would mean that the example given:
> |
> | main = interact (filter isAscii)
> |
> | would print the input with
| No. A terminal device may echo or it may not. Even if the run-time
| explicitly enables echoing, there is no guarantee that it won't
| subsequently be disabled.
|
| Certainly, the existing statement is wrong, though.
Well, the question is what the report should say. The minimal change is
to d
I have two typeclasses, Foo and Bar, with some instances, defined as such:
module Test where
class Foo a where
foo :: a -> String
class Bar a where
bar :: a -> String
instance Foo Int where
foo = show
instance Bar Int where
bar a = (show a) ++ " bar!"
instance Foo Char where
foo =
Hi,
> thing. However, the warnings (and the names of the flags - "undecidable
> instances" doesn't sound good) make me nervous, and confused. Why is
> there a problem with saying "every instance of Foo is also an instance of
> Bar, and here's how"?
>From what I understand, this is basically on
[snip]
> instance Foo Int where
> foo = show
>
> instance Bar Int where
> bar a = (show a) ++ " bar!"
>
> instance Foo Char where
> foo = show
>
> instance Foo a => Bar a where
> bar = foo
Notice: this last instance derives another instance of Bar Int, etc.
> If I try to compile this
I downloaded and installed (apparently successfully) the binaries for Mac OS
X under 10.1.5. When I try to execute from a terminal window (what's the
difference between 'hugs' and 'runhugs"?), I get the error message "can't
open library: /usr/lib/libncurses.5.dylib". Indeed, there is no such libra
Arthur Fleck wrote:
> I downloaded and installed (apparently successfully) the binaries for
> Mac OS
> X under 10.1.5. When I try to execute from a terminal window (what's
> the
> difference between 'hugs' and 'runhugs"?), I get the error message
> "can't
> open library: /usr/lib/libncurses.5.
Martin Norbäck <[EMAIL PROTECTED]> wrote,
> I have a question about the Main.main naming convention. Would it be a
> good idea to lift the restriction and allow any module which exports a
> function main :: IO () to be compiled into a separate binary?
>
> You'd need to specify which module shoul
I know I wasn't the intended recipient of this question, but I also lament
this, so I'll answer for myself.
> So? That just means that the file name of Program1.hs,
> Program2.hs, etc will be different from the name of the
> module that they contain.
The problem is that often you'll have a li
Hello.
Can anyone help me writing a parser for parsing a simplified
list of ABC fields (http://www.gre.ac.uk/~c.walshaw/abc/).
The grammar I want to test with is the following
--
file ::= *field
field ::= fieldA | fieldB
fieldA ::= "A:" text endOfLine
fieldB ::= "B:" text end
Suppose I have a labelled type 'A' defined like the following one:
module Test (
A (b)
)
where
data A = A
{ b :: Int,
c :: Int
}
I am exporting only 'A(b)', so why the following code "can see" 'c' ?
module Main where
import Test
main :: IO ()
main = print (c (A {c=3,b=2}))
PROMPT> 3
16 matches
Mail list logo