[RFC] Sibyl: Time Series Analysis in Haskell
Thank you so much for your thoughtful feedback; the snippets I included above are simply models what I think it’ll (eventually) look like - Sibyl is nowhere close to being that convenient yet - but it has become standard dataHaskell notation (in dataframe, at least) to use the |> pipe in things. I think it’s pretty, haha, perhaps because I’m a data wrangler who comes from the pandas and R notebook way of doing things.
The point about the m in the type constraint is a good one. I’ll probably end up switching to mdl and idx (for t) when the final types get figured out.
@mchav said something poignant this morning: "I saw the angel in the marble and carved until I set him free.” I think the goal for my API design work should be to start with the biggest, most “fancy” abstractions possible and eventually move down the ladder until it feels “just right.” I personally (as a beginner) didn’t realize the power of the DataKinds extension, and it seems like people generally like using it … it does feel awfully right, and Haskell-y.
The inbetween option I’m leaning most heavily towards right now is something like:
myModel :: Fitted 'ARIMA -- instead of
myModel :: Fitted ('ARIMA 1 1 1)
But this is still up for debate. I agree with your point especially that:
I do note that if your type checking is fast enough, changing something and getting a type error is a better experience than changing something, trying to run your code, and having it fall over with a runtime type error.
This is why I’m still an advocate for a facade layer that splits the library between a layer of runtime errors on failure and a “safe” layer of type-driven erroring. In a day or two, I’ll have formalized a draft design document and I’ll definitely post it here for comment; but I’m leaning more into Haskell’s abstractions than away from them at the moment.
Also, thank you for the point about the type aliases; I didn’t know that, oops!
Discussion in the ATmosphere