[elm-discuss] In

2016-10-08 Thread Dave Ford
What does the in keyword do?

-- 
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.com/d/optout.


Re: [elm-discuss] In

2016-10-08 Thread Joey Eremondi
Nothing except when paired with a let.

You do
  let
x = foo
y = bar
   ...
  in baz

This let's you break up large expressions, and avoid recomputing values
that are used more than once.

On Oct 8, 2016 9:26 AM, "Dave Ford"  wrote:

> What does the in keyword do?
>
> --
> 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.com/d/optout.
>

-- 
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.com/d/optout.


[elm-discuss] In 0.17, what's the analog of Mouse.click for touch devices (ie. iPhone)

2016-06-13 Thread William Bailey
I've re-written the GUI for my bridge playing app (www.deepfinesse.com) in 
Elm and love it!

I've developed it using evanc/elm-graphics (so Collage and Element) as 
opposed to HTML / SVG.  Back in 0.16, I thought I saw a "touch" or maybe 
"tap" module which I assumed I'd be using for running the app on touch 
devices like smart phones (a very important direction for my new app).

The new app runs great on my MAC browser.  I use Mouse.clicks to process 
human interaction.  Works great.  But the app is unresponsive on iPhone, no 
doubt because there is no mouse.  But I no longer see a "touch" module to 
make this work on iPhones.  Hopefully I'm just being blind.

How does one make elm-graphics based apps work on touch devices?

--bill

-- 
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.com/d/optout.


[elm-discuss] In 0.17, what's the analog of Mouse.click for touch devices (ie. iPhone)

2016-06-14 Thread Stefan Kreitmayer
The touch module was removed in 0.17 :-/ and there still isn't an equivalent as 
far as I know. But this might help you:

https://groups.google.com/forum/m/?fromgroups#!topic/elm-discuss/6Dj7FyoQF2g

-- 
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.com/d/optout.


[elm-discuss] In a select element, how do I designate the initially selected option from my model?

2016-08-22 Thread Gabe Krambs


Let's say I have a select element to choose a person, and I want to have a 
certain person, say with id = 3, to be initially selected. How do I pass 
this id down into my options, and then set the selected attribute to True 
in that options?


Some sample code:


personSelect : List Person -> String -> Html Msg
personSelect : personList selectedId =
div []
[ select [] (List.map personOption personList) ]


personOption : Person -> Html Msg
personOption : person = 
option [ value (toString person.id) ] [ text person.name ]


Specifically, how do I get "selectedId" passed to "personOption"? Can I 
even do this using List.map?


Thanks very much!

-- 
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.com/d/optout.


Re: [elm-discuss] In a select element, how do I designate the initially selected option from my model?

2016-08-22 Thread Janis Voigtländer
What immediately springs to mind:

personSelect : List Person -> String -> Html MsgpersonSelect
personList selectedId =
div []
[ select [] (List.map (personOption selectedId) personList) ]
personOption : String -> Person -> Html MsgpersonOption selectedId person =
... use selctedId here now ...
option [ value (toString person.id) ] [ text person.name ]

​

2016-08-23 7:04 GMT+02:00 Gabe Krambs :

> Let's say I have a select element to choose a person, and I want to have a
> certain person, say with id = 3, to be initially selected. How do I pass
> this id down into my options, and then set the selected attribute to True
> in that options?
>
>
> Some sample code:
>
>
> personSelect : List Person -> String -> Html Msg
> personSelect : personList selectedId =
> div []
> [ select [] (List.map personOption personList) ]
>
>
> personOption : Person -> Html Msg
> personOption : person =
> option [ value (toString person.id) ] [ text person.name ]
>
>
> Specifically, how do I get "selectedId" passed to "personOption"? Can I
> even do this using List.map?
>
>
> Thanks very much!
>
> --
> 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.com/d/optout.
>

-- 
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.com/d/optout.