Daniel Carrera <[EMAIL PROTECTED]> wrote in article <[EMAIL PROTECTED]> in
gmane.comp.lang.haskell.cafe:
> [EMAIL PROTECTED] wrote:
> > you may use a tuple?
> Hhhmm... I just tried it. It looks like Hugs doesn't like tuples with
> more than 5 elements. :-(
You can nest tuples. And that might be
On 5/7/05, Daniel Carrera <[EMAIL PROTECTED]> wrote:
>
> Stefan Monnier wrote:
> >>I have a lady friend who wants to learn how to program. She's a technical
> >>person, but has no math background to speak of. I can't decide whether to
> >>start with a clear-syntax imperative language (Ruby) or a f
On Sat, May 07, 2005 at 12:40:55PM -0400, Daniel Carrera wrote:
> In your opinion, do you think Haskell is appropriate for someone with
> zero math background? I can't imagine how I'd explain something like
> currying to someone who doesn't know math.
I'd think it'd be pretty easy for a non-math
Stefan Monnier wrote:
I have a lady friend who wants to learn how to program. She's a technical
person, but has no math background to speak of. I can't decide whether to
start with a clear-syntax imperative language (Ruby) or a functional
language (Haskell). I confess I've been leaning towards Ruby
> I have a lady friend who wants to learn how to program. She's a technical
> person, but has no math background to speak of. I can't decide whether to
> start with a clear-syntax imperative language (Ruby) or a functional
> language (Haskell). I confess I've been leaning towards Ruby.
In my limit
Max Vasin wrote:
So, you need list of length 256 and then just use it as state of your PRNG.
If you want to check list size you have to do it at runtime:
f lst | length lst == 256 -> doWork
| otherwise -> fail "length lst must be 256"
Okay, thanks.
Cheers,
Daniel.
Daniel Carrera <[EMAIL PROTECTED]> writes:
> Max Vasin wrote:
>
>> But why do you need that? Where do need to make an assumption about the size
>> of the list?
>
> I'm implementing the RC4 algorithm, which requires a state array with
> 256 elements containing the bytes from 0 to 255. As the algor
Max Vasin wrote:
But why do you need that? Where do need to make an assumption about the size
of the list?
I'm implementing the RC4 algorithm, which requires a state array with
256 elements containing the bytes from 0 to 255. As the algorithm
progresses, the elements of the array get shuffled ar
Daniel Carrera <[EMAIL PROTECTED]> writes:
> Hello,
>
> Right now I'm using type declarations like:
>
> f :: Int -> [Int]
>
> So f returns a list of Ints.
>
> Is there a way to tell Haskell that a list or array must have exactly
> (say) 256 elements? I'd love to have Haskell make sure that the arr