Re: [elm-discuss] Teaching children Elm

2016-10-03 Thread Janis Voigtländer
I have concrete material (guided exercises) that I used with slightly older
youths, 16-18 y.o., here: https://github.com/jvoigtlaender/Elm-Kurs

Also, you might be interested in this mailing list thread
.
​

2016-10-04 7:33 GMT+02:00 Fedor Nezhivoi :

> Hello folks,
>
>
> Evan, Richard and the whole community as well as Elm language itself do a
> great job in teaching community. If you are staying with this community for
> a long time, you probably already can notice some improvements in your
> understanding of programming, API design, abstractions and etc. How can we
> take it even further?
>
>
> Recently I got an opportunity to share some knowledge about functional
> programming and programming in general. However target audience are
> children (mostly 14-16 y.o.) and I am a little bit stuck. Not only I've
> never been a teacher, but with children I expect it to be even harder
> because of curse of knowledge. On the other hand trying to teach some
> boring basics doesn't feel right, to be interesting it should be kind of
> journey.
>
>
> Previously there was some information about courses in USA where children
> are thought programming with Elm. So I am kindly ask people who are doing
> this to share your experience, tips, tricks and whatever may be helpful. It
> would be even better if you can share some actual 
> content/topics/lessons/exercises.
> If you know exact person, but they are not here, please, provide me with
> contacts.
>
>
> *I am kindly ask you to abstain from discussions and only participate if
> you have something concrete.*
>
>
> Have a nice day!
>
> --
> 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] JS interop and the DOM

2016-10-03 Thread Vojtěch Král
Hi!
  This might be a newbie question but I wasn't able to find anything by 
googling around.
I'd like to use a 3rd party JS library (Cystoscape) that needs to 
initialize on a DOM HTML element where it renders stuff.
However the since the DOM is generated by Elm, I don't know at which point 
to initialize the library.
I'd need some kind of a "DOM ready" event from Elm.
Is there such a thing?

Thanks,
Vojtech

-- 
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] Teaching children Elm

2016-10-03 Thread Fedor Nezhivoi
 

Hello folks,


Evan, Richard and the whole community as well as Elm language itself do a 
great job in teaching community. If you are staying with this community for 
a long time, you probably already can notice some improvements in your 
understanding of programming, API design, abstractions and etc. How can we 
take it even further?


Recently I got an opportunity to share some knowledge about functional 
programming and programming in general. However target audience are 
children (mostly 14-16 y.o.) and I am a little bit stuck. Not only I've 
never been a teacher, but with children I expect it to be even harder 
because of curse of knowledge. On the other hand trying to teach some 
boring basics doesn't feel right, to be interesting it should be kind of 
journey.


Previously there was some information about courses in USA where children 
are thought programming with Elm. So I am kindly ask people who are doing 
this to share your experience, tips, tricks and whatever may be helpful. It 
would be even better if you can share some actual 
content/topics/lessons/exercises. If you know exact person, but they are 
not here, please, provide me with contacts.


*I am kindly ask you to abstain from discussions and only participate if 
you have something concrete.*


Have a nice day!

-- 
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] More than one argument in the receive port call?

2016-10-03 Thread Janis Voigtländer
2016-10-04 2:22 GMT+02:00 Wil C :

> It says to visit http://guide.elm-lang.org/effect_managers/
>

In the next release of the compiler it will correctly tell you to visit
https://guide.elm-lang.org/interop/javascript.html instead.

-- 
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] Re: More than one argument in the receive port call?

2016-10-03 Thread Max Goldstein
Perhaps as a tuple? The values will show up in JavaScript as an array.

If this answer isn't helpful, could you provide a bit more info on what 
you're trying to 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.


[elm-discuss] Re: [ANN] typed-format 1.0.0

2016-10-03 Thread Max Goldstein
Looks like a good package, thanks for contributing!

My feedback is, rather than have functions with many arguments that you 
have to name in the docs, why not take a record instead? You can even 
provide a default.

prettyFloat 

 : { prefix : Maybe String, suffix : Maybe String,
showPos : Bool, sep : Char, decimalPoint : Char, decimalPlace : Int }
-> Format 

 
a (Float -> a)

Also, for prettyFloat, will passing *Just ""* and *Nothing* as the first 
argument produce the same result? If so, it seems like you should drop the 
Maybe.

-- 
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] More than one argument in the receive port call?

2016-10-03 Thread Wil C
 Hi all,

How do you pass back more than one argument in a receive port call? It says 
to visit http://guide.elm-lang.org/effect_managers/, but there's nothing 
there on the topic. I tried something like this:

Port `parseFailure` has an invalid type.


10| port parseFailure : (String -> Int -> msg) -> Sub msg

^

You are saying it should be:


(String -> Int -> msg) -> Platform.Sub.Sub msg


But you need to use the particular format described here:





-- 
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] Re: [ANN] typed-format 1.0.0

2016-10-03 Thread enetsee
Just to save you searching, here is the link to the package 


-- 
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] [ANN] typed-format 1.0.0

2016-10-03 Thread enetsee
Hi
I just published my first Elm package (enetsee/typed-format) and would be 
very grateful for some feedback especially around documentation. 

The package provides a type and combinators for a kind of type-safe 
‘sprintf’ and uses the same technique as @evancz s ‘url-parser’. 

As I said, all feedback welcome!

Regards,

Michael

-- 
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] Re: Re-using validation checks on a form?

2016-10-03 Thread Ian Mackenzie
Looks about right to me, although I might be tempted to switch the order of 
the first two arguments in checkAll - you can then use it as a function 
which takes a list of model -> Bool functions and returns a new model -> 
Bool function (a sort of predicate combinator).

