According to the documentation for System.Random (see http://
haskell.org/ghc/docs/latest/html/libraries/base/System-Random.html):
In addition, read may be used to map an arbitrary string (not
necessarily one produced by show) onto a value of type StdGen. In
general, the read instance of
| Perhaps A section of the wiki is in order that lists the most recent
| paper that describes various parts of what is actually used in the
| production ghc.
|
| perhaps something like
|
| type checker : boxy types and impredicativity paper + Wobbly type GADT
| inference paper
|
Sorry if this question is too basic, but I am trying to learn Haskell
and from tiem to time I get stuck. (And forgive me, I haev a heavy
procedural background, so functional programming is hard for me)
I am trying to use 'read' to create a random generator, applying it on
some text. As the
Hello John,
Tuesday, March 13, 2007, 3:21:46 AM, you wrote:
garbage collector: non-stop collection for haskell paper
this is not implemented and btw exists as one of haskell SoC tasks.
implemented only *multithreading* for old GC
--
Best regards,
Bulat
This does seem to be a bug; see:
http://www.haskell.org/pipermail/libraries/2007-March/007034.html
(from a few minutes ago)
Cheers,
Kirsten
--
Kirsten Chevalier* [EMAIL PROTECTED] *Often in error, never in doubt
and the things I'm working on are invisible to everyone--Meg Hutchinson
Hello all,
the following program changes behavior if translated using different
options for ghc compiler. Is this correct or not? I used The Glorious
Glasgow Haskell Compilation System, version 6.6. And I would expect in
both cases behavior 1.
But I may be wrong...
Thanks for any
Bulat Ziganshin wrote:
Hello Simon,
Friday, March 9, 2007, 7:44:46 PM, you wrote:
Looking at the implementation of DiffArrays, there are some obvious
optimisations that aren't done.
and don't forget that it uses MVar instead of IORef to be
thread-safe
I don't see any obvious
Neil Mitchell wrote:
I suggest you try rewriting this program to be complete:
http://darcs.haskell.org/nofib/imaginary/digits-of-e2/Main.lhs
(if you do, please post the result to the list)
As Gen Zhang noted, the problem seems to be quite straightforward:
just express in types the fact
Hi
-- There are no pattern-matching failures here.
-- The totality is harder to see: all digits are roughly of the same range,
-- but each recursive call increments base. Eventually, base becomes bigger
-- than d+9 and so the first alternative will be selected, which is in the
-- WHNF and so
Hello Simon,
Tuesday, March 13, 2007, 1:00:46 PM, you wrote:
Looking at the implementation of DiffArrays, there are some obvious
and don't forget that it uses MVar instead of IORef to be
I don't see any obvious optimisations there - some kind of thread-safety is
essential.
for general
John Goerzen wrote:
On 2007-03-06, Simon Marlow [EMAIL PROTECTED] wrote:
John Goerzen wrote:
possible to create a pipe going directly from program A to program B.
You certainly can pipe directly from one process to another:
That only works for 2 processes. What if I have 4 processes, and
Looking at the implementation of DiffArrays, there are some obvious
optimisations that aren't done.
and don't forget that it uses MVar instead of IORef to be thread-safe
I don't see any obvious optimisations there - some kind of thread-safety is
essential. We could try IORef and
On Tue, 13 Mar 2007 10:17:05 +
Neil Mitchell [EMAIL PROTECTED] wrote:
Hi
-- There are no pattern-matching failures here.
-- The totality is harder to see: all digits are roughly of the
same range, -- but each recursive call increments base. Eventually,
base becomes bigger -- than
Hello Claus,
Tuesday, March 13, 2007, 2:10:49 PM, you wrote:
how big is the impact of those MVars anyway, compared to a version that
wouldn't
have to worry about threads?
on my 1GHz cpu, withMVar locking makes 2*10^6 cycles/sec, compared
with 10-100x faster IORef operation
--
Best
I have updated the darcs repository and the hackage repository to have
regex-base-0.91
Changes:
GHC uses late instance overlap detection, whereas Hugs demands no potential
overlap. Thus Hugs rejected some of the polymorphic results for matching given
by RegexContext instances.
The solution
Dusan Kolar wrote:
Hello all,
the following program changes behavior if translated using different
options for ghc compiler. Is this correct or not? I used The Glorious
Glasgow Haskell Compilation System, version 6.6. And I would expect in
both cases behavior 1.
But I may be wrong...
On 13/03/07, Wolfgang Jeltsch [EMAIL PROTECTED] wrote:
Am Montag, 12. März 2007 03:52 schrieb Donald Bruce Stewart:
* [41]Why Publish CS Papers Without Code?
41. http://billmill.org/why_no_code
Interesting!
This leads me to the question how copyright of code fragments included in
Hi
Note: Total = total ignoring non-termination, for this post
Surely we can assume them total given that base is never zero?
They are not total, they are called in a manner which does not cause
them to raise an error. If you want every function to be total, you
need to fix div.
If you are
Quoth Conrad Parker, nevermore,
Besides, tshirtIf it's not open source, it's not computer
science/tshirt. Science demands repeatable results, computer science
demands literate programming. The solution is not to shy away from
including code, or else the IP lawyers have won, science is banned
On Tue, 2007-03-13 at 00:47 -0400, Albert Y. C. Lai wrote:
Hans van Thiel wrote:
sequence :: Monad m = [m a] - m [a]
You write:
The = used by sequence is the same = in the MyState monad,
since you instantiate m to MyState String. Therefore, sequence
performs all the state
On Tue, Mar 13, 2007 at 10:51:47AM +, Simon Marlow wrote:
Before I answer the question, if you don't mind I'll quote from my own
message:
[ snip ]
So ideally we'd have a version of runInteractiveProcess that didn't create
all three pipes, and then it would be easy to program your
On Tue, 13 Mar 2007 00:37:46 -0700, Fritz Ruehr
[EMAIL PROTECTED] wrote:
According to the documentation for System.Random (see http://
haskell.org/ghc/docs/latest/html/libraries/base/System-Random.html):
In addition, read may be used to map an arbitrary string (not
necessarily one produced
Hello,
I've noticed that the summer of code tickets contain one item:
lightweight web framework. I've dropped out university one year ago.
So I can't participate, right?
Do you want to explore with me how this might be done propably using
HAppS or fastcgi ?
I just need another person to talk to
I just noticed some unexpected consequences of the way newtype deriving
is implemented in GHC. Because the dictionary of the underlying type is
reused, so are base classes. This message is a literate Haskell program
illustrating the problem.
{-# OPTIONS_GHC -fglasgow-exts #-}
This problem
Hello all,
I'm googling around haskell.org to get some deeper knowledge about
Control.Parallel.Strategies than it is presented on
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Parallel-Strategies.html
BTW, could someone point me to some more deeper doc. about it?
Simon will probably chime in on it as well, but his paper on the subject is
the best there is:
http://research.microsoft.com/~simonpj/Papers/strategies.ps.gz
If you have questions about the paper, I'd be happy to help, too. I worked
through it myself fairly recently.
-- Jeff
On Tuesday 13
| I just noticed some unexpected consequences of the way newtype deriving
| is implemented in GHC. Because the dictionary of the underlying type is
| reused, so are base classes. This message is a literate Haskell program
| illustrating the problem.
Excellent point.
| As a solution I would
On 13/03/2007, at 17:46, Jefferson Heard wrote:
Simon will probably chime in on it as well, but his paper on the
subject is
the best there is:
http://research.microsoft.com/~simonpj/Papers/strategies.ps.gz
It does work in GHC 6.6 very nicely.
You can try it with the following naive fib
Yes, it works for operator /par/. That's what I've reported. But should
it work for forkIO and forkOS? Could anybody give more detailed answer
than yes, no? :-) (Link to the Web is OK.)
BTW, thanks for the link to the paper (moreover, I can see, that
googling over haskell.org is not
Excuse me, I read too quick.
It works for forkIO too, although I'm not sure about forkOS. I don't
have a demo around, but you can verify with the concurrency demos in
the wiki:
http://haskell.org/haskellwiki/Concurrency_demos/Zeta
If it doesn't work, perhaps you are in an unsupported
forkOS should work as well, assuming you have OS threads, like in linux 2.6.
You should probably be using the -smp compiler flag and not the -threaded
compiler flag, I'm guessing, and make sure that your +RTS arguments indicate
that you want to use X total concurrent threads...
-- Jeff
On
It seems like we could refine the first parameter of carryPropagate
just as the second: make an= type N1 that only admits values [1..].
Would not that suffice to prove that base is never 0 and not have to
go beyond the type-checker for a proof?
On 3/13/07, Neil Mitchell [EMAIL PROTECTED] wrote:
Hi Nicolas,
It seems like we could refine the first parameter of carryPropagate
just as the second: make an= type N1 that only admits values [1..].
How?
newtype N1 = N1 Int
(put that in a module and don't export N1)
define the constant 2, define the increment operator, change div and mod.
On Mon, Mar 12, 2007 at 05:14:57PM -0500, John Goerzen wrote:
On 2007-03-06, Simon Marlow [EMAIL PROTECTED] wrote:
John Goerzen wrote:
possible to create a pipe going directly from program A to program B.
You certainly can pipe directly from one process to another:
That only works for
Hello Jefferson,
Tuesday, March 13, 2007, 9:06:31 PM, you wrote:
forkOS should work as well, assuming you have OS threads, like in linux 2.6.
You should probably be using the -smp compiler flag and not the -threaded
compiler flag, I'm guessing, and make sure that your +RTS arguments indicate
Call for Papers
ICFP 2007: International Conference on Functional Programming
Freiburg, Germany, 1-3 October 2007
Important Dates
~~~
Submission:11:00 6 April 2007, Samoa time (AST)
Author response: 11:00 23 May to 11:00 25
Arithmetic operators in haskell appear to require their operands to
have the same type. How can I do arithmetic between operands of
different types?
Alternatively, how do I coerce a value from being an Int to being a Double?
I am new to haskell. I have read a few tutorials but they do not
Hi
Arithmetic operators in haskell appear to require their operands to
have the same type. How can I do arithmetic between operands of
different types?
You probably don't want to.
Alternatively, how do I coerce a value from being an Int to being a Double?
You ask Hoogle:
On Tue, 13 Mar 2007 21:41:00 +0100, Dave Hinton [EMAIL PROTECTED]
wrote:
how do I coerce a value from being an Int to being a Double?
calc :: Int - Double - Double
calc count weight = count * weight
Use:
calc count weight = fromIntegral count * weight
If you want an Int result, use:
Dave Hinton wrote:
Arithmetic operators in haskell appear to require their operands to
have the same type. How can I do arithmetic between operands of
different types?
Alternatively, how do I coerce a value from being an Int to being a Double?
fromIntegral can do this coercion. It is more
ithika:
Quoth Conrad Parker, nevermore,
Besides, tshirtIf it's not open source, it's not computer
science/tshirt. Science demands repeatable results, computer science
demands literate programming. The solution is not to shy away from
including code, or else the IP lawyers have won,
I'm trying to use c2hs but get stuck when including sys/types.h (though
the problem really resides in pthreadtypes.h):
% ./Setup.hs build -v
Preprocessing executables for kowasu-0.1...
/usr/bin/c2hs -C -D__GLASGOW_HASKELL__=606 -C -Icsrc -o src/Kowasu/PTrace.hs
src/Kowasu/PTrace.chs
c2hs:
magnus:
I'm trying to use c2hs but get stuck when including sys/types.h (though
the problem really resides in pthreadtypes.h):
% ./Setup.hs build -v
Preprocessing executables for kowasu-0.1...
/usr/bin/c2hs -C -D__GLASGOW_HASKELL__=606 -C -Icsrc -o src/Kowasu/PTrace.hs
Magnus Therning wrote:
I'm trying to use c2hs but get stuck when including sys/types.h (though
the problem really resides in pthreadtypes.h):
/usr/include/bits/pthreadtypes.h:69: (column 6) [FATAL]
Syntax error!
The symbol `;' does not fit here.
65 __extension__ union
66
On Tue, Mar 13, 2007 at 09:41:47PM +0300, Bulat Ziganshin wrote:
Tuesday, March 13, 2007, 9:06:31 PM, you wrote:
forkOS should work as well, assuming you have OS threads, like in linux 2.6.
You should probably be using the -smp compiler flag and not the -threaded
compiler flag, I'm
This isn't just a question about Haskell. It applies to any language
with an exception mechanism, including C++ and Java. Even C (segv is
an exception mechanism...)
The question is really how to communicate failure to the caller, in a
way the caller can not ignore, without unduely inconvienencing
One of my editors at somepoint, told me that he had asked his lawyers
about this (i.e. don't think this is anything like real legal advice),
and the answer was 'If you publish an article and advise someone that
the way to do something is X, no judge will be happy if you sue them
for taking your
Hi.
I'm experimenting with implementing database transactions as monads but I'm
getting stuck on how to store a generic connection (only constrained by a
typeclass) inside the transaction. The reason I'm doing it this way is that
the connection could be a different kind of structure depending
On Wed, 2007-03-14 at 09:56 +1100, Donald Bruce Stewart wrote:
magnus:
I'm trying to use c2hs but get stuck when including sys/types.h (though
the problem really resides in pthreadtypes.h):
% ./Setup.hs build -v
Preprocessing executables for kowasu-0.1...
/usr/bin/c2hs -C
John Fouhy wrote:
In Haskell, I envisage writing something like:
data ThingCompare = TC Op Field
This wants to be a bit more concrete:
data ThingCompare = TC (a - a - Bool) (Thing - a)
so that you could then have something to execute your comparison thingy:
runTC :: ThingCompare - Thing -
On 14/03/07, Bryan O'Sullivan [EMAIL PROTECTED] wrote:
John Fouhy wrote:
In Haskell, I envisage writing something like:
data ThingCompare = TC Op Field
This wants to be a bit more concrete:
data ThingCompare = TC (a - a - Bool) (Thing - a)
Hi Bryan,
I actually had to write:
data
Neil Mitchell wrote:
newtype N1 = N1 Int
(put that in a module and don't export N1)
define the constant 2, define the increment operator, change div and mod.
That is precisely what I would have done.
Now we've mainly got a proof in the type checker, but we still don't
actually have a
I have the pleasure of porting a good sized Haskell application to linux.
So far the Haskell code has compiled without incident, however some code
that I hacked
to implement a Read instance for Unboxed Arrays does not compile on linux
even though it compiles just fine on Windows XP in Haskell
On 14/03/07, Bryan O'Sullivan [EMAIL PROTECTED] wrote:
This wants to be a bit more concrete:
data ThingCompare = TC (a - a - Bool) (Thing - a)
so that you could then have something to execute your comparison thingy:
runTC :: ThingCompare - Thing - Thing - Bool
runTC (TC compare extract) a b =
Adde:
data TransactionT = forall c. (Connection c) = TransactionT c
data Transaction a = Transaction (TransactionT - (a, TransactionT))
getConnection :: Transaction c
getConnection = Transaction (\t@(TransactionT c) - (c, t))
class Connection c where
connectionExecute :: c - String -
It looks like you forgot to pass a compiler flag, namely -fglasgow-exts.
Cheers,
Spencer Janssen
On Tue, 13 Mar 2007 22:20:20 -0700 (PDT)
SevenThunders [EMAIL PROTECTED] wrote:
I have the pleasure of porting a good sized Haskell application to
linux. So far the Haskell code has compiled
John Fouhy:
But if I want to combine tcEqOne and tcGtThree I run into type
problems, because one of them uses Strings and the other Integers. I
want to break the type dependence between the arguments of And; can
I do this?
Try this. You'll also need to change ThingCompare a to ThingCompare
I said:
Try this. You'll also need to change ThingCompare a to ThingCompare
in all your function type signatures.
data ThingCompare
= forall a. TC (BooleanOp a) (Field a)
| And ThingCompare ThingCompare
| Or ThingCompare ThingCompare
Sorry. For that to work, you would need
58 matches
Mail list logo