On May 16, 2007, at 0:57 , Adrian Hey wrote:
-- GT class --
class Ord key => GT map key | map -> key where
assocsAscending :: map a -> [(key,a)] -- Just 1 of many methods
-- Instances of GT are instances of Eq --
Instances of Ord are instances of Eq, so defining your own instance
Eq for a
Hello,
Here's a simple module I'm playing about with..
{-# OPTIONS_GHC -fglasgow-exts #-}
module Test(GT(..)) where
-- GT class --
class Ord key => GT map key | map -> key where
assocsAscending :: map a -> [(key,a)] -- Just 1 of many methods
-- Instances of GT are instances of Eq --
instance
On May 16, 2007, at 0:37 , Stefan O'Rear wrote:
On Tue, May 15, 2007 at 11:35:52PM -0500, Rob Hoelz wrote:
I've poured over the standard library docs, but to no avail. Could
someone give me a hint?
fromIntegral
No instance for (Integral CTime)
arising from a use of `fromIntegral
On May 16, 2007, at 0:35 , Rob Hoelz wrote:
wrapping returns time_t. I see that this maps to CTime in
Foreign.C.Types, but I can't figure out how to convert it to an Int
(or
any other useful Haskell type, for that matter) for the life of me.
I've poured over the standard library docs, but t
On Tue, May 15, 2007 at 11:35:52PM -0500, Rob Hoelz wrote:
> Hello everyone,
>
> I'm writing an interface to C code, and one of the functions I'm
> wrapping returns time_t. I see that this maps to CTime in
> Foreign.C.Types, but I can't figure out how to convert it to an Int (or
> any other usefu
Hello everyone,
I'm writing an interface to C code, and one of the functions I'm
wrapping returns time_t. I see that this maps to CTime in
Foreign.C.Types, but I can't figure out how to convert it to an Int (or
any other useful Haskell type, for that matter) for the life of me.
I've poured over t
On Tue, May 15, 2007 at 07:44:25PM -0700, Stefan O'Rear wrote:
> λ(el : *). ∀(res : *). (∀(seed : *). seed → (seed → el) → (seed → seed) → res)
that little decoding error at the end should have been -> res. I need
a better unicode editing solution :)
Stefan
__
On Tue, May 15, 2007 at 10:28:08PM -0400, Scott Turner wrote:
> On 2007 May 13 Sunday 14:52, Benja Fallenstein wrote:
> > 2007/5/12, Derek Elkins <[EMAIL PROTECTED]>:
> > > In Haskell codata and data coincide, but if you want consistency, that
> > > cannot be the case.
> >
> > For fun and to see wh
On 2007 May 13 Sunday 14:52, Benja Fallenstein wrote:
> 2007/5/12, Derek Elkins <[EMAIL PROTECTED]>:
> > In Haskell codata and data coincide, but if you want consistency, that
> > cannot be the case.
>
> For fun and to see what you have to avoid, here's the proof of Curry's
> paradox, using weird i
try sticking a semicolon in there for good measure, sometimes ghc gets
confused
On 5/15/07, Eric <[EMAIL PROTECTED]> wrote:
Hi there,
I've written the following program
putchr = putChar ?d
main = do
{ c <- getChar
; putchr with ?d = c}
which I try to compile with
ghc --make -fimplicit-para
On May 15, 2007, at 14:52 , Tomasz Zielonka wrote:
On Tue, May 15, 2007 at 02:27:13PM +0200, Arie Peterson wrote:
Hi Tomek!
Hi!
Have you considered changing the statements to have type 'ReaderT
Database
IO ()'? Then (>>) actually does what you want.
I tried it and it made the code simp
apfelmus wrote:
Dirk Kleeblatt wrote:
apfelmus wrote:
[...]
So, yes, the code position is only used after the definition of the
label. But the "look up in a map"-part makes the jmp operation strict in
the label parameter.
Ah, I slowly get what you mean. In short, the point is that you're
rei
Hi there,
I've written the following program
putchr = putChar ?d
main = do
{ c <- getChar
; putchr with ?d = c}
which I try to compile with
ghc --make -fimplicit-params myprogram
However I keep getting the following error:
myprogram.hs:5:17: parse error on input `='
What's wrong?
E.
__
Eric wrote:
Hello all,
Does anyone have some sample code for reading and writing to binary
files?
openBinaryFile is a bit of a red herring. All it does is disable the
line-ending interpretation which may or may not happen on some OSes when
you open a file in text mode.
For simple binary
Hello all,
Does anyone have some sample code for reading and writing to binary files?
E.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hello Cafe!
I asked about this problem on IRC channel but with little luck.
The problem boils down to the following: readline crashes on any input
if the calling program runs in the Emacs buffer. To reproduce this bug,
load the code below into ghci using haskell-mode and run main.
>import Sys
You could also use mappend instead of concatStmts and keep the Database ->
IO () representation.- Conal
On 5/15/07, Arie Peterson <[EMAIL PROTECTED]> wrote:
Hi Tomek!
> In a CGI application I was gathering SQL statements I wanted to run in
> the final transaction. Because I use haskelldb,
Hi Simon,
On 15/05/2007, at 8:31 PM, Simon Marlow wrote:
There is no guarantee that a finalizer will be run before your
program exits. The only thing you can be sure of is that it will
*not* run while the ForeignPtr is still reachable by the garbage
collector. In practice GHC will schedul
On Tue, May 15, 2007 at 02:27:13PM +0200, Arie Peterson wrote:
> Hi Tomek!
Hi!
> Have you considered changing the statements to have type 'ReaderT Database
> IO ()'? Then (>>) actually does what you want.
I tried it and it made the code simpler, more readable and of course
more immune to this ty
Hi Tomek!
> In a CGI application I was gathering SQL statements I wanted to run in
> the final transaction. Because I use haskelldb, it was most convenient
> to use (Database -> IO ()) as the type of the statement or a group of
> statements. In this representation concatenating two statement grou
Ivan Tomac wrote:
It appears that if I add
import Control.Concurrent
and call yield just after performGC then the finalizer does get called.
But it only seems to work if I call both performGC and yield and in that
order.
There is no guarantee that a finalizer will be run before your program
On Tue, May 15, 2007 at 11:15:20AM +0100, Jules Bean wrote:
> Tomasz Zielonka wrote:
> >My mistake was that I forgot about db and wrote:
> >
> >concatStmts s1 s2 = s1 >> s2
> >
> >And it was accepted because I had the Monad instance for ((->) r) in
> >scope (from Control.Monad.Trans I guess)!
>
Tomasz Zielonka wrote:
My mistake was that I forgot about db and wrote:
concatStmts s1 s2 = s1 >> s2
And it was accepted because I had the Monad instance for ((->) r) in
scope (from Control.Monad.Trans I guess)!
The danger in overloading is that you are relying on the compiler to
infe
Hello!
In a CGI application I was gathering SQL statements I wanted to run in
the final transaction. Because I use haskelldb, it was most convenient
to use (Database -> IO ()) as the type of the statement or a group of
statements. In this representation concatenating two statement groups so
they a
Christopher L Conway wrote:
I've installed 2.3 and it exhibits the same indentation behavior: any
entity appearing on a new line immediately after "module X where"
wants to be indented 4 spaces, including function definitions and
variable bindings.
Yes, it does do that. And it's correct syntax
25 matches
Mail list logo