You're on the right track not duplicating json decoding and encoding when
they're part of larger things. You can do the same with init, too.
Having state in components comes up a lot as a question in elm, I wrote
about my take on how this should ideally work:
https://medium.com/@prozacchiwawa/
nerator s)
start
|> LL.map Tuple.first
On Mon, Nov 13, 2017 at 1:48 AM, 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:
> On Saturday, November 11, 2017 at 6:33:34 PM UTC, art yerkes wrote:
>>
>> I always interpreted the warning in the d
I always interpreted the warning in the documentation as "Don't use the
name LazyListView or the Nil and Cons constructors, instead using head,
tail and headAndTail for most pattern matchng". I think it makes sense not
to use the internal representation given that Dict and Array change when
be
It's a niggle, but I think it's more correct to say that type inference
isn't completely decidable in the presence of subtyping.
On Friday, October 6, 2017 at 6:45:42 AM UTC-7, Rémi Lefèvre wrote:
>
> Thank you very much, this is perfectly clear.
>
> For some reason, I was confused by extensible
Updates take CPU time, heat up your user's laptop, reinvigorate cold
memory, often when your user is trying to use their computer for other
things. If running some code won't be useful, you should avoid running
it. It also saves the environment just a tiny amount.
On Monday, July 17, 2017 at
and recursive function definitions in
> functional languages are, in their essence, the same thing.
>
> ( You cannot simulate every while loop with things like List.map though.
> See https://en.wikipedia.org/wiki/LOOP_(programming_language) )
>
>
>
>
>
>
> On Tuesd
You might need to do optimizations until there are no more changes to make.
Conceptually, you can express it as a while loop.
On Monday, July 10, 2017 at 8:28:15 AM UTC-7, Erkal Selman wrote:
>
> What exactly do you need the while-loop for?
>
> On Thursday, July 6, 2017 at 7:04:18 AM UTC+2, John
Lazy lists are a slightly more versatile way to do iteration in elm. They
can
iterate up to a certain index (like a for loop, using iterate and take).
And emulate
a while loop using
http://package.elm-lang.org/packages/elm-community/lazy-list/1.0.0/Lazy-List#takeWhile
.
Lazy list has toList a
Something to note about event objects in javascript is that they can go out
of scope when you carry them away from the event handler, consequently, elm
does all decoding on the same stack as the event, and you're likely to get
a runtime error if you store the raw event value.
I decided to write
That's a pretty good list. I'd add interacting with sound, files and
focus, which require side-effect like interaction and haven't really been
addressed well yet.
On Wednesday, April 19, 2017 at 2:11:05 AM UTC-7, Peter Damoc wrote:
>
> Hello community,
>
> Scaling Elm apps seams to be a recurr
Thanks for sharing this.
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.c
Clients usually don't need to validate tokens. I'm doing something a
little special. Still, it's a pain.
On Sun, Apr 9, 2017 at 8:55 AM, 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:
> On Sunday, April 9, 2017 at 2:59:26 PM UTC+1,
Since this thread has risen from the grave completely, handling JWT
validation is kind of gross in elm.
https://gist.github.com/prozacchiwawa/d51b4e49e59a2aa0d3a28b328f62627d
Note that this requires a version of billstclair's sha256 that disables
internal utf-8 handling (if there's demand, I'll
I wrote this recently:
http://package.elm-lang.org/packages/prozacchiwawa/elm-json-codec/1.0.0/JsonCodec
which at least for normally sized objects will fail to compile if you're
missing a field in an object. It isn't perfect but one advantage is that
you build encoder and decoder pairs togethe
It's not a huge deal but other strongly typed languages definitely allow
arbitrary expressions in record update syntax.
# type t = { a : int ; b : float } ;;
type t = { a : int; b : float; }
# let emptyT () = { a = 1 ; b = 3.0 } ;;
val emptyT : unit -> t =
# let x = { (emptyT ()) with a = 7
I've also been using elm on the server side, and have some thoughts:
In elm-0.18 you'll use a Platform.program or Platform.programWithFlags and
pass command line arguments via the flags from a small javascript runner.
Unlike Sonny Michaud's approach, I've used the normal
init/update/subscripti
Most languages have some form of runtime dispatch but in elm you have to
write it yourself, so it's up to you to choose a dispatch model.
A couple of patterns for this:
https://medium.com/@debois/elm-components-3d9c00c6c612#.hht7utwro
https://medium.com/@prozacchiwawa/the-im-stupid-elm-language-
That's really fantastic work. Congratulations.
On Monday, February 13, 2017 at 8:08:45 AM UTC-8, Luke Westby wrote:
>
> Hey friends!
>
> I made this so you can share and run Elm stuff from the browser with full
> access to ports, external JS, css, and all the community packages.
>
> https://www.
The current elm try page uses a server side compiler, which is ok, but not
ideal for some uses.
The ghcjs compiled elm compiler, with other build infrastructure in
javascript is here:
https://www.npmjs.com/package/elm-basic-compile
On Tue, Jan 31, 2017 at 3:02 AM, Zachary Kessin wrote:
> I thin
Your post makes me wonder about an alternate future where browsers just
adopted every new environment that wanted to become a standard language for
web development. We'd have some horrible mixture of:
javascript, perl, tcl, scheme, emacs-lisp, common-lisp, actionscript, dart,
java as a source
You could try elm-generic-dict to have arbitrary keys in dicts.
On Monday, January 16, 2017 at 6:31:28 AM UTC-8, Austin Bingham wrote:
>
> Ah ha! That bit of syntax is exactly what I was looking for. That get's me
> a lot of what I was hoping for.
>
> Regarding the use of helper functions, I agre
After working with the elm compiler just a bit from the outside, I think
there might be build time improvements to be had by improving the build
info dropped in elm-stuff. I think reducing the number of graph.dat and
.elmi files read during the build process might help.
On Sat, Jan 14, 2017 at 10
+1
As an aside, you can use a dom mutation observer to avoid the blink, but
it'd be better with proper support.
On Saturday, January 14, 2017 at 1:31:17 AM UTC-8, Josh Adams wrote:
>
> +1
>
> Not much more to add, but figured it was worth mentioning since you're
> looking for feedback :) I have
ber 2016 03:25:53 UTC+7, art yerkes wrote:
>>>
>>> The promise of never needing to really get dirty and debug live Elm code
>>> is real, and it's true that nothing else quite lives up to that.
>>>
>>
>> Amen to that: the advantage of being simple a
, and Fable have the best chance of getting there reasonably
> quickly, with Elm also actively developed, but I think we are looking at a
> minimum of a year for any of them to get to stable status.
>
> On Thursday, 29 December 2016 22:23:50 UTC+7, art yerkes wrote:
>>
>>
I can comment a bit on purescript and fable (and ghcjs) from a n00b
perspective in all three.
- Purescript's type system is not as well polished as haskell and has IMO a
steeper learning curve.
- Purescript's package ecosystem is very immature.
- Purescript's js interop is very easy and doesn't
I'd be on board with using both:
case action of
...
ClickRegistrationSubmit form ->
let vErrors = validate form in
vErrors
|> Maybe.map (\ve -> update (ShowValidationErrors ve))
|> Maybe.withDefault (update (SubmitForm form))
separates concerns and levels of abs
Recently, I've been working on a cradle for the compiler that can serve as
an example for your use case
https://github.com/prozacchiwawa/elm-basic-compile
On Thursday, October 20, 2016 at 9:47:28 PM UTC-7, Adam Fluke wrote:
>
> So I know that answer may be no, but I thought I'd ask incase I miss
Elm has very little friction when used as a library from javascript if your
API can be expressed in terms of callback streams or promises, although
it'll be necessary to write trivial wrapper code to do give it a nice API
(for example, to match requests to responses when fulfilling promises).
Because it messes up atom support for elmx, I often defined this:
gt : a -> b -> bool
gt a b = a > b
And used it like:
if a `gt` b then
You could use that for your tagged type and it'd perhaps have reasonable
readability..
On Saturday, September 24, 2016 at 3:24:21 PM UTC-7, Brian Marick wrot
HttpError has BadResponse Int String which you can use to detect non-200
results to http requests. The way to do it in elm is to write a function
that wraps the creation of login enabled http requests and translates 401
errors into a suitable message (which is why Task.perform has two function
I discovered this recently when trying out elm-server-side-renderer . The
elm compiler is parsing the repository url in elm-package.json and using
what would be the user name and repository fields for these. Apparently,
what you have is what happens when the repository url doesn't point to
gi
In my app, my elm code was structured like this (note that this is an SPA
with no server integration ...)
/Master.elm <-- SPA host. Hosts a header, drawer, login dialog and view
stack
/Account/Login.elm <-- Login dialog
/Account/WorkoutEditor.elm <-- Views that can be accessed only by logging i
Thanks for your effort in writing elm-mdl. It's really amazing.
On Thursday, August 4, 2016 at 6:15:15 AM UTC-7, Rupert Smith wrote:
>
> On Wednesday, August 3, 2016 at 11:07:00 PM UTC+1, debois wrote:
>>
>> I'm very happy to announce the release of elm-mdl 7.0.0.
>>
> Wow, can't wait to try this
F# is kind of radical in that it has units.
https://fsharpforfunandprofit.com/posts/units-of-measure/
It's not perfect, but it could serve as a starting point for evaluating
different ways of having units as part of a language.
On Thursday, July 28, 2016 at 11:42:44 AM UTC-7, John Bugner wrote:
A proper expression of touch includes multiple touches that can come and go
independently, along with extra parameters for each (pressure is one but
velocity is another too). Neither was relevant to the things I was writing
but it'd be awesome to see a touch API that exposes touch fully in a way
t
You do need a main, at the very least to pass init, update and
subscriptions to the runtime that will iterate your app. View can return a
single DOM node and be satisfied. It won't actually be displayed, but
needs to be there.
Elm works well in this scenario. Here's an example I did a while
Try testing any part of such a big ball of mud. TEA components can even be
poked in the repl, which you can't do with a Main module easily.
On Friday, July 15, 2016 at 5:08:23 PM UTC-7, Max Goldstein wrote:
>
> Allow me to suggest that this approach is *totally overkill*. It might not
> be, but
In ocaml, you still tend to write pure code as much as possible, but it's
definitely not guaranteed. For a few reasons related to sum types and
ocaml's build process, checked exceptions would actually help a lot more
than they do in java, so I think it's a shame they aren't in ocaml, as it'd
w
I do it like this:
D.oneOf [
D.at ["touches", "0"] (D.object2 TouchPosition ("pageX" := D.float) ("pageY"
:= D.float))
, D.object2 TouchPosition ("pageX" := D.float) ("pageY" := D.float) ]
Which can be bound to both touch and mouse events and yields whatever the
event has.
On Sunday, May 15, 2
40 matches
Mail list logo