Hello
Lets say I have a library in C with a header like this:
#include
/*really big structure*/
typedef struct {
int *a;
int *b;
/*lots of stuff
...
*/
int *z;
} foo;
/*this function allocate memory and fill the structure, reading from a
file*/
int create_foo(foo *f,FILE *file,int x,int y);
/
It looks like length . show is faster
Prelude Control.Arrow> let numDigits n = length $ show n
Prelude Control.Arrow> let digits = iterate (`div` 10) >>> takeWhile (>0)
>>> length
Prelude Control.Arrow> let n=2^100
Prelude Control.Arrow> :set +s
Prelude Control.Arrow> numDigits n
301030
(0.39
this appears to work:
alphabet=map (\x->x:[]) ['a'..'z']
series=alphabet++[x++y|x<-series,y<-alphabet]
On Tue, Jun 16, 2009 at 8:28 PM, GüŸnther Schmidt wrote:
> Hi guys,
>
> I'd like to generate an infinite list, like
>
> ["a", "b", "c" .. "z", "aa", "ab", "ac" .. "az", "ba", "bb", "bc" .. "bz"
look in System.Random
randomRIO :: (Random a) => (a, a) -> IO a
you can do
randomNumber<-randomRIO (1,30)
On Sun, Jun 7, 2009 at 3:33 PM, ptrash wrote:
>
> Hi,
>
> is the are way (or a build in method) in haskell to get a random number
> from
> a number bottom to a number top?
>
> Something li