haskell-numerics / hmatrix

Linear algebra and numerical computation
381 stars 104 forks source link

Existential wrappers for the static vectors and matrices are added #358

Closed jjdosa closed 2 years ago

jjdosa commented 2 years ago

As the continuation-passing style of the existential type is hard to pass around, its wrapper is introduced.

For example, we can't make a list of the CPS of the existential type as below 2022-03-11_15-41

However, the existential type is wrapped with a constructor, this is possible to make a list.

data SomeTest = forall z. SomeTest (Test z)

x1' :: SomeTest
x1' = SomeTest (Test 10.0)

x2' :: SomeTest
x2' = SomeTest (Test 10.0)

xs' :: [SomeTest]
xs' = [x1', x2']
jjdosa commented 2 years ago

Sorry for the mess. This request was meant to be applied to our fork. I want to delete this mistake but I don't know how.

idontgetoutmuch commented 2 years ago

Sorry for the mess. This request was meant to be applied to our fork. I want to delete this mistake but I don't know how.

Not a problem :-)

jjdosa commented 2 years ago

Thank you for understanding. I plan to PR our development into this original repository after some cleaning up. As it's been exposed already if you have any thoughts about what I've been adding, let me know so that I can prepare better for the proper PR :) Thank you!