I'm trying to use the built-in ghc heap profiling and running into a
large roadblock: the names of producers are truncated, often into
uselessness, and there doesn't seem to be an option to control this.
Am I missing something in the docs?
Abe
___
On 6/7/05, Dimitry Golubovsky [EMAIL PROTECTED] wrote:
Gracjan Polak wrote:
val = readIORef
a=:b = writeIORef a b
Pretty shame := is already reserver :(. There is something alike
Graphics.Rendering.OpenGL.GL.StateVar. The use $= for assignment.
Generalizing variables (in respect to
Your first attempt didn't typecheck simply because
in return ()
means that the return value of the function is monadic, but you did
not declare as such.
In your second version, the type of shf is *not* a rank-2 type; it's
exactly the same type as shw. This can be expressed (with ghc
extensions)
Ghc can't assume in this context - the object file produced by
compilation could be linked into code that provides other instances.
Abe
On 5/31/05, Dinko Tenev [EMAIL PROTECTED] wrote:
On 5/31/05, robert dockins [EMAIL PROTECTED] wrote:
Dinko Tenev wrote:
First we observe that, g =
Suppose that a program using the Control.Concurrent.STM module had a
producer/consumer setup - one thread writing to a channel, the other
thread reading from the channel. It seems natural to want a function
that the producer can call that will block until the consumer has
finished consuming
You mean, if the data type being defined doesn't actually use the
generality of GADTs, allow GADT syntax, and deriving() too?
Yes, that would be very nice for the HaskellDemo and new users.
I'd definitely switch all of my non-GADT datatypes to use that.
One worry I have about this is that
It's not a constant; see, for example, System.Environment.withArgs
(http://www.haskell.org/ghc/docs/latest/html/libraries/base/System.Environment.html#v%3AwithArgs).
Abe
On Mon, 17 Jan 2005 16:23:17 -0500, Jim Apple [EMAIL PROTECTED] wrote:
See subject. It seems that it would be constant
Please! I've lost count of the number of times when I've written code as
f :: a - b
f (x :: a) = ...
wishing that I didn't have to locally bind the 'a'.
I'm not sure I understand the objection raised by Jon; the 'implicit
declaration' of type variables in type signatures has never bothered
me,
If finalizers are not the right thing, what else is?
I've found that when writing an interface to a C library that requires
resource management, it's much better to use the withX (see
Control.Exception.bracket) style of function than to use finalizers -
programs are much easier to reason about
You can use exisential types to do what you'd like. From memory, so
there are probably errors:
newtype ServerCommand = forall a. ServerCommandClass a = ServerCommand a
instance ServerCommandClass ServerCommand where
toString (ServerCommand c) = toString c
commands :: [ServerCommand]
I'm not sure if this is an actual bug, as opposed to an odd instance
of defaulting:
*GUI.Parser let printQ q = runQ q = print
*GUI.Parser :t printQ
printQ :: forall a. (Show a) = Q a - IO ()
*GUI.Parser let p = printQ
*GUI.Parser :t p
p :: Q Integer - IO ()
...but I'm not sure when that would
FWIW, I couldn't reproduce this problem on my system (i.e. str_test
always printed 1). GHC 6.2.1, libgmp 4.1.3, debian unstable
Abe
On Mon, 9 Aug 2004 17:57:14 +0200, Remi Turk [EMAIL PROTECTED] wrote:
On Sun, Aug 08, 2004 at 07:34:04AM -0700, Sigbjorn Finne wrote:
Hi,
please be aware
I briefly skimmed the paper mentioned in a recent mailing on the
ghc-users list that describes generalised algebraic data types
(http://research.microsoft.com/Users/simonpj/papers/gadt/index.htm);
my reaction can be summed up as nifty!.
I was curious to see if I could implement anything similar
I have a system composed of threads communicating via channels; I'd
like the communicated types to be instances of a particular typeclass
(say Show for purposes of discussion), but not all the same type.
Since Chan is paramterized by the communicated datatype, the best way
I've found to do this
Is there any way to use --make but provide paths to search for .hi files,
*not* .hs files? For example, if a library doesn't use ghc's package
system, and is distributed in precompiled form, there doesn't seem to
currently be a way to point ghc at the import files when using --make - it
always
I've been frustrated by the same lack of instances; as a stopgap, here's
one for a three-tuple. The pattern is pretty clear and can easily be
extended to whatever size you'd like.
tupCon = mkConstr 1 (,,) Prefix
instance (Data a, Data b, Data c) = Data (a, b ,c) where
gfoldl k z (a, b, c) =
I think that this is a problem that can be solved with a simple convention
change, rather than a language extension - instead of appending type
names, I think it would be much better if modules simply used the short,
convenient, common names and expected the user to import them qualified
where
I'm in the process of trying to write generic binary serialization code
using the Scrap Your Boilerplate method. One bump I've run into is that
there are no instances of Data provided for the extended set of numeric
types (the stuff in Data.Word, etc.) and it seems to be impossible to
hand-write
If I compile my program with -O or -O2, I get the following:
[EMAIL PROTECTED]:~/local/tla/genome/src/test] $ ghc -O -package genome -o test
test.hs
ghc-6.2: panic! (the `impossible' happened, GHC version 6.2):
simplCore/Simplify.lhs:1538: Non-exhaustive patterns in function
bind_args
I've occasionally wanted some sort of equivalent of an instanceOf function
in haskell, i.e. one that would let me define a function that could
dispatch on the type of its argument as well as the value. One option
I've seen for this is
http://okmij.org/ftp/Haskell/class-based-dispatch.lhs;, but
The classic way to write a lift function for tuples is, of course:
liftTup f (a, b) = (f a, f b)
which has a type of (a - b) - (a, a) - (b, b). I've been wondering if
it would be possible to write a function that doesn't require the types in
the tuple to be the same, just that the types in the
While while can be implemented in haskell, I would strongly suggest you
look at using the many higher-order functions available (foldl/foldr, map,
filter, etc.) - they're much more in line with the spirit of the language,
and will lend themselves to much clearer expressions once you get the hang
Attribute is a library for storing and retrieving named values from
haskell datatypes in arbitrary monads.
Many of the haskell GUI libraries have implemented something similar; in
one of my current projects, I discovered that such a thing would be
useful. However, I didn't want to tie it to my
I apologize for the frequency, but based on initial feedback I made some
interface-breaking changes and thought it wise to release. The major
changes are:
* use functions instead of a datatype for Property construction. From the
user's point of view, this just means the colon goes at the end
The haskell bindings for cairo have reached 0.3, which is enough of a
milestone to warrant this post, I think. Main improvements include:
* better (i.e. more Haskellish) wrappers for the Matrix functions
* better status handling - status is now checked automatically, and errors
reported properly.
Just for fun, I decided to run valgrind on the empty program, i.e. main
= return (), compiled with ghc 6.0.1. Much to my surprise, it found an
error:
==21117== Source and destination overlap in strcpy(0xbc02, 0xbc04)
==21117==at 0x40021E99: strcpy (mac_replace_strmem.c:87)
==21117==
Is there any way to force collection of all unreachable data structures?
Abe
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Given your impending vacation, this might not be the best time to mention
it, but...
I can't seem to download any files for wxHaskell from sourceforge; this is
probably a misconfiguration on their part, but I thought it best to let
you know as well.
I have a function that takes, among other things, a (wrapped) generic
type, i.e. forall a. a. My function can possible produce an error
message; is there any way to set up the function so that if the type is an
instance of Show include the value along with the error message? I can't
think of
I'd like to make a haskell binding for a C++ library. Most of the tools
out there seem oriented towards c bindings, so it looks like I'll be
writing the FFI code generator myself. While I'm at it I figure I might
as well just make a general C++ binding tool. I've been thinking about
this, and
I'll answer my own question; I've got a much better implementation, along
with an HOpenGL-based frontend, at
http://ofb.net/~abe/hlife/hlife-0.1.tar.gz;. It uses a FiniteMap of 5x5
UArrays that are created and destroyed as needed; this gives it a good
balance of size (the grid is only bounded by
I'm implementing Conway's Life in Haskell; my basic implementation is
attached. Does anyone have suggestions for optimizations (or alternative
representations)? It's interesting to note that the difference between
this with no ghc optimization, -O, and -O2 is pretty striking; on my
computer,
In a project I'm working on, one data type I've defined is this:
data FilterIS = FilterIS { source :: (InputStream s) = s, filter ::
Filter }
which, to me, just means it holds any instance of the InputStream class
and a Filter value. Sure, says ghci, fine by me. However, if I try to do
Just to add my voice to the din...
I come from a c/c++/java background, and I taught myself haskell. The
layout rules were the part I had the least problem with. I'd prefer that
if any change is made it's one that adds options, not removes them. I'm
confused as to the source of the problem,
Vim can produce HTML from any source code it has highlighting rules for,
which includes Haskell. Dunno about the browser plugin, though.
Abe
On Wed, 13 Mar 2002, Robert Giegerich wrote:
Teachers in Haskell,
I often use Haskell demos in teaching algorithms. The problem is that this
does
35 matches
Mail list logo