succeed : Msg -> Cmd Msg
succeed msg =
Task.perform never (Task.succeed msg)
with `never` from elm-community/basics-extra
On Wed, May 25, 2016 at 9:53 AM, Wil C wrote:
> It turns out it doesn't. What's the correct way to do this?
>
> Wil
>
> On Tuesday, May 24, 2016 at 10:48:33 AM UTC-7
It turns out it doesn't. What's the correct way to do this?
Wil
On Tuesday, May 24, 2016 at 10:48:33 AM UTC-7, Janis Voigtländer wrote:
>
> This is not doing what you almost certainly think it does.
>
>
> 2016-05-24 18:44 GMT+02:00 Wil C >:
>
>> It's just an aside, in case someone searches for
Hi Mark,
Elm is in development and minor releases can still break things in a big
way.
This is what happened with the switch from 0.16 to 0.17.
This release got rid of Signals which have been with Elm since its
conception.
Lua's development is in a different stage where you can do minor releases
I was about to write up in detail how you could do it, but that would take
away some learning from you so here are some ideas:
- Putting color in the model strikes me as a bad idea, that should be a
view concern that should be possible to derive from the model
- Maybe you could try to define a t
hi,
in http://guide.elm-lang.org/architecture/user_input/forms.html , there is
an exercise:
- Add a "Submit" button. Only show errors *after* it has been pressed.
I tried and find it not as easy as I thought. I have to put color and
message in the model, I put the result code here:
https://gi
A major issue is the "Maybe". In Java a type can be null so you always have
to check for that. WHile in Elm there is difference between "Maybe User"
and "User". So the type system will prevent any form of null pointer
exception.
Zach
ᐧ
On Tue, May 24, 2016 at 10:06 PM, Joey Eremondi
wrote:
> Ar
Is this a known issue? I have some code that works fine when I run it with
elm-reactor, but when I try to compile it with elm-make and load the
index.html file into the browser I get a blank screen and a couple of
JavaScript console errors:
index.html:8729 Uncaught TypeError: Cannot read proper
Cool, thanks for that example. I can see the advantage of decoupling the
actions from the effects.
Even without being enforced by the core platform, I think an Elm programmer
could follow this pattern without too much trouble. Much in the same way
that the current platform architecture was origina
My impression from a brief discussion on the gitter chat room
(https://gitter.im/jdubray/sam) about SAM with the creator is that
basically if you turn:
update msg model = case msg of
Increment -> (model + 1, Cmd.none)
Decrement -> (model - 1, someEffect)
into
updateModel msg model = ca
Are you interested in the actual type checking algorithms, or just the type
systems?
Big differences of the type systems:
* Elm has tagged union types, meaning that you can make a value that many
have one of many types, and pattern match on its possible variants.
* Elm has type inference, Java d
> What would need to change in the Elm architecture for it to match SAM?
I'm just someone interested in learning elm, so I cannot answer. Are the
architects of elm, following these messages, who can? Evan Czaplicki? And
is this interesting enough to contact Jean-Jacques Dubray, Evan?
Op dinsda
Peter's description is very close to how I manage states in my code. It
never occurred to me that it might have its own name; it just seemed the
most natural way to manage states within the Elm Architecture.
The model is a union type. The action is a union type. The update function
is just a case
Can someone /wittily/ sum up the experience of type checking in Java vs
something pure like Elm?
I feel purity, preciseness and descriptiveness is the main difference
somehow...
Java is too long in the distant past for me, but it's something I love
about Elm and never really cared for in language
This is not doing what you almost certainly think it does.
2016-05-24 18:44 GMT+02:00 Wil C :
> It's just an aside, in case someone searches for it. Here's how to make
> new commands:
>
> Cmd.map (\_ -> NewMsg) Cmd.none
>
> It wasn't obvious to me.
>
> Wil
>
> --
> You received this message bec
Result has its own withDefault function. You do not need to convert the
Result to a Maybe.
On Tue, May 24, 2016 at 9:15 AM, Thomas Coopman
wrote:
> I do not completely agree that the solution is not so nice.
> The app can return an invalid string and here you are enforced to do
> something with
It's just an aside, in case someone searches for it. Here's how to make new
commands:
Cmd.map (\_ -> NewMsg) Cmd.none
It wasn't obvious to me.
Wil
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receivi
I created a child component that is supposed to display notifications
coming from the parent.
I know how to initialize and listen to a child but here I would like to
tell him to execute actions for me.
What do you suggest me to do?
--
You received this message because you are subscribed to th
I was talking with coworkers about my team's experiments with Elm and I found
myself having to blunt their interest because of the current state of Elm 0.17
— documentation still has holes, tutorials haven't had a chance to arise, some
functionality is still missing relative to 0.16, etc. This w
I do not completely agree that the solution is not so nice.
The app can return an invalid string and here you are enforced to do
something with it explicitly.
You do have to check if this implementation is acceptable for you, because
now, when the user enters an invalid string, you will change his
Whenever you accessed the list, you would get an element of type A | B. To use
if further, you would need to type case it, pass it to something that wanted A|
B or A | B | C etc, or put it through some sort of type cast operator that
could give you a Maybe A or a Maybe B. Elm, of course, doesn't
Thanks!
The Solution just don't look that nice ;-)
update : Msg -> Applications -> Applications
>>
>> update action model =
>>
>> case action of
>>
>> AID app ->
>>
>> { model | appID = String.toInt app |> Result.toMaybe |>
>>> Maybe.withDefault 0 }
>>
>>
>>> Name nname ->
>>
>>
Sorry, I misinterpreted your question.
I would probably do it like this:
The int in your model is fine. The Msg type should still be of AID String
and then you can parse the string to an Int(or Maybe Int) in your update
function.
On Tue, 24 May 2016 at 17:09 Herwig Habenbacher <
herwig.habenbac..
Thanks - I was aware of that...
>If you want to use an Int, you must transform the int to a string.
But how to do that and where?
On the view side? How?
>input [ type' "number", placeholder "1", onInput AID ] []
Or on the update side?
Thanks!
--
You received this message because you are subsc
How could a task fail for things like getting a random number or getting
the current date?
It can’t. And that’s what the never in Task.perform never expresses, and
lets the type-checker confirm.
2016-05-24 15:41 GMT+02:00 TheGryzor123 :
> Thanks for the answer. How could a task fail for things
Thanks for the answer. How could a task fail for things like getting a
random number or getting the current date?
--
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
Hi guys,
I am trying to write an extension for Chrome and I've stumbled into a
security issue. I get the following error message:
Refused to execute inline script because it violates the following
Content Security Policy directive: "script-src 'self' https://lvh.me:3000";.
Either the 'unsa
The Elm compiler is telling you what is wrong.
onInput wants a string (
http://package.elm-lang.org/packages/elm-lang/html/1.0.0/Html-Events#onInput)
instead of an Int.
So the compile gives an error, because your program would break otherwise.
If you want to use an Int, you must transform the int
Hello Together,
just stumbled about this in Elm 0.17:
If I only use Strings everything is fine, but as soon as I use an Integer
in my Model I can't compile...
Shouldn't Elm handle this easily?
Cordially,
Herwig
(See attached file...)
--
You received this message because you are subscribed
performUnfailing sounds more descriptive indeed.
On Tue, May 24, 2016 at 2:29 PM, Janis Voigtländer <
janis.voigtlaen...@gmail.com> wrote:
> Yeah, I’m thinking of adding that version of perform to a task-extra
> package. Actually wondering about the name. Maybe performUnfailing,
> because the
> This is not the first time I read about SAM. The decoupling between model
and actions seems a bit artificial. Just putting them into different
functions doesn't mean the coupling magically disappear in my opinion.
There still must be an implicit contract between those two, so that the
model
Noah, can you elaborate on (or link to) the problems getting the sublime
plugin accepted to package control?
On Mon, May 23, 2016 at 7:53 PM, kgashok wrote:
> There is a quick fix for this -
> https://github.com/deadfoxygrandpa/Elm.tmLanguage/issues/99
>
>
> On Monday, 23 May 2016 22:53:24 UTC+5
Yeah, I’m thinking of adding that version of perform to a task-extra
package. Actually wondering about the name. Maybe performUnfailing, because
the standard perform is not really “unsafe” either.
2016-05-24 13:17 GMT+02:00 Peter Damoc :
> I would love to have `never` in core and available on e
I would love to have `never` in core and available on elm-lang.org/try
Or have
performSafe: (a -> Cmd msg) -> Task Never a -> Cmd msg
Until then, I prefer the universality of NoOp.
On Tue, May 24, 2016 at 12:49 PM, Janis Voigtländer <
janis.voigtlaen...@gmail.com> wrote:
> My standard obje
I've just run into this too, but for me it causes a runtime exception. I've
added a demo to reproduce (based on Gera's code) to the same issue:
https://github.com/elm-lang/html/issues/21
On Monday, 23 May 2016 13:41:56 UTC+1, ge...@theoldmonk.net wrote:
>
> I'm not sure if the lazyDict approac
My standard objection:
Replace Task.perform (\_ -> NoOp) by Task.perform never, using:
http://package.elm-lang.org/packages/elm-community/basics-extra/1.0.0/Basics-Extra#never
2016-05-24 11:21 GMT+02:00 Peter Damoc :
> You should use Process.sleep
>
> dismissCmd =
> Process.sleep (2 * sec
You should use Process.sleep
dismissCmd =
Process.sleep (2 * second)
|> Task.perform (\_ -> NoOp) (\_ -> DismissAlert)
On Tue, May 24, 2016 at 11:56 AM, TheGryzor123 wrote:
> I'm still pretty new to Elm so I prefer to ask.
>
> I'm creating a typical alert that says "Action succes
I'm still pretty new to Elm so I prefer to ask.
I'm creating a typical alert that says "Action successful!" and want it to
disappear automatically after 5 seconds.
Should I use Time.every for that?
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" grou
Aligning Elm with TLA+ will make it even more solid from a theoretical
point of view.
SAM sounds very intriguing. I'm wondering if SAM couldn't be implemented in
terms of TEA using a tagged union as Model.
something like this:
https://gist.github.com/pdamoc/c96714479d9f531fbc7468d5670ef576
On
What I want to do is have a chunk of HTML that is not controlled by elm
inside an elm full page application. Specifically, I want to use Vega to
create graphs in a div on my site.
But when I tried to do that with a port if flickered and generally was
unusable. I think some of the issue was that the
39 matches
Mail list logo