On Tuesday, 4 October 2016 02:10:14 UTC+11, Rupert Smith wrote:
>
> Hi,
>
> I need to put some validation checks on a form, things like
>
> if not (model.password1 == model.password2) then
> Textfield.error <| "Passwords do not match."
>
> but I will also need to re-use those checks to enable/disable the submit 
> button.
>
> So I am thinking pull them out into functions:
>
> checkSomething : model -> Bool
>
> and then have some helper function that lets me combine many checks over 
> the model to a Bool
>
> checkAll : model -> List (model -> Bool) -> Bool
>
> Sound right?
>

-- 
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] Re: Simple Fade In/Out effect?

2016-10-03 Thread Matthew Griffith
In your `Animate animMsg` area, you're not returning the cmds, which is how 
the msg is fired :).

Change your code to this:

Animate animMsg ->
  let 
(newStyle, cmds) = 
  Animation.Messenger.update
animMsg
model.storyTextStyle
  in
 ( { model
| storyTextStyle = newStyle
   }
 , cmds
)



On Monday, October 3, 2016 at 2:09:57 PM UTC-4, Rex van der Spuy wrote:
>
> Thanks everyone, I like these ideas!
>
> Here's what I've got so far - but it's not working... yet! :) 
> Could any of you with more experience with elm-style-animation let me know 
> what I'm doing wrong?
>
> I've imported Animation and Animation.Messener, exposing State:
>
> ```
> import Animation
> import Animation.Messenger exposing (State)
> ```
>
> I created a style for my text called `storyTextStyle`
>
> ```
>  , storyTextStyle : Animation.Messenger.State Msg
>
> , storyTextStyle = 
>   Animation.style
> [ Animation.opacity 1.0
> ]
>
> ```
> I added it to the view, which displays my story output text
>
> ```
> div [ storyCardStyle ] 
> [ p ( Animation.render model.storyTextStyle ++ [ 
> storyParagraphStyle ]) [ text model.storyOutput ] ]
> ```
>
> I have an MDL button that triggers a `FadeInOut` update message:
>
> ```
> , Button.onClick FadeInOut
> ```
>
> The `FadeInOut` message and `Animate` message are in the `update` function:
>
> ``` 
> Animate animMsg ->
>   let 
> (newStyle, cmds) = 
>   Animation.Messenger.update
> animMsg
> model.storyTextStyle
>   in
>  { model
>  | storyTextStyle = newStyle
>  }
>  ! [ ]
>
> FadeInOut -> 
>   let
> newStyle =
>   Animation.interrupt
> [ Animation.to [Animation.opacity 0]
> , Animation.Messenger.send SendStoryComponents
> , Animation.to [Animation.opacity 1]
> ]
> model.storyTextStyle
>   in
>   { model
>   | storyTextStyle = newStyle
>   }
>   ! [ ]
> ```
>
> ... all this compiles and I've tested `FadeInOut` with Debug.crash to make 
> sure it's called - and it is definitely being called when I click the 
> button.
> But, my `SendStoryComponents`, which generates the new text to fade is, is 
> never called.
> Here's `SendStoryComponents` (it uses a port that does some fun stuff with 
> nlp-compromise.js to generate a random story based on user input and story 
> templates)
>
> ```
> SendStoryComponents ->
>   let
> words = 
>   model.words
>
> toList string =
>   String.Extra.clean string
>   |> String.split " "
>
>
> words' =
>   { places = toList model.places 
>   , livingThings = toList model.livingThings
>   , objects = toList model.objects
>   , actions = toList model.actions
>   , moods = toList model.moods
>   }
>
> model' =
>   { model 
>   | words = words'
>   }
>   in
>   (model', sendStoryComponents(model'.words, StoryTemplates.stories))
> ```
> (`SendStoryComponents` does work, if I don't call it through the 
> `FadeInOut` message.)
>
> Can anyone tell by looking at that why `Animation.Messenger.send` might 
> not be calling `SendStoryComponents` ?
>

-- 
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] Elm benchmark

2016-10-03 Thread OvermindDL1



On the elm blog post that was posted recently: 
 http://elm-lang.org/blog/blazing-fast-html-round-two
The benchmark linked at: 
 https://evancz.github.io/react-angular-ember-elm-performance-comparison/
I've repeatedly had results like this in Chrome:



Where the optimized version is showing to be slower than the unoptimized 
version of 0.17.  Talked about it on slack last week and others saw the 
same oddity.


Well after a lot of profiling and testing I think I found the issue, and it 
is not a fault of elm but rather of the testing infrastructure, 
specifically the runner.js times things by using setTimeout like:

```

// time ONE round of asynchronous work

var asyncStart = performance.now();

setTimeout(function() {

var asyncEnd = performance.now();

callback(syncTime, asyncEnd - asyncStart);

}, 0);

```

Well according to the spec (talked about and linked from here 
)
 
it used to be capped to 10ms or higher pre-html5 and starting on html5 it 
is capped to no faster than 4ms (although chrome does 2ms for 0ms callbacks 
in some versions but not others), and the functions run faster than 4ms in 
Elm 0.17, thus it is not actually testing the runtime but rather the 
runtime+timeout period.


In browsers with slower javascript handlers (IE for example), or in 
browsers that do not seem to be following the spec on handler timeouts then 
I see the graph that I expect:




A work-around (from the above link as well) is to use 
`window.postMessage()` instead of `window.setTimeout()` as it is doing now 
as described here .  I 
tried that and got these results in chrome (consistently):





I could not run Angular2 because it apparently does not render whenever it 
is called but rather 'later', thus its time reports were not even accurate 
on the original test.  Significantly different test results though and I am 
not even sure if postMessage works in all corner cases and such either, but 
it does seem to fix the issue in chrome.


Regardless, the 'lazy' calls in Elm 0.17 optimized contribute significantly 
to the speed and this way it is actually visible instead of the unoptimized 
and optimized showing almost identical times.  :-)

-- 
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] Re: Simple Fade In/Out effect?

2016-10-03 Thread Rex van der Spuy
Thanks everyone, I like these ideas!

