ertes 2017-01-30 15:45:50
dfeuer: while working on your reimplementation you can check the result of 'rc4' against the test vectors here: https://tools.ietf.org/html/rfc6229
dfeuer 2017-01-30 15:48:36
ertes: oh,does that RFC have a table somewhere?
dfeuer 2017-01-30 15:48:53
Oh, lots.
dfeuer 2017-01-30 15:49:14
ertes: what lazy ST features do you rely on here?
ertes 2017-01-30 15:49:35
dfeuer: MonadFix, strictToLazyST
ertes 2017-01-30 15:49:45
and STRef
ertes 2017-01-30 15:50:24
and laziness of course… this code will not work with strict ST
dfeuer 2017-01-30 15:50:58
Oh, good.
dfeuer 2017-01-30 15:51:01
:D
ertes 2017-01-30 15:52:44
it's a neat way to express RC4, too, but i needed the laziness of STArray, so it's not very efficient =)
ertes 2017-01-30 15:52:57
it doesn't work with STUArray
ertes 2017-01-30 15:53:46
if you replace all usages of 'updateArray2' by 'updateArray1', it will at least type-check, but will diverge at run-time with STUArray
dfeuer 2017-01-30 15:56:49
Thanks, ertes. I'll add that test to the list.
lambdafan 2017-01-30 16:18:31
I'm looking for a struct that has two operations, fromList and pop. Has such a thing been made?
lambdafan 2017-01-30 16:18:46
um stack, not struct
pikajude 2017-01-30 16:19:02
i forget. is pop the front or the back
lambdafan 2017-01-30 16:19:07
pop is front
lambdafan 2017-01-30 16:19:18
if it emtpy return Empty value
Koterpillar 2017-01-30 16:19:18
isn't that a newtype on []?
pikajude 2017-01-30 16:19:25
fromList = id; pop (x:xs) = (Just x, xs); pop [] = (Nothing, [])
lambdafan 2017-01-30 16:19:30
yeah it could be, I'm wondering if someone has done better
Axman6 2017-01-30 16:35:41
lambdafan: pikajude just did it for you =)
Axman6 2017-01-30 16:35:54
Haskell lists are essentially stacks
Koterpillar 2017-01-30 16:36:17
well, you _could_ try doing better by using a vector to reduce allocations
Koterpillar 2017-01-30 16:36:40
actualy, since your only operation is pop... I don't think so
orzo 2017-01-30 16:37:24
you could add rle compression
nshepperd 2017-01-30 16:39:59
unboxed vector could conceivably help if Vector.fromList fuses with whatever source you're using, /and/ you need the values to hang around for a while
nshepperd 2017-01-30 16:40:11
but nah