Re: [elm-discuss] Re: How to walk my own implementation of an array

2017-12-04 Thread Matthieu Pizenberg
> I wouldn't want to go through hundreds of thousands for just one thousand. > That's why I'm trying to come up with a function that have the behavior I > described initially, "nextlocation". Along with "index" function I can work > out in O(1) the index for the next one Yep sorry, I didn't

[elm-discuss] Re: How to walk my own implementation of an array

2017-12-04 Thread Matthieu Pizenberg
I wasn't very far ^^ here is the function: location : Int -> Int -> ( Int, Int ) -> ( Int, Int ) -> Maybe ( Int, Int ) location bufferIndex offset ( str1, str2 ) ( height, width ) = let unOffset = bufferIndex - offset ( line, lineRest ) = ( unOffset //

[elm-discuss] Re: How to walk my own implementation of an array

2017-12-03 Thread Matthieu Pizenberg
Oops, not as trivial as I thought ahah. Forget previous answer. It may require just some little adjustment though, I will think about it. On Monday, December 4, 2017 at 3:49:23 PM UTC+8, Matthieu Pizenberg wrote: > > Regarding your question, walking the array is not complicated I thin

[elm-discuss] Re: How to walk my own implementation of an array

2017-12-03 Thread Matthieu Pizenberg
Regarding your question, walking the array is not complicated I think. You can just walk the underlying buffer, and use a function like below if I'm not mistaking. location : Int -> Int -> Strides -> Shape -> Maybe Location location bufferIndex bufferOffset (stride1, stride2) (height, width) =

[elm-discuss] Re: How to walk my own implementation of an array

2017-12-03 Thread Matthieu Pizenberg
Hi Francisco, I think there is a confusion here. If you keep the same buffer, your matrice [1 3; 7 9] will be represented by { strides = (6, 2), shape = (2,2) } not strides = (2,2). Because 6 is the jump from one line to the other (1 to 7). Let me know if I'm mistaking or not clear. On Friday,

[elm-discuss] Pointer (mouse/touch/pointer) events community coordination attempt

