Following your advice, I came back to elm 0.18 and just started a
repository to try to wrap JS typed arrays in elm. I've moved the discussion
to a new post [1] since we were drifting from the original post here.
Cheers
[1] JS typed array implementation for elm:
Using native code in Elm isn't particularly hard (though, you cannot
publish such code as an elm package).
My original, and still working, array implementation uses native code (it's
a "blessed" library). It's better to use that as a template for any
experimentation you might want to
do:
>
> Do you need to rebuild the compiler for this?
>
I'm not familiar with so called "native" elm 0.18 code. So I wanted to use
the example given by Robin with `Elm/JsArray.elm` and
`Elm/Kernel/JsArray.js` from elm master branch to try the same thing with
`JsArrayBuffer.[elm/js]`. Since this
On Thursday, November 23, 2017 at 2:28:50 AM UTC, Matthieu Pizenberg wrote:
>
>
> Could JsArray.elm by made to work with JavaScript typed arrays?
>> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays
>>
>
> That was exactly what I was wondering. I peaked at the elm and kernel
On Tuesday, November 21, 2017 at 10:47:02 AM UTC, Robin Heggelund Hansen
wrote:
>
> Something like
> https://github.com/Skinney/core/blob/master/src/Elm/JsArray.elm ? It's
> what is used as the basis for Arrays in 0.19. It is not planned to be
> opened for use outside of elm-lang/core, but if
Something
like https://github.com/Skinney/core/blob/master/src/Elm/JsArray.elm ? It's
what is used as the basis for Arrays in 0.19. It is not planned to be
opened for use outside of elm-lang/core, but if it fits your usecase
better, I'm sure Evan would be interested in hearing about it.
On Monday, November 20, 2017 at 5:29:25 PM UTC, Francisco Ramos wrote:
>
> Ultimately, I'd like to rewrite NumElm using the elm-ndarray. Not sure how
> I'm gonna do this without writing kernel code. Linear algebra operations
> such as Inverse, Pseudo-inverse, Singular value decomposition,
Hi guys,
Thanks for your answers. Robin, that was a great talk. I actually was in
that very same room when you gave the presentation :-). Very interesting
and educative. Hope to see you again in the next Elm Europe.
Matthieu, thanks for the info. I didn't know about Okasaki's work on
immutable
Hi again,
So out of curiosity, I just spend a couple hours looking for variations of:
"(immutable/persistent) (tensor/multidimentional array/multidimentional
data structure) implementation"
and my conclusion is that I did not easily find examples of implementations
of data structures tailored
It using Array.prototype.slice under the hood, but the way Arrays in Elm is
implemented is by using trees. I suggest you watch my talk from Elm Europe,
where I explain how the different data structures work in detail =)
https://www.youtube.com/watch?v=mmiNobpx7eI
fredag 17. november 2017
Hi Matthieu,
Thanks for those links!!. Those lazy views look like what I'm trying to
achieve. I'm actually working on a multidimensional container of items,
elm-ndarray,
https://github.com/jscriptcoder/elm-ndarray/blob/master/src/NdArray.elm. Still
some work to do. I need to re-write *map* and
Hi Francisco, just a few words about arrays and image manipulation.
I've been doing some work along this way and encountered multiple issues.
One of them was with slicing. If I'm not wrong Robin's work will be merged
in 0.19 but meanwhile, you should be aware that there are few issues with
the
Hi,
Does using Array.indexedMap suit you?
import Array exposing (Array)
submap : Int -> Int -> (a -> a) -> Array a -> Array a
submap start end func =
Array.indexedMap (\i -> if i >= start && i < end then func else
identity)
Of course the result must be of the same type in this case.
On
That was a good observation, Rupert. Well, it doesn't return Nothing if the
indexes are out of the bounds, but if start < 0 then start = 0, and end >=
length then end = length -1... I could actually use Array.get and implement
my own map like you mention.
Thanks Robin for that correction. I
Slicing isn't O(N).
In the current implementation in core, slicing is O(log32n) i believe. In
the next version of Elm, slicing is O(log32n) when start = 0; I'm uncertain
what the big-o notation is once start > 0 though.
fredag 17. november 2017 09.25.22 UTC+1 skrev Francisco Ramos følgende:
>
On Friday, November 17, 2017 at 8:25:22 AM UTC, Francisco Ramos wrote:
>
> Hi there,
>
> Was wondering how I can map over an array with a start and end indexes. I
> know I could slice the array and then map, but performance is a concern and
> slicing is O(N) where N = end - start, plus the
16 matches
Mail list logo