Here's what I've got so far - but it's not working... yet! :) 
Could any of you with more experience with elm-style-animation let me know 
what I'm doing wrong?

I've imported Animation and Animation.Messener, exposing State:

```
import Animation
import Animation.Messenger exposing (State)
```

I created a style for my text called `storyTextStyle`

```
 , storyTextStyle : Animation.Messenger.State Msg

, storyTextStyle = 
  Animation.style
[ Animation.opacity 1.0
]

```
I added it to the view, which displays my story output text

```
div [ storyCardStyle ] 
[ p ( Animation.render model.storyTextStyle ++ [ 
storyParagraphStyle ]) [ text model.storyOutput ] ]
```

I have an MDL button that triggers a `FadeInOut` update message:

```
, Button.onClick FadeInOut
```

The `FadeInOut` message and `Animate` message are in the `update` function:

``` 
Animate animMsg ->
  let 
(newStyle, cmds) = 
  Animation.Messenger.update
animMsg
model.storyTextStyle
  in
 { model
 | storyTextStyle = newStyle
 }
 ! [ ]

FadeInOut -> 
  let
newStyle =
  Animation.interrupt
[ Animation.to [Animation.opacity 0]
, Animation.Messenger.send SendStoryComponents
, Animation.to [Animation.opacity 1]
]
model.storyTextStyle
  in
  { model
  | storyTextStyle = newStyle
  }
  ! [ ]
```

... all this compiles and I've tested `FadeInOut` with Debug.crash to make 
sure it's called - and it is definitely being called when I click the 
button.
But, my `SendStoryComponents`, which generates the new text to fade is, is 
never called.
Here's `SendStoryComponents` (it uses a port that does some fun stuff with 
nlp-compromise.js to generate a random story based on user input and story 
templates)

```
SendStoryComponents ->
  let
words = 
  model.words

toList string =
  String.Extra.clean string
  |> String.split " "


words' =
  { places = toList model.places 
  , livingThings = toList model.livingThings
  , objects = toList model.objects
  , actions = toList model.actions
  , moods = toList model.moods
  }

model' =
  { model 
  | words = words'
  }
  in
  (model', sendStoryComponents(model'.words, StoryTemplates.stories))
```
(`SendStoryComponents` does work, if I don't call it through the 
`FadeInOut` message.)

Can anyone tell by looking at that why `Animation.Messenger.send` might not 
be calling `SendStoryComponents` ?

-- 
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] I made Elm crash runtime...

2016-10-03 Thread OvermindDL1
Ooo, awesome, I did not know it was finalized yet.  :-)

Hmm, so it looks like it went the way I thought by disallowing adding 
itself to its scope.  It looks like it will resolve mutually recursive 
values too like:
```elm
a = b + 1
b = a - 1
```
As it would fail to sort the top level values with a bad recursion error, 
nice, I was curious if that would be caught too.  :-)


On Monday, October 3, 2016 at 9:59:08 AM UTC-6, Janis Voigtländer wrote:
>
>
> 2016-10-03 17:33 GMT+02:00 OvermindDL1 >:
>
>>  I'm curious which direction will be taken 
>
>
> Your curiosity can be satisfies here: 
> https://github.com/elm-lang/elm-compiler/commit/8b484abfb313f2877403b168e4d7229863f20ba1
>

-- 
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] I made Elm crash runtime...

2016-10-03 Thread Janis Voigtländer
2016-10-03 17:33 GMT+02:00 OvermindDL1 :

>  I'm curious which direction will be taken


Your curiosity can be satisfies here:
https://github.com/elm-lang/elm-compiler/commit/8b484abfb313f2877403b168e4d7229863f20ba1

-- 
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] Re: Is a decoder the right level of abstraction for parsing JSON?

2016-10-03 Thread Kasey Speakman
@DuaneJohnson. I believe the compiler currently looks for ports and makes 
decoders for them. Then when you call a particular port or sub, the decoder 
is called under the covers. Something similar could happen for a 
Json.Decode.auto method, which could infer the type based on the tagger 
function it is invoked with. But it would probably have to be raised to the 
level of a language keyword like with `port` so its usage could be 
controlled enough that the compiler could find it.

@JamesWilson. I like what you're saying there. One slight tweak I'd make is 
to use a Result instead of Maybe. I'd like to know which field failed to 
decode in an error message.

@RupertSmith. I can think of one other case: decoding the same JSON to two 
different models. However, I think if you have a lot of custom rules, 
decoders would have to do. I don't have recursive fields, and I decode 
optional fields to Maybe. If I have multiple related Maybes, then I usually 
change my data model to link them together. Some reasonable defaults would 
fit 95% of my use cases, and I could use decoders for the one-offs.

@RileyEynon-Lynch. That's kindof what I was afraid of in the long term... 
decoders just being ongoing busy work. Coming from other languages, even 
back-end languages, decoding JSON just isn't a thing. Even on the back-end, 
I will setup a reflection-based deserializer with general error handling 
(e.g. Newtonsoft for .NET) and I'm done. The ongoing work is just 
maintaining the data types, which I must do anyway. The back-end 
deserializer does take some initial testing to work out the kinks, but that 
work has an end after which there is no ongoing maintenance.

PSA: There is also a code-gen tool to create decoders from example JSON.

http://noredink.github.io/json-to-elm/

(A little late to the party because I forgot to subscribe to updates.)

On Saturday, October 1, 2016 at 9:36:37 AM UTC-5, Andrew Radford wrote:
>
> Not sure if it has been mentioned but there is this effort to create 
> decoders from swagger definitions:
>
> https://github.com/ahultgren/swagger-elm
>
> Still a work in progress, but looks promising.
>
>  
>
>>
>> A tool that would really help me right now would be a json-schema-to-elm 
>> converter.
>>
>>

-- 
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] DOM Diffing blowing up embedded tweets.

