In my attempt to implement this, I stumbled over this weir behaviour:

```
// drop the first i elements
left_drop(0, (x, xs)) = x, xs;
left_drop(i, (x, xs)) = left_drop(i-1, xs);
// works as expected
// process = left_drop(3, (1, 2, 3, 4, 5));


// reverse a list
reverse((x, xs)) = reverse(xs), x;
reverse(x) = x;
// works as expected
// process = reverse((1, 2, 3, 4, 5))
// >> 5, 4, 3, 2, 1
// towards right_drop


process = left_drop(3, reverse((1, 2, 3, 4, 5)));
// >> ERROR : pattern matching failed, no rule of case {(<x>,<xs>,<i>) => 
left_drop(xs,i,1 : -); (<x>,<xs>,0) => x,xs; } matches argument list (2,1) 
```

I have no clue what I am doing wrong here...

cheers
        Till

--
Till Bovermann

https://tai-studio.org | http://lfsaw.de | https://www.instagram.com/_lfsaw/











> On 13. Nov 2020, at 11:34, Till Bovermann <lf...@lfsaw.de> wrote:
> 
> Heya,
> 
> has anyone done a list-shuffle for faust yet?
> 
> something like:
>       https://rosettacode.org/wiki/Knuth_shuffle#Haskell
> 
> 
> cheers
>       Till
> 
> 
> --
> Till Bovermann
> 
> https://tai-studio.org | http://lfsaw.de | https://www.instagram.com/_lfsaw/
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Faudiostream-users mailing list
> Faudiostream-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users



_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to