bos/statistics — Issue #22: Sometimes functions are not inlined
Author: Shimuuar
Created: 2011-12-19 09:28:57+00:00
State: open

Sometimes functions in the `Statistics.Sample` are not inlined and GHC just uses generic version which leads to considerable slowdown. AFAIK function gets inlined only if fully saturated as declared.

```
variance xs = ...

some_function variance -- Variance won't be inlined there
```

There are two possible ways to deal with it. First is to declare functions with zero arguments using pointfree style or with lambdas `variance = \x → ...`. Another is to add SPECIALIZE pragmas to get efficient versions for different types of vectors.

I'm not sure how does it affect real world code but benchmark suite is affected badly.