2016-10-03 Thread Robert Cooper
In a chat app I built, I'm using a combination of twitters widget.js and 
ports to allow people to embed tweets into the chat log. This is 
accomplished by having elm create a dom node with a specific ID, and then 
telling widget.js to turn that into a tweet.
In local testing with a few users at once and limited chat activity this 
works fine. However, in production, it seems that when virtual-dom is doing 
a lot of work, with thousands of users, the tweets just disappear after a 
awhile.

I'm having trouble duplicating this issue outside or production, but I was 
hoping that using a keyed html node would prevent this from happening.
Any thoughts? Or is there a better way to use the twitter APIs to embed 
tweets?

Thanks,

-- 
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] Re: Simple Fade In/Out effect?

2016-10-03 Thread OvermindDL1
You can also do it via pure CSS via the 'transition' property, just have 
the old fade out at like 1s time and the new fade in starting at the 1s 
time (or 1.001s to prevent a flicker in some browsers) while flipping 
display:none at the 1s mark (or just deleting it then entirely).  A method 
I like is one where the height is shrunk on the old and grown on the new so 
they seem to flip between each other, which makes it easy to remove the old 
one later without any flickering oddities too.


On Sunday, October 2, 2016 at 6:24:56 AM UTC-6, Oliver Searle-Barnes wrote:
>
> Another option, which avoids having to add anything to your model, would be
>
> ```
> crossFadeTextTo text =
>   Animation.interrupt
> [ Animation.to [Animation.opacity 0]
> , Animation.send (DoneFadingOutOldTextPleaseSwitchModelToNewText text)
> , Animation.to [Animation.opacity 1]
> ]
> ```
>
>
> On Friday, 30 September 2016 21:01:37 UTC+2, Matthew Griffith wrote:
>>
>>
>> That's a pretty reasonable way to do it.  Another option could be could 
>> be to use one div and use `Animation.send`.   Basically you could do 
>> something like this.
>>
>>
>> ```
>> Animation.interrupt
>> [ Animation.to [Animation.opacity 0]
>> , Animation.send DoneFadingOutOldTextPleaseSwitchModelToNewText
>> , Animation.to [Animation.opacity 1]
>> ]
>> ```
>>
>> In this case you'd have to keep new text in a 'staging area' in your 
>> model and then switch it in 
>> when DoneFadingOutOldTextPleaseSwitchModelToNewText fires.
>>
>>
>> On Friday, September 30, 2016 at 2:30:53 PM UTC-4, Rex van der Spuy wrote:
>>>
>>> Hi Everyone!
>>>
>>> Just a quick question: Can anyone suggest a simple way to fade out some 
>>> old text and fade in some new text when a `model.text` value changes?
>>>
>>> I did this once a few apps ago where I created 2 `div` layers: 
>>> `currentText` and `previousText`
>>> Then, when the text value changed, I moved the text to the previousText 
>>> layer and faded it out, and then displayed the updated text on the 
>>> currentText layer and faded it in.
>>> (I used `elm-html-animation` for the fade effect.)
>>>
>>> Does this seem reasonable or is there a better, easier way?
>>>
>>

-- 
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] Re: elm-make behavior different between localhost dev and production

2016-10-03 Thread OvermindDL1
Unless someone says otherwise that does sound like a bug and should be 
reported.  I've always thought it was case sensitive as I use linux and 
even on Windows it yells at me with such a warning if not a precise match 
(although that might be cygwin'isms).


On Saturday, October 1, 2016 at 1:07:19 PM UTC-6, Wil C wrote:
>
> UGH. I figured out what it was. Elm modules with multiple words are 
> camelcased, and so should the filenames. 
>
> On localhost (mac), it's not case sensitive. code_fragment compiles module 
> CodeFragment. But on production (ubuntu) it is.
>
> Should I submit an issue ticket on getting a warning or error when 
> compiling when the name of module doesn't match with filename?
>
> Wil
>
> On Thursday, September 29, 2016 at 2:40:04 PM UTC-7, OvermindDL1 wrote:
>>
>> Not really, exrm is pretty easy (I've not migrated to distillery yet, I 
>> have an old project), but I did find 
>> https://github.com/epsanchezma/exrm-heroku although it appears pretty 
>> old but could try it, if it works then exrm could deploy straight to heroku.
>>
>>
>> On Thursday, September 29, 2016 at 2:06:49 PM UTC-6, Wil C wrote:
>>>
>>> I checked on both, and they're both elm 0.17.1
>>>
>>> [ruby-2.2.0 ~/projects/code/pithy  master]
  > elm -v
 0.17.1
 [ruby-2.2.0 ~/projects/code/pithy  master]
  > heroku run "elm -v"
 Running elm -v on ⬢ pithy... up, run.5500
 0.17.1
>>>
>>>
>>> Yeah, I'm using Phoenix. Ah, I just wanted something simple to get up 
>>> and running, so I didn't mess around with exrm or distillery. When I have 
>>> more time, I'll get that going instead. Got any tips or links to a write up 
>>> on how to package it up in exrm/distillery and throw it on heroku?
>>>
>>>
>>> Wil
>>>
>>>
>>>
>>> On Thursday, September 29, 2016 at 7:19:31 AM UTC-7, OvermindDL1 wrote:

 Hmm, I use the same type of setup with the same type of arguments as 
 you though I've not tried heroku.  Is the elm version between your dev 
 machine and heroku the same?  It looks like you might be using phoenix, 
 you 
 really should be generating a production output of all files on your dev 
 server so that manifests are built, code is optimized, and everything is 
 packed together into a release (via exrm or distillery) and you should 
 deploy that release to heroku instead as it is entirely self-contained and 
 standalone.  I use the release process and never had an issue.


 On Thursday, September 29, 2016 at 3:06:55 AM UTC-6, Wil C wrote:
>
> Hi all,
>
> I have a puzzling situation that I hope someone can shed some light 
> on. I'm using elm with elixir, and compiling it with elm-brunch. I'm able 
> to 'brunch build' without a problem locally, but on the remote heroku 
> servers, I get the following problem:
>
> remote:Running default compile
>> remote:Elm compile: src/rei.elm, in web/elm, to 
>> ../static/vendor/rei.js
>> remote:*I cannot find module 'Codefragment'.*
>> remote:
>> remote:Module 'Rei' is trying to import it.
>> remote:
>> remote:Potential problems could be:
>> remote:  * Misspelled the module name
>> remote:  * Need to add a source directory or new dependency 
>> to elm-package.json
>> remote:29 Sep 08:42:47 - error: Compiling of 
>> web/elm/src/rei.elm failed. Command failed: 
>> ../../node_modules/elm/binwrappers/elm-make --yes --output 
>> ../static/vendor/rei.js src/rei.elm
>> remote:I cannot find module 'Codefragment'.
>> remote:
>> remote:Module 'Rei' is trying to import it.
>> remote:
>> remote:Potential problems could be:
>> remote:  * Misspelled the module name
>> remote:  * Need to add a source directory or new dependency 
>> to elm-package.json
>> remote: 
>
>
> I checked that the source_directories are set. my elm-package.json is:
>
>
> {
>> "version": "1.0.0",
>> "summary": "helpful summary of your project, less than 80 
>> characters",
>> "repository": "https://github.com/user/project.git";,
>> "license": "BSD3",
>> 
>>
>> *"source-directories": ["src"],*
>> "exposed-modules": [],
>> "dependencies": {
>> "elm-lang/core": "4.0.5 <= v < 5.0.0",
>> "elm-lang/html": "1.1.0 <= v < 2.0.0"
>> },
>> "elm-version": "0.17.1 <= v < 0.18.0"
>> }
>
>
> All the elm files are under web/elm/src. my brunch's config files for 
> elm is:
>
>   plugins: {
>> elmBrunch: {
>>   elmFolder: "web/elm",
>>   
>>
>> *mainModules: ["src/rei.elm"  ],*
>>   outputFolder: "../static/vendor",
>>   executablePath: "../../node_modules/elm/binwrappers"
>> 

Re: [elm-discuss] I made Elm crash runtime...

2016-10-03 Thread OvermindDL1
As a comparison, this is how OCaml handles the same issue.  OCaml uses 
built namespaces, meaning you can only use what was defined before you 
first of all, and if you want something to be able to refer to itself or 
something later on then you need to mark it explicitly

```
let v = v + 1
```

In Ocaml generates the error:
```
Line 1, 8: Error: Unbound value v
```

And even if you mark it as hoisting it to be bound in its own namespace via:
```
let rec v = v + 1
```

That is still not allowed because a value cannot reference itself:
```
Line 1, 12: Error: This kind of expression is not allowed as right-hand 
side of `let rec'
```

However, if it were a function (`()` is just an empty tuple, a convenient 
no-arg argument):
```
let rec v () = (v ()) + 1
```

Then that compiles, and as expected it will recurse forever if called.  ^.^

That is what I want Elm to do.  :-)


For an explanation of how/why this issue is possible at all, do feel free 
to ignore this section, but all of the examples you gave stem from the same 
problem, which is caused by two design decisions hitting each other, the 
first of which is because Elm uses a unified namespace, meaning you can 
define anything anywhere in a file, value or function, where in OCaml it 
has to be in order, but even in OCaml by using `let rec` and `and` you can 
do the same namespacing style as Elm and it will still not allow recursive 
values, but again that is because of the way Elm handles function, which is 
the second reason; in OCaml a binding is either a value (never recursive) 
or a function (and a function is also always 1 input to 1 output, although 
the output can be another function), Elm acts more like that everything is 
a function hence why a 'value' like `v = v + 1` is possible, it acts like a 
function of zero arguments that can then call itself, so that is more equal 
to OCaml's `let rec v () = (v ()) + 1`, however Elm still compiles it to a 
value, specifically it compiles it to, in javascript, `var 
_user$testProject$TestProject$v = _user$testProject$TestProject$v + 1`, 
where javascript has an OCaml-like built namespace, thus things can only 
reference what was built prior to it, however javascript has the oddity 
where when a `val` is defined the 'name' is bound before it is given a 
value (like a `let rec` in OCaml without the `and`, to be able to be used 
for recursive function calls, however this means that when the name is 
defined it is set to 'undefined' as it has not yet been defined even though 
it has been bound (like doing `var v` by itself), thus `var v = v + 1` is 
equal to doing `var v = undefined + 1`, which becomes `var v = NaN`.  This 
is fixable in Elm in a few ways, such as by perhaps separating zero-arg 
function to n-arg functions in the compiler, or by changing how namespacing 
works, either would fix this particular issue (although I do wish it would 
change both).  I'm curious which direction will be taken as it will change 
some semantics about the language as a whole (though changing the 0-arg 
function/value handling to not bound a name before usage would be a less 
noticeable change, I do wish the namespace would change to a built 
namespace, although that means that 'main' would always be at the bottom of 
a file then so I do not see this change happening).


On Friday, September 30, 2016 at 2:13:31 PM UTC-6, J. E. Marca wrote:
>
>
>
> On Friday, September 30, 2016 at 12:46:25 PM UTC-7, Noah Hall wrote:
>>
>> This is a known issue. See this -> 
>> https://github.com/elm-lang/elm-compiler/issues/873 
>>
>> Sorry for the noise then. 
>  
>
>> It will be fixed in 0.18. 
>>
>>
> Oh cool.  I'll read up on the fix and see how it was/will be done. 
>  
> Regards,
> James
>

-- 
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] Re-using validation checks on a form?

2016-10-03 Thread 'Rupert Smith' via Elm Discuss
Hi,

I need to put some validation checks on a form, things like

if not (model.password1 == model.password2) then
Textfield.error <| "Passwords do not match."

but I will also need to re-use those checks to enable/disable the submit 
button.

So I am thinking pull them out into functions:

checkSomething : model -> Bool

and then have some helper function that lets me combine many checks over 
the model to a Bool

checkAll : model -> List (model -> Bool) -> Bool

Sound right?

-- 
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] A library for manipulating Font Awesome icons

2016-10-03 Thread 'Rolf Sievers' via Elm Discuss
Greetings everyone!

I am new to Elm and currently working on a small project using Font Awesome 
icons. I moved those icons to a separate library and coaxed elm-package 
into publishing it. The idea is to wrap the icons in an opaque Icon class. 
To insert it in your view use toHtml : Icon -> Html msg. Wrapping icons in 
an extra type has one key advantage: You can modify the intermediate icon 
before turning it into Html.


import FontAwesome exposing (Icon, toHtml)import FontAwesome.Icons as Fa

import FontAwesome.Modifiers as FaMod
myIcon =
  Fa.birthday_cake
|> FaMod.double
|> FaMod.rotate90
|> toHtml


The FontAwesome.Modifier exposes several Icon -> Icon functions which can 
be applied in a piping style.

http://package.elm-lang.org/packages/roSievers/font-awesome/1.0.0/



I would love some feedback on my first package!




For comparison, there are two other libraries currently offering Font 
Awesome as well.

jystic/elm-font-awesome

Gives vector graphics instead of html.


Fresheyeball /elm-font-awesome 
 

Well, I totally didn't anticipate that. When I started writing this 
announcement I wanted to copy in jystic/elm-font-awesome only to find out 
that a new package had popped up.

>From what I understand, this package skips the intermediate Icon type and 
directly returns a Html msg. I.e. it has no parallel to 
FontAwesome.Modifiers.

-- 
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] Re: Feedback of a new learner

2016-10-03 Thread Thomas Alexander Vaags
Routing in Elm seems a bit clunky at the moment, especially if you have a 
lot of routes.

For a secured web-app, where one normally would not share or bookmark 
specific pages (and not use the back-button) -- you could consider dropping 
routing altogether.

On Monday, October 3, 2016 at 9:34:33 AM UTC+2, Peter Damoc wrote:
>
> NoRedInk codebase is closer to the approach described in 
> http://elm-lang.org/blog/how-to-use-elm-at-work
> The Elm components are integrated in a larger app. 
> I think they have something like 50k LOC of Elm so that approach scales 
> quite nicely. 
>
> As for scaling TEA in an app that has 100+ routes,  the architecture can 
> scale but it might make sense to split the functionality across multiple 
> apps due to size of the deliverable.
> If it is an internal app that is served from an internal server, then even 
> this is less important. 
>
> It is worth noting that the 100+ routes from the above are understood as 
> pages with distinct functionality NOT pages that have the same 
> functionality but different content. If the later is the case, elm can 
> scale with ease and efficiency. 
>
>
>  
>
>
>
>
>
> On Mon, Oct 3, 2016 at 10:09 AM, Thomas Alexander Vaags <
> thomas...@gmail.com > wrote:
>
>> There have been some attempts. Apparently NoRedInk has a large 
>> elm-application in production. But as this is not an opensource-project 
>> (afaik), we cannot learn from the source code.
>>
>> For me, as a beginner in Elm, it's difficult to see how TEA (the elm 
>> architecture) can scale *nicely* into an app with, say, 100+ routes / 
>> pages.
>>
>> On Monday, October 3, 2016 at 4:40:08 AM UTC+2, Nathan Feaver wrote:
>>>
>>> Thanks for the response Charlie.
>>>
>>> I hadn't realized that there hadn't already been attempts to make a 
>>> larger scale SPA in Elm. Your lessons learned will definitely be of 
>>> interest to me. I was suggesting that some rules of thumb be put into the 
>>> guide for larger applications but I guess we haven't got rules of thumb yet!
>>>
>>> On Saturday, October 1, 2016 at 12:28:20 PM UTC-6, Nathan Feaver wrote:

 Hi everyone!

 Often it is helpful for me to hear the experience from someone who is 
 just learning how to use my software. I think the same is probably true of 
 programming languages so I thought I would share my story of learning Elm 
 with you.

 The Good Parts

 I started looking at Elm about a week and a half ago and have probably 
 spent 20 hours reading and watching Elm content and writing Elm code. I 
 found out about Elm because I have been interested in Elixir and stumbled 
 into this conference talk by Rob Martin, *Teaching functional 
 programming to noobs* (Lambda Days 2016) 
 . I jumped straight into 
 writing code using Exercism.io exercises. I copied code I saw in examples 
 but couldn't get too far. I watched Richard Feldman's *Introduction to 
 Elm*  and Evan's Let's be 
 Mainstream . Those two 
 talks and occasionally looking up core library docs got me far enough that 
 I could get through a good number of the Exercism exercises. I was 
 impressed that the language was so intuitive, that error messages were 
 sooo 
 good, that currying was easy, and that using types was both terse and 
 descriptive at the same time.

 I started working on updating a small personal project and realized I 
 needed to understand 'The Elm Architecture' so I've been working through 
 the tutorial with my remaining time in Elm. So far, the tutorial is great 
 and progresses at a good speed.

 The Rough Edges

 I had a difficult time figuring out where to go for good documentation. 
 Everything was spread out among multiple resources. My first experience 
 was 
 looking at elm-lang.org/docs where I found a dozen or so links that 
 point to 5 different domains/subdomains. If I had come to Elm without 
 hearing strong praise from a respected programmer then I'm not sure I 
 would 
 kept going. The disorder of the documentation gives the sense that Elm is 
 a 
 hobby language rather than production-ready. Elixir handles these concerns 
 very well: Commonly used libraries have a consolidated guide 
  and 
 documentation  within a single click 
 of the language's homepage.

 Questions I have at this point (that would help me to know if Elm is 
 worth continuing to invest in): How does 'The Elm Architecture' work with 
 larger applications? I've seen some examples like the Todo app and the 
 Flatris clone that have a high-ish number of actions that the app responds 
 to in `update`. What about an app that spans m

[elm-discuss] Re: meaning of ![] ?

2016-10-03 Thread Magnus Rundberget
http://faq.elm-community.org/17.html#what-is-this---construct-in-the-code

+ when using it with an empty list it would return (model, Cmd.none). 

-magnus


On Monday, 3 October 2016 12:43:41 UTC+2, António Ramos wrote:
>
> hello
> sorry my simple question
> NoOp ->
> model ! []
>
> what does ![] mean in the above code? 
>
> regards
>

-- 
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] Elm process with Web Workers

2016-10-03 Thread Craig Bilner
Hi,

http://package.elm-lang.org/packages/elm-lang/core/4.0.5/Process looks 
really interesting but perhaps I don't fully understand it's intention.

The docs say:

So even though JS runs within a single OS-level thread, Elm can still run 
> things concurrently


but when I look at the code, it uses the Native scheduler which sticks 
things on a queue using setTimeout to put things on the end of the event 
loop but I was surprised to not see any Web Worker code or any issues 
relating to it?

Process looks to be the perfect area for providing concurrency *and* 
parallelism through Web Workers either running stand-alone or talking to 
each other probably using promises to manage them? They are already 
libraries in this domain that provide thread pools as prior art. 
e.g. https://github.com/andywer/threadpool-js. Obviously this is just for 
front-end Elm rather than the nod to Node further down.

What do you think?

Thanks

-- 
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] meaning of ![] ?

2016-10-03 Thread António Ramos
hello
sorry my simple question
NoOp ->
model ! []

what does ![] mean in the above code?

regards

-- 
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] Re: Modeling a domain with complex data access constraints

2016-10-03 Thread Wouter In t Velt
Hi Spencer, In an Elm app I am building I ran into similar challenges.
The principles which work well for me in model design:

   - Flat is better than nested (for relational stuff, such as your courses)
   - One source of truth = a normalized model without duplication of data
   - Connect data for viewing in your views.

So I would "normalize" your model as below:

   - Put sessions in your model at top level: you want to access the 
   sessions directly
   - For parent-child-like relations (like course-session), only include 
   the parent Id in the child.

E.g. Course type does not need a list of sessions: this info is stored in 
the sessions (which also contain course Id).

In your views, retrieve from your model the info that you need, e.g. 
getting the names of the tutors.

I would personally not qualify a UserId of someone else as something that 
the user is not supposed to see: it is a data Id for connecting 2 records.
Still, if you really want the user not to see Id of who is enrolled, you 
can include that in your model as a Registration type.

The real trick is probably to selectively populate this model in 
client-server communication: make your API only provide those Users, 
Sessions, Courses to which the particular user has access.


type alias Model =
  { me : Maybe UserId
  , users : Dict UserId User
  , courses : Dict CourseId Course
  , sessions : Dict SessionId Session
  }

type alias User =
  { name : String
  , id : UserId
  , role : UserRole
  }
  
type UserRole =
  Admin
  | Faculty
  | Student

type alias Course =
  { id : CourseId
  , name : String
  , instructor : UserId
  }

type alias Session =
  { id : SessionId
  , course : CourseId
  , time : Date
  , tutor : UserId
  , location : String
  , registration : Registration
  }

type Registration = 
  Available
  | Registered
  | RegisteredBy UserId


-- 
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] Re: Feedback of a new learner

2016-10-03 Thread Peter Damoc
NoRedInk codebase is closer to the approach described in
http://elm-lang.org/blog/how-to-use-elm-at-work
The Elm components are integrated in a larger app.
I think they have something like 50k LOC of Elm so that approach scales
quite nicely.

As for scaling TEA in an app that has 100+ routes,  the architecture can
scale but it might make sense to split the functionality across multiple
apps due to size of the deliverable.
If it is an internal app that is served from an internal server, then even
this is less important.

It is worth noting that the 100+ routes from the above are understood as
pages with distinct functionality NOT pages that have the same
functionality but different content. If the later is the case, elm can
scale with ease and efficiency.








On Mon, Oct 3, 2016 at 10:09 AM, Thomas Alexander Vaags <
thomas.va...@gmail.com> wrote:

> There have been some attempts. Apparently NoRedInk has a large
> elm-application in production. But as this is not an opensource-project
> (afaik), we cannot learn from the source code.
>
> For me, as a beginner in Elm, it's difficult to see how TEA (the elm
> architecture) can scale *nicely* into an app with, say, 100+ routes /
> pages.
>
> On Monday, October 3, 2016 at 4:40:08 AM UTC+2, Nathan Feaver wrote:
>>
>> Thanks for the response Charlie.
>>
>> I hadn't realized that there hadn't already been attempts to make a
>> larger scale SPA in Elm. Your lessons learned will definitely be of
>> interest to me. I was suggesting that some rules of thumb be put into the
>> guide for larger applications but I guess we haven't got rules of thumb yet!
>>
>> On Saturday, October 1, 2016 at 12:28:20 PM UTC-6, Nathan Feaver wrote:
>>>
>>> Hi everyone!
>>>
>>> Often it is helpful for me to hear the experience from someone who is
>>> just learning how to use my software. I think the same is probably true of
>>> programming languages so I thought I would share my story of learning Elm
>>> with you.
>>>
>>> The Good Parts
>>>
>>> I started looking at Elm about a week and a half ago and have probably
>>> spent 20 hours reading and watching Elm content and writing Elm code. I
>>> found out about Elm because I have been interested in Elixir and stumbled
>>> into this conference talk by Rob Martin, *Teaching functional
>>> programming to noobs* (Lambda Days 2016)
>>> . I jumped straight into
>>> writing code using Exercism.io exercises. I copied code I saw in examples
>>> but couldn't get too far. I watched Richard Feldman's *Introduction to
>>> Elm*  and Evan's Let's be
>>> Mainstream . Those two
>>> talks and occasionally looking up core library docs got me far enough that
>>> I could get through a good number of the Exercism exercises. I was
>>> impressed that the language was so intuitive, that error messages were sooo
>>> good, that currying was easy, and that using types was both terse and
>>> descriptive at the same time.
>>>
>>> I started working on updating a small personal project and realized I
>>> needed to understand 'The Elm Architecture' so I've been working through
>>> the tutorial with my remaining time in Elm. So far, the tutorial is great
>>> and progresses at a good speed.
>>>
>>> The Rough Edges
>>>
>>> I had a difficult time figuring out where to go for good documentation.
>>> Everything was spread out among multiple resources. My first experience was
>>> looking at elm-lang.org/docs where I found a dozen or so links that
>>> point to 5 different domains/subdomains. If I had come to Elm without
>>> hearing strong praise from a respected programmer then I'm not sure I would
>>> kept going. The disorder of the documentation gives the sense that Elm is a
>>> hobby language rather than production-ready. Elixir handles these concerns
>>> very well: Commonly used libraries have a consolidated guide
>>>  and
>>> documentation  within a single click
>>> of the language's homepage.
>>>
>>> Questions I have at this point (that would help me to know if Elm is
>>> worth continuing to invest in): How does 'The Elm Architecture' work with
>>> larger applications? I've seen some examples like the Todo app and the
>>> Flatris clone that have a high-ish number of actions that the app responds
>>> to in `update`. What about an app that spans multiple pages and should
>>> respond to hundreds of actions? Would you split the app into many small
>>> apps? If so, would there be a parent app that delegates actions? Also, can
>>> I use `The Elm Architecture` and Commands/Subscriptions outside of the HTML
>>> world? I think it would be helpful to answer these questions at some point
>>> in the documentation.
>>>
>>>
>>> Hopefully this ends up being useful. Overall, I have really enjoyed
>>> using the language and will continue to write Elm code in my free ti

[elm-discuss] Re: Feedback of a new learner

2016-10-03 Thread Thomas Alexander Vaags
There have been some attempts. Apparently NoRedInk has a large 
elm-application in production. But as this is not an opensource-project 
(afaik), we cannot learn from the source code.

For me, as a beginner in Elm, it's difficult to see how TEA (the elm 
architecture) can scale *nicely* into an app with, say, 100+ routes / pages.

On Monday, October 3, 2016 at 4:40:08 AM UTC+2, Nathan Feaver wrote:
>
> Thanks for the response Charlie.
>
> I hadn't realized that there hadn't already been attempts to make a larger 
> scale SPA in Elm. Your lessons learned will definitely be of interest to 
> me. I was suggesting that some rules of thumb be put into the guide for 
> larger applications but I guess we haven't got rules of thumb yet!
>
> On Saturday, October 1, 2016 at 12:28:20 PM UTC-6, Nathan Feaver wrote:
>>
>> Hi everyone!
>>
>> Often it is helpful for me to hear the experience from someone who is 
>> just learning how to use my software. I think the same is probably true of 
>> programming languages so I thought I would share my story of learning Elm 
>> with you.
>>
>> The Good Parts
>>
>> I started looking at Elm about a week and a half ago and have probably 
>> spent 20 hours reading and watching Elm content and writing Elm code. I 
>> found out about Elm because I have been interested in Elixir and stumbled 
>> into this conference talk by Rob Martin, *Teaching functional 
>> programming to noobs* (Lambda Days 2016) 
>> . I jumped straight into 
>> writing code using Exercism.io exercises. I copied code I saw in examples 
>> but couldn't get too far. I watched Richard Feldman's *Introduction to 
>> Elm*  and Evan's Let's be 
>> Mainstream . Those two 
>> talks and occasionally looking up core library docs got me far enough that 
>> I could get through a good number of the Exercism exercises. I was 
>> impressed that the language was so intuitive, that error messages were sooo 
>> good, that currying was easy, and that using types was both terse and 
>> descriptive at the same time.
>>
>> I started working on updating a small personal project and realized I 
>> needed to understand 'The Elm Architecture' so I've been working through 
>> the tutorial with my remaining time in Elm. So far, the tutorial is great 
>> and progresses at a good speed.
>>
>> The Rough Edges
>>
>> I had a difficult time figuring out where to go for good documentation. 
>> Everything was spread out among multiple resources. My first experience was 
>> looking at elm-lang.org/docs where I found a dozen or so links that 
>> point to 5 different domains/subdomains. If I had come to Elm without 
>> hearing strong praise from a respected programmer then I'm not sure I would 
>> kept going. The disorder of the documentation gives the sense that Elm is a 
>> hobby language rather than production-ready. Elixir handles these concerns 
>> very well: Commonly used libraries have a consolidated guide 
>>  and 
>> documentation  within a single click 
>> of the language's homepage.
>>
>> Questions I have at this point (that would help me to know if Elm is 
>> worth continuing to invest in): How does 'The Elm Architecture' work with 
>> larger applications? I've seen some examples like the Todo app and the 
>> Flatris clone that have a high-ish number of actions that the app responds 
>> to in `update`. What about an app that spans multiple pages and should 
>> respond to hundreds of actions? Would you split the app into many small 
>> apps? If so, would there be a parent app that delegates actions? Also, can 
>> I use `The Elm Architecture` and Commands/Subscriptions outside of the HTML 
>> world? I think it would be helpful to answer these questions at some point 
>> in the documentation.
>>
>>
>> Hopefully this ends up being useful. Overall, I have really enjoyed using 
>> the language and will continue to write Elm code in my free time and look 
>> for ways to use it professionally. Thanks for listening!
>>
>

-- 
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.