Thanks for your help.
Are there other ways to implement a counter in Haskell?
Using a State monad?
If I use your example on :
test = let Node x l = enumeratedTree ( Node 'a' [undefined, Node 'b'
[]])
in tail l
GHCI answers
[Node (*** Exception: Prelude.undefined
A monadic counter imposes
On 16 March 2005 04:14, Ian Lynagh wrote:
An alpha build of ghc 6.4 quickly fails because of the
#if alpha_TARGET_ARCH
import PrimRep ( getPrimRepSize, isFloatingRep )
import Type ( typePrimRep )
#endif
in ghc/compiler/typecheck/TcForeign.lhs which no longer exist.
On Wed, Mar 16, 2005 at 10:51:08AM +0100, Nicolas Oury wrote:
Thanks for your help.
Are there other ways to implement a counter in Haskell?
Using a State monad?
If I use your example on :
test = let Node x l = enumeratedTree ( Node 'a' [undefined, Node 'b'
[]])
On Wed, Mar 16, 2005 at 01:17:51AM +0100, Nicolas Oury wrote:
* linear implicit parameters
instance Splittable Int where
split n = (2*n,2*n+1)
But I have a problem : the counter value increases exponentially. (I
can only count up to 32 elements...)
Is there another way to split Int?
Thanks, I've committed a version of your patch.
Cheers,
Simon
On 16 March 2005 04:07, Ian Lynagh wrote:
The Debian autobuilders don't let you write to ~ (which seems
reasonable, as they are only compiling the software, not running it),
so
my builds are failing with
--
On 15 March 2005 18:26, Sebastian Sylvan wrote:
Ah, that did it! However, some packages seem to be missing, like HGL
for instance.
rts-1.0, base-1.0, haskell98-1.0, template-haskell-1.0, unix-1.0,
Cabal-1.0, parsec-1.0, haskell-src-1.0, network-1.0,
QuickCheck-1.0, HUnit-1.1,
Le 16 mars 05, à 11:08, Tomasz Zielonka a écrit :
On Wed, Mar 16, 2005 at 01:17:51AM +0100, Nicolas Oury wrote:
* linear implicit parameters
instance Splittable Int where
split n = (2*n,2*n+1)
But I have a problem : the counter value increases exponentially. (I
can only count up to 32
On 2005-03-16 02:52:39 -0800, Nicolas Oury [EMAIL PROTECTED] said:
instance Splittable Integer where
split n = (2*n,2*n+1)
foo::(%x::Integer) = [a] - [(a,Integer)]
foo [] = []
foo (a:l) = (a,%x):(foo l)
test = let %x = 1 in foo [1..15000]
But, in this example, the numbering is linear and so
On Wed, Mar 16, 2005 at 10:51:08AM +0100, Nicolas Oury wrote:
A monadic counter imposes an order of evaluation.
In my program, I don't care about the order of the numbers.
I only want them to be all different.
I think a monad is too restrictive for what I need.
This is a common misconception,