2017-11-30 Thread Matthieu Pizenberg
PS: duplicate of reddit for people not using reddit (https://www.reddit.com/r/elm/comments/7gksya/pointer_mousetouchpointer_events_community/) Hi folks, I've been browsing the elm packages repository in search of packages dealing with pointer events in general, mouse / touch / pointer. My

[elm-discuss] Re: Array map with start and end

2017-11-27 Thread Matthieu Pizenberg
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:

Re: [elm-discuss] Re: Array map with start and end

2017-11-23 Thread Matthieu Pizenberg
> > 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

Re: [elm-discuss] Re: Array map with start and end

2017-11-20 Thread Matthieu Pizenberg
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

[elm-discuss] Re: Array map with start and end

2017-11-19 Thread Matthieu Pizenberg
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

[elm-discuss] Re: Discovering Elm packages

2017-08-21 Thread Matthieu Pizenberg
Wow, that's awesome! when are your next holidays? ^^ On Wednesday, August 9, 2017 at 10:37:40 AM UTC+8, Ryan Rempel wrote: > > There are new or updated Elm packages every day. > > Well, not quite every day -- there were none on July 30, 2017. Before > that, the previous day without any new or

[elm-discuss] Re: Elm `reusable views`

2017-08-21 Thread Matthieu Pizenberg
Could the size be left to specify by the css of the user of the library? You would need to enable user to give the class name they want for this. On Thursday, August 3, 2017 at 4:43:21 PM UTC+8, enetsee wrote: > > Hi, > > I have been trying to create a `resuable view` following the structure >

[elm-discuss] Re: deprecating packages?

2017-07-06 Thread Matthieu Pizenberg
Hello Raoul, just a few remarks about your post: This output you show in the first message `Here are some ...`, is this an output of the compiler? If so, and if you found it a bit confusing there is something awesome you can do. Great error messages in the elm ecosystem are important, so there

[elm-discuss] Re: How to manage long running computations in Elm?

2017-06-13 Thread Matthieu Pizenberg
> > One thing that I think I would have tried in this case, it to delegate the > long running computation to a webworker > , and then talk with it through > a port. I'm not from the web community. I had bases in html+css+js, but pretty much had to

[elm-discuss] Re: The way forward for Elm Arrays

2017-06-12 Thread Matthieu Pizenberg
On Monday, June 12, 2017 at 7:15:59 AM UTC+8, Robin Heggelund Hansen wrote: > > I've been doing some thinking on how to improve Arrays in Elm. > Thanks alot for this work on an alternative array implementation! It's awesome! It's one of some challenges to use elm for my needs (scientific

[elm-discuss] Re: How to manage long running computations in Elm?

2017-06-12 Thread Matthieu Pizenberg
On Wednesday, June 7, 2017 at 4:08:37 PM UTC+8, Rupert Smith wrote: > > On Tuesday, June 6, 2017 at 3:20:42 PM UTC+1, Rupert Smith wrote: >> >> The problem with long running computations in a single threaded UI is >> that they may cause the UI to block and become unresponsive for a period. >>

[elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-08 Thread Matthieu Pizenberg
> > - Use elm-doc-test for examples whereever possible > - If you have views, use elm-html-test. > Thanks Noah, I didn't know about those for lack of using tests. Thank you everyone for your feedback. So if I sum up, the main ideas are: 1. Keep in sync doc examples by using doc tests. 2. For

[elm-discuss] Re: Missing json decoding tool to decode multitouch events cleanly

2017-05-08 Thread Matthieu Pizenberg
On Monday, May 8, 2017 at 11:36:13 PM UTC+8, Erik Lott wrote: > > Yeah, I think you spotted my bad logic. You're talking about functions > like this, right? > Yep that was it :) -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe

[elm-discuss] Announce: new package (elm-mouse-events), major update (elm-touch-events)

2017-05-08 Thread Matthieu Pizenberg
Hi all, Since I often need coordinates of mouse events and was getting tired of recoding the json encoders / decoders for each project, I made a package for this: mpizenberg/elm-mouse-events . The main differences from

[elm-discuss] Best practices to create examples for an elm package?

2017-05-07 Thread Matthieu Pizenberg
Exploring a bit the packages repository, I've come accross the following options: 1. no examples/ dir, all in readme and documentation. (elm-array-exploration, ...) 2. examples/ dir with nothing more than `.elm` files (elm-decode-pipeline, elm-monocle, ...) 3. examples/ dir with an

Re: [elm-discuss] ADL: possible language for serialization

2017-05-07 Thread Matthieu Pizenberg
I've no idea if the name picked was done purposely but the purpose looks similar to ADL (https://en.wikipedia.org/wiki/Architecture_description_language). This language is used as a modeling language to create and manipulate systems. If I remember well, we used it in software engineering

[elm-discuss] Re: Linear algebra for 2d geometry?

2017-05-04 Thread Matthieu Pizenberg
I definitely recommend looking at https://github.com/opensolid/geometry (with it's svg counterpart : https://github.com/opensolid/svg). I've been using it a bit and it's awesome for what I understand you want. I've been using eeue56/elm-flat-matrix also but for more "raster" drawings than

[elm-discuss] Re: Charty: SVG charts library (feedback request)

2017-05-02 Thread Matthieu Pizenberg
Hi Juan, I just checked the demo app and the two plots there look great. But what is it in elm-plot or elm-visualization (to cite the two most known elm

[elm-discuss] Re: Elm "missing library / I was blocked by ..." scoreboard?

2017-05-02 Thread Matthieu Pizenberg
It looks a lot like something that could be done on reddit from the images I've seen on this website. I've no idea how reddit works though, I'm not a user. Could this be done with some kind of reddit channel or subreddit or whatever ? Another option I see, is someone doing *some kind of a

Re: [elm-discuss] Linear algebra (matrix, vectors, ...) in the context of image processing

2017-05-02 Thread Matthieu Pizenberg
> I think ultimately Elm could be a great language for working with binary > data but it's not there yet. Indeed ^^. In case you're still interested, I posted there what I did (at the end) :

Re: [elm-discuss] Re: Better syntax for nested pattern matching (destructuring)?

2017-03-30 Thread Matthieu Pizenberg
> > Instead of calling it 'getVar3', I am using names like 'whenWithVar3'. The > 'when' part better reflects that the operation will not always produce a > result. 'whenWith' is a bit long, perhaps 'whenVar3' might be better? > This sounds well also. I've no idea though about conventions that

Re: [elm-discuss] Re: Better syntax for nested pattern matching (destructuring)?

2017-03-30 Thread Matthieu Pizenberg
> > model.study.status > |> getProgressingSteps > |> Maybe.map Pivot.getCurrent > |> Maybe.andThen getScribbles > |> Maybe.map (Scribbles.update scribblesMsg model) > |> Maybe.withDefault model > ... > Thank you Aaron, that makes it definitely more readable! Those getters are the

[elm-discuss] Re: Better syntax for nested pattern matching (destructuring)?

2017-03-29 Thread Matthieu Pizenberg
> > We have found that this pattern is typically a good case for chaining a > bunch of andThen statements with a withDefault statement at the end > together. The one thing is you would have to be able to adjust your values > to all be Maybes. > Yes Christian, I am wondering if people are

[elm-discuss] Better syntax for nested pattern matching (destructuring)?

2017-03-29 Thread Matthieu Pizenberg
Multiple times in my projects, I happen to need nested pattern matching. Below is a raw extract of code (in an update) showing this need. Study.ScribblesMsg scribblesMsg -> case model.study.status of Study.Progressing steps -> case Pivot.getC steps of

[elm-discuss] Re: Post Examples of Painful Record Updates Here!

2017-03-23 Thread Matthieu Pizenberg
Here is a somewhat painful record update: setImage : String -> String -> Image -> Model -> Model setImage tool url image model = let mapping = case tool of "rectangle" -> .rectangle model.resourcesMapping "outline" ->

[elm-discuss] Re: elm-package install doing nothing?

2017-03-17 Thread Matthieu Pizenberg
Oups sorry for the noise discussion thread. A wrong copy paste and my version specified for elm-navigation was too old (1.0.1 instead of 2.1.0). This was causing elm-package to do nothing. On Friday, March 17, 2017 at 3:34:26 PM UTC+8, Matthieu Pizenberg wrote: > > Hi, did somethin

[elm-discuss] elm-package install doing nothing?

2017-03-17 Thread Matthieu Pizenberg
Hi, did something like this already happened to you? My elm-package.json : { ... "dependencies": { "elm-lang/core": "5.1.1 <= v < 6.0.0", "elm-lang/html": "2.0.0 <= v < 3.0.0", "elm-lang/window": "1.0.1 <= v < 2.0.0", "elm-lang/navigation": "1.0.1 <= v <

Re: [elm-discuss] Uncaught TypeError with a value obtained from a decoder

2017-03-14 Thread Matthieu Pizenberg
> > Looks like you hit on this issue: > https://github.com/elm-lang/core/issues/444 > Seems to be the case indeed. > Have you tried switching to a different implementation? > http://package.elm-lang.org/packages/Skinney/elm-array-exploration/2.0.2 > Not yet, thanks for the advice, I will

Re: [elm-discuss] Uncaught TypeError with a value obtained from a decoder

2017-03-14 Thread Matthieu Pizenberg
Thanks Peter, After a long process of reducing the code, it came down to (in REPL): > Array.append (Array.repeat 993 False) (Array.repeat 1 True) TypeError: Cannot read property 'length' of undefined Whereas with 992 instead of 993, it works fine. Should I report this as an issue? -- You

Re: [elm-discuss] Re: elm + reactive programming

2017-03-10 Thread Matthieu Pizenberg
> Let's consider throttling. > ... > What you are describing here Mark is almost exactly what I implemented in mpizenberg/elm-debounce [1]. I have no experience in observables and unfortunately, do not know yet about effect managers so it is done with messages. I agree that it has been

[elm-discuss] Re: What about partial public exposition of private types?

2017-03-10 Thread Matthieu Pizenberg
> > Did calling the type and its alias both 'Test' somehow override the > private one with the public one? > No actually it is misleading you here. The main difference is that when I write: -- module Test exposing (testFunction) import Public exposing (Test) import Private testFunction : Test

[elm-discuss] Re: What about partial public exposition of private types?

2017-03-09 Thread Matthieu Pizenberg
> > So I think a type becomes opaque if its constructors are not exposed, or > if its module is not exposed. > It might be better in that case, if the compiler just referred to the > opaque type as Animation.State? > Actually, the compiler can do that. I just checked and figured that it was

[elm-discuss] Re: What about partial public exposition of private types?

2017-03-09 Thread Matthieu Pizenberg
> > However, as the constructor for Animation is exposed by its module, I am > not prevented from deconstructing it or pattern matching against it. > Hmm, I tried to do this but got errors as I thought: Cannot find pattern `Animation` 6| f (Animation { steps, running }) =

Re: [elm-discuss] Recent Mozilla Tech announcement regarding Web Assembly

2017-03-08 Thread Matthieu Pizenberg
> > There's a GSoC project suggestion on this at > https://github.com/elm-lang/projects#explore-webassembly - otherwise, I > think that's as far along as planning has gone. If you're a student and > interested, you might apply to take it on! :D > Technically I am, but far too busy with my PhD

[elm-discuss] What about partial public exposition of private types?

2017-03-06 Thread Matthieu Pizenberg
Hi everyone, I would like to have the point of view of the community regarding some private/public types code organisation. I have some types very useful to many sub modules that are currently publicly exposed in a Types module. In order to hide the type implementation, I wonder what you think

Re: [elm-discuss] Linear algebra (matrix, vectors, ...) in the context of image processing

2017-03-04 Thread Matthieu Pizenberg
Thanks Ian for the link. I will keep this work in mind though I don't think I could use it for my current project. It seems focused on rgbd matrix data type which is great for transparent dynamic graphics. Svg representation does really suits my needs for now since I'm visualizing non changing

[elm-discuss] Linear algebra (matrix, vectors, ...) in the context of image processing

2017-03-02 Thread Matthieu Pizenberg
I'm currently looking for a library to do some basic image processing and matrix manipulation stuff. I have a research background (mostly spending time in Matlab), and currently preparing a user study. Elm has been great for my needs so far, but I'm encountering now a few obstacles. Types and

[elm-discuss] Re: 0.18 Chaining Http requests

2017-02-06 Thread Matthieu Pizenberg
Hi Kingsley, Regarding point 2, the Http.send function enables you to create Cmd messages from http requests, and as you mentionned, Cmd.batch

Re: [elm-discuss] Re: Emphasizing /r/elm more

2017-01-27 Thread Matthieu Pizenberg
Yep he definitely should evan-gelize more. ... (OK I'm out) On Jan 27, 2017 19:46, "Duane Johnson" wrote: On Fri, Jan 27, 2017 at 10:52 AM, Rex van der Spuy wrote: > And, I hope he always remains the sole maintainer and developer of the >

Re: [elm-discuss] State of Elm Survey 2017 is live

2017-01-18 Thread Matthieu Pizenberg
Hey, I just participated in the survey :) A few remarks before forgetting: - I am not sure large scale notations (0->10) with only indications of what the 2 ends are, are a good thing in surveys. 0 to 3 is very often enough (not at all / small / medium / high ) - The question "What is your level

[elm-discuss] Re: POST Http.request in Elm 0.18

2017-01-18 Thread Matthieu Pizenberg
Hi, in case it may be of help, I just did a small test elm project using web api which is available at this repo . Basically it was to test a way to use api (and authentified api using JWT) that I adapted from a 0.17 tutorial available on the Auth0

[elm-discuss] Re: Emphasizing /r/elm more

2017-01-18 Thread Matthieu Pizenberg
Hi again, since this is not the first time that this matter is discussed, and since this time Evan launched it, it means that it is an important matter for the community and it's going to evolve anytime soon ^^. So, instead of discussing it here with passion and obvious bias since we are on

[elm-discuss] Re: Emphasizing /r/elm more

2017-01-17 Thread Matthieu Pizenberg
I would also like to keep something like this group. The fact that every one get a chance to be read by the community (without being downvoted or just ignored) is very important. A few times in Stack Overflow I have asked somewhat hard/specific questions with nobody caring answering it because

[elm-discuss] Re: Elm events 2017

2017-01-17 Thread Matthieu Pizenberg
Hi, Just to say that there is one meetup in Paris tomorrow: https://www.meetup.com/Meetup-Elm-Paris/events/236216040/ It seems to be already full though. There is another one in Amsterdam 1st of February: https://www.meetup.com/Elm-Amsterdam/events/236942429/ Kind of a hacking night. 15 spots

[elm-discuss] Feedback on a new package for debouncing and throttling of messages

2016-12-02 Thread Matthieu Pizenberg
Hi all, I just release a package (mpizenberg/elm-debounce ) for debouncing and throttling of messages. Any feedback would be great! For the story about why another debouncing and throttling package: Initially, I wanted to use

Re: [elm-discuss] Unpublishing a package

2016-11-21 Thread Matthieu Pizenberg
On Tuesday, November 22, 2016 at 1:52:09 PM UTC+8, Peter Damoc wrote: > > On Tue, Nov 22, 2016 at 1:33 AM, Richard Feldman > wrote: > >> There is no unpublish feature, and it's important that there never be one >>

Re: [elm-discuss] Re: Open discussion about optimization of code potentially triggered very often (mousemove) ?

2016-11-20 Thread Matthieu Pizenberg
that I would add is a filter on MoveMsg updates... if > `active` is already set to False, ignore the MoveMsg update entirely. That > way you guarantee you aren't triggering multiple calls to Reactivate. > > > On Sun, Nov 20, 2016 at 1:24 AM, Matthieu Pizenberg < > matthieu.pizenb...@gm

Re: [elm-discuss] Re: Open discussion about optimization of code potentially triggered very often (mousemove) ?

2016-11-20 Thread Matthieu Pizenberg
I have been trying something that I think could be shared. Basically I tried to see if it was possible to throttle commands by controlling the event attributes in the view that generate those commands. Well, turns out, not really ^^. The idea was the following: * In the model, have an

[elm-discuss] Re: Proposal: Shorter qualified imports

2016-11-19 Thread Matthieu Pizenberg
Hi, I am quite often doing the same thing (plus exposing the main type having the same name than the module) like: import Module.Something as Something exposing (Something) What I am concerned about is that it would be implicit, and all implicit things tend to lead to confusion. On Sunday,

Re: [elm-discuss] Re: Open discussion about optimization of code potentially triggered very often (mousemove) ?

2016-11-19 Thread Matthieu Pizenberg
per > frame. > > > lørdag 19. november 2016 15.51.56 UTC+1 skrev Matthieu Pizenberg følgende: >> >> Hi everyone, >> >> I am currently developing some functionality that get triggered on >> mousemove. I do not have any speed issue now so I am not trying to opti

[elm-discuss] Open discussion about optimization of code potentially triggered very often (mousemove) ?

2016-11-19 Thread Matthieu Pizenberg
Hi everyone, I am currently developing some functionality that get triggered on mousemove. I do not have any speed issue now so I am not trying to optimize things that do not need optimization right now ^^. But this work made me curious about how code is optimized in elm. In this blog post [1]

Re: [elm-discuss] Possible compiler bug while parsing type annotation in a let ?

2016-11-11 Thread Matthieu Pizenberg
Oh cool, thank you for the info, I will just comment it for now then. On Friday, November 11, 2016 at 5:09:31 PM UTC+8, Janis Voigtländer wrote: > > What you encountered is > https://github.com/elm-lang/elm-compiler/issues/1214, and it is fixed in > version 0.18 of the compiler. > -- You

[elm-discuss] Re: Gestures in Elm

2016-11-11 Thread Matthieu Pizenberg
Hi, m.hag... ;) Just to say that I am with you and would love to have support of these also. As maybe a small step I wrote recently a slightly more complete library handling also multitouch events, not only single touches.

[elm-discuss] Possible compiler bug while parsing type annotation in a let ?

2016-11-11 Thread Matthieu Pizenberg
Hi, I just came accross one very strange compiler error and wanted to have the point of view of the community before creating any github issue. I wrote some code to create tag more easily (seems to be trendy these days ^^) in a module Helpers.Views.elm. When I put a type annotation for a very

[elm-discuss] Re: Correct use of port subscriptions in a submodule reused multiple times?

2016-11-10 Thread Matthieu Pizenberg
Thanks OverminDL1 and Wouter In t Velt, I will try to explain how I have come to this issue. Originally, I have designed a web page (the "part") that was loading a collection of images to display them. So the flow was: - init the elm page with a list of images urls - [port] send the urls to JS

[elm-discuss] Correct use of port subscriptions in a submodule reused multiple times?

2016-11-08 Thread Matthieu Pizenberg
Hi, I am currently struggling with port subscriptions in a submodule (`Part`) reused multiple times in a bigger (`Group`) module like: -- In Group.elm type alias Model = { parts : Array Part.Model } I've been using the following "batching" technique (here are the relevant parts of 3 files: