[elm-discuss] Re: Elm feasibility for large, complex desktop browser application with dependencies on many newer web APIs

2017-10-11 Thread Rex van der Spuy


> Does anyone have experiences to share around using Elm in the context of a 
> great number of complex platform and js dependencies? How involved would it 
> be to abstract these non-elm dependencies behind ports? Is there a tool 
> analogous to caniuse.com that would let me easily figure out which 
> platform APIs have already been packaged up nicely for elm usage?
>

My experience has been that the complexity of managing all those moving 
parts could be greater than the benefits of using Elm.
It it were my project, I would probably just leave things as is and squash 
as many bugs as you can until things stabilize a bit.
But if you are considering a total re-write - maybe try it with Elm?

(By the way, I have used pdfjs in an Elm project through ports and it 
worked just fine.)

-- 
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: Tour of an open-source 4,000 LoC Elm SPA

2017-05-24 Thread Rex van der Spuy



> If I have the choice between using Webpack and not using Webpack, I 
> gravitate towards not using Webpack. It hasn't exactly been the most 
> delightful piece of software I've ever used. ;)
>

Ahmen, Bro! 

-- 
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] New guidelines for posting on Elm-discuss

2017-05-07 Thread Rex van der Spuy


On Sunday, May 7, 2017 at 1:06:14 AM UTC-4, Dave Rapin wrote:
>
> The problem with slack is that discussions are lost after you hit their 
> limit (which wasn't terribly high last time I checked). So instead of 
> finding / googling for an answer / question that had previously been 
> covered, you must ask again, which is of course async and therefor more 
> time consuming.
>
> I don't mean to seem anti-social, but if I'm in the middle of solving a 
> problem and run into an issue, I reach for Google way before I'd post on 
> Slack. Slack just feels like a black hole where information goes to die.
>

I agree 100%.
The other problem is that there are so many channels that you never know 
where to post your question.
And, you have to hope there is someone online at that very moment with the 
skills or interest to help you, otherwise your question scrolls away into 
eternity.
So far, I've found Reddit to be the best forum for Elm Q&A - questions 
always net some big fish and petty quibbles get down-voted out of the 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.


Re: [elm-discuss] Re: Scaling Elm

2017-05-03 Thread Rex van der Spuy


On Monday, May 1, 2017 at 1:33:27 PM UTC-4, Peter Damoc wrote:
>
>  a lovely but exhausting 4 days tango festival. 
>

That's awesome :) 

-- 
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: Moving on

2017-04-26 Thread Rex van der Spuy
On Wednesday, April 26, 2017 at 5:07:39 AM UTC-4, Wojtek Piekutowski wrote:
>
>
>  https://github.com/elm-lang/persistent-cache?
>

 Wow, that's exactly what I need!

-- 
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: elmvm (Elm Version Manager)

2017-04-05 Thread Rex van der Spuy

Thanks so much, this is really useful!
I've have quite a few projects that are in different versions of Elm, and 
migrating them all en-masse to the latest version is always a chore.
It will be great to go back and an compile them in 0.17 and 0.16 again! :)

-- 
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: TypedSvg

2017-03-31 Thread Rex van der Spuy


> Duane, I've been waiting for something like this for a while. Thanks for 
> undertaking the tedium of translating the entire SVG spec and giving it a 
> nice, typed interface. Will take a closer look when I get a chance.
>

Yeah, it's really great, 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: Debugger becomes useless with time and mouse movement events

2017-03-27 Thread Rex van der Spuy


>
> Try this one, it has a filter feature:
>
> http://package.elm-lang.org/packages/jinjor/elm-time-travel/latest
>

Thanks, I needed that too! :)
For working on real time games which update 60 times per second this is a 
huge help!

-- 
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: Unsafe mechanism

2017-03-14 Thread Rex van der Spuy


On Monday, March 13, 2017 at 5:06:44 AM UTC-4, Oliver Searle-Barnes wrote:
>
> What if unsafe because a first class concept in Elm? You could mark 
> functions as "unsafe". Any function that calls an unsafe function would 
> also be required to be declared as unsafe  e.g.
>

I use Elm entirely because of it's reliability, and would be very unhappy 
to risk this for a bit of convenience. 
In fact, I even wish ports would go away ;) The only unreliability I've 
every had working with Elm was due to the unreliable JS code I was 
interfacing with through ports.
Oh, the happy day when the entire Internet is written in Elm 

-- 
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's compiler is trying to import a module that doesn't exist...?

2017-03-13 Thread Rex van der Spuy


Try `elm package install elm-lang/core`.
>
>
Thanks, I'll try that next time this happens.
I eventually solved this by re-installing Elm from scratch. 

-- 
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: webpack hotloading: compile errror leads to loss of state

2017-02-25 Thread Rex van der Spuy
This isn't really a "solution" to your problem, but because I had endless 
frustrating headaches with elm-webpack-starter I switched to the much 
simpler elm-live:

https://github.com/tomekwi/elm-live

and create-elm-app:

https://github.com/halfzebra/create-elm-app/blob/master/template/README.md


On Saturday, February 25, 2017 at 11:56:59 AM UTC-5, Simon wrote:
>
> I have tried webpack directly and some of the starters, but I can't find a 
> way to use hotloading after making a change that led to a compiler error. 
> It only works if you write perfect code and recompile. If you have an 
> error, then when these have been fixed the page reloads with the default 
> state.
>
> Are there any solutions for 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.com/d/optout.


[elm-discuss] Re: Is Elm weekly still up?

2017-02-19 Thread Rex van der Spuy
I noticed that two.
While it was running it was absolutely the best source for what's happening 
in the Elm World.
>
>

-- 
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] How can you find out why JSON decoding failed?

2017-02-17 Thread Rex van der Spuy
Thank you Overmind!

-- 
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] How can you find out why JSON decoding failed?

2017-02-17 Thread Rex van der Spuy
Oops!! Ignore the error above!
It works now completely!!!

I just had another stray Debug.crash in my code that I had forgotten about 
so I removed it.

Thanks so much Peter, I could not have done this without your help

-- 
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] How can you find out why JSON decoding failed?

2017-02-17 Thread Rex van der Spuy
Yes - how would I get the Err result?

-- 
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] How can you find out why JSON decoding failed?

2017-02-17 Thread Rex van der Spuy
Hi Everyone!

I'm trying to decode some JSON from localStorage.
I'm able to load the JSON into my Elm app but the decoding is failing 
silently.
Is there some way to find why decoding didn't succeed?

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: [ANN] Ellie - the Elm platform in the browser

2017-02-13 Thread Rex van der Spuy
Totally awesome and wonderful

-- 
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: Generating reports for printing

2017-01-30 Thread Rex van der Spuy
Hi Rory,

I've just done this!
I've been working on a series of guided essay writing applications where 
the output is both Word and PDF.
I ended up going through ports and generating the PDF using pdfMake:

https://github.com/bpampuch/pdfmake

And this parser:

http://jsfiddle.net/mychn9bo/75/

pdfMake is incredibly configurable - I believe it allows you to set 
specific line breaks ?

These were the steps I followed to get my content out of Elm an turn it 
into a printable, downloadable PDF doc:

1. I sent my content from Elm though a port as a string of markdown text.
2. I formatted it as HTML on the JS side using marked.js (that's because 
pdfMake needs the text to be in HTML format)
3. I ran the newly HTML-ized content though a slightly modified version of 
the parser linked above.
4. And finally sent the parsed content to pdfMake's `createPdf` method.

It's a little bit of work - but not too bad and definitely worth it!

Cheers,
Rex

PS: Word output requires something else... just let me know if you ever 
need to do that.

-- 
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: I wish ELM could just be used in the browser

2017-01-28 Thread Rex van der Spuy
I am totally wrong, but my opinion is that Elm is being designed to be a 
long-term replacement for entire HTML/CSS/JS stack - also lovingly known as 
the Hairball-Of-Hell, (or, just Hoh!)
There are a gazillion JS libraries for doing JS things in a 
nicer-than-average JS way (React, Redux, Ember, Angular, Vue, etc, etc, 
etc, etc,)
If you like that kind of thing - go ahead and use them, nothing is stopping 
you!

But Elm is not trying to compete with those - instead it's founded an 
entire New World - a new Planet - built on completely new foundations.
It's for those of use who have discovered that developing with the 
Hairball-of-Hell is possibly the worst form of punishment ever devised by 
those Old World mavens of medieval torture.
We're trying to turn the page on all that and build a beautiful fresh new 
future for a whole new generation of developers to build on.
If that means ports and JSON decoders - I can live with that :)
 





On Saturday, January 28, 2017 at 9:53:02 AM UTC-5, Wyatt Benno wrote:
>
> I love ELM to work with, but it is too bad it cannot be more direct. I had 
> a project come up where ELM could have been used in production but React 
> won because it is just js, browser read, and very easy for anyone to start. 
> Import React start using it anywhere with or without ports. i wish I could 
> import elm in the same way. Any plans for 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.com/d/optout.


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

2017-01-27 Thread Rex van der Spuy


On Friday, January 27, 2017 at 12:36:38 AM UTC-5, Gage Peterson wrote:
>
> Totally agree. Reddit here I come. 
>
> Also, I feel we really need to treat Evan like the awesome leader he is. 
> Give the guy a break. He's making one of the best languages I've ever used.
>

Triple +++
Elm is the only language/software project that I know if where each new 
release is about r*emoving features* and *increasing simplicity*.
That's astonishing - Bravo!
And, extremely wise, long-term decisions are made that are right for the 
language, without being distracted by the current coding fashions of the 
moment.
Elm doesn't ever need to be mainstream - it just needs to be the best 
language it can be for the people like us who love using it.
Evan has completely won my trust over the year and half I've been using 
Elm, so whatever he recommends, I'm in! :)
And, I hope he always remains the sole maintainer and developer of the 
language, because, frankly, I just don't trust anyone else :)

-- 
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: Emphasizing /r/elm more

2017-01-25 Thread Rex van der Spuy


On Monday, January 23, 2017 at 9:45:56 PM UTC-5, Richard Feldman wrote:
>
> Worth noting that the top thread on elm-discuss for several weeks 
> 
>  
> has been largely about languages other than Elm, and the Elm-specific parts 
> have primarily consisted of lobbying Evan for reprioritization through a 
> frustrating mix of misinformation and wild speculation. I don't see a way 
> to avoid beginners clicking through and being misinformed by what's being 
> said there, other than responding myself, which further contributes to its 
> being bumped to the top of the list.
>

I totally agree, elm-discuss is a really, really scary place for beginners! 
And, it's impossible for beginners (... or even me sometimes!...) to 
distinguish fact from fiction.

-- 
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: Audio Library?

2017-01-25 Thread Rex van der Spuy
You could just use an  element for simple playback, but if you want 
anything more sophisticated you'll probably have to use ports to access a 
JS library, like this one:

https://github.com/kittykatattack/sound.js

-- 
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: Emphasizing /r/elm more

2017-01-23 Thread Rex van der Spuy
On Monday, January 23, 2017 at 9:33:57 AM UTC-5, Brian Hicks wrote:
>
> Just a note: we've "stolen" the weekly beginners / easy question thread 
> concept from the Rust subreddit. We're into week three now: 
> https://www.reddit.com/r/elm/comments/5of78c/easy_questions_beginners_thread_week_of_20170116/
>
> Just to tie this back to our discussion about beginners questions going 
> unanswered. Working on it. :)
>

I've noticed that - it's a brilliant idea, thanks so 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.


[elm-discuss] Re: elm-style-animation awesomeness

2017-01-17 Thread Rex van der Spuy
Agreed, for me it's really one of Elm's killer apps.
`elm-style-elements` is just as awesome:

http://package.elm-lang.org/packages/mdgriffith/style-elements/latest

It has pretty much "solved" CSS, in the same way that Elm solved JavaScript.

-- 
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: on reuse and effects/subscriptions

2017-01-16 Thread Rex van der Spuy
Thanks for asking this Peter, I've been also been wondering about these 
same things lately.

-- 
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-graphics-app: An Elm Teaching Library (influenced in part by elm-playground)

2017-01-14 Thread Rex van der Spuy
There's similar 0.17 package which you might want to take a look at:

http://package.elm-lang.org/packages/MacCASOutreach/graphicsvg/latest

-- 
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] Cannot find module "String"...

2017-01-10 Thread Rex van der Spuy
On Tuesday, January 10, 2017 at 9:35:16 AM UTC-5, Peter Damoc wrote:
>
> Have you tried deleting ~/.elm ?
>
 
Thanks Peter, I've just done this based on your suggestion but the effect 
is the same.
Maybe I should re-install Elm? 

-- 
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] Cannot find module "String"...

2017-01-10 Thread Rex van der Spuy
On Monday, January 9, 2017 at 3:11:38 PM UTC-5, Nick H wrote:
>
> I'm curious, what happens if you remove the "import String" line 
> altogether? String should now be imported by default.
>

The compiler message goes away, but the app doesn't compile yet because of 
another puzzling bug (which I've posted about here):

https://groups.google.com/forum/#!topic/elm-discuss/W8_zQtmQQe0

I'm beginning to think there might be some bigger systemic problem that I 
don't understand...?
I've upgraded other 0.17 apps to 0.18 without any problems, and using 
`import String` worked fine.

 

-- 
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's compiler is trying to import a module that doesn't exist...?

2017-01-10 Thread Rex van der Spuy
Hi Everyone, 

Another little puzzle in my 0.17 -> 0.18 upgrade journey.
Elm's compiler thinks I'm trying to import a module called "Basics"
```
I cannot find module 'Basics'.

Module 'ImageButton' is trying to import it.

Potential problems could be:
  * Misspelled the module name
  * Need to add a source directory or new dependency to elm-package.json

```
However, I don't have a module called `Basics` anywhere, and my 
`ImageButton` module isn't trying to import it:

```
module ImageButton exposing (..)

import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)

```
I wonder if this is related to the other weird compiler message I got 
yesterday (and haven't yet been able to solve)?

https://groups.google.com/forum/#!topic/elm-discuss/yH18DxWocEQ

(Yes, I've tried deleting elm-stuff and rebuilding, and have also cleared 
out and manually re-installed the packages from `elm-package.json`) 

I've upgraded 5 previous 0.17 apps so far, and it went flawlessly.
But, I'm now starting to wonder whether there's some system file that's 
fundamentally corrupted somewhere... ?
(I've been using `elm-ugrade` to automate the upgrade process... could that 
have introduced some bugs?)

Has anyone seen something like this before?
... or should I just revert back to the pre-upgrade version and start 
again? 

-- 
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] Cannot find module "String"...

2017-01-09 Thread Rex van der Spuy
Hi Everyone,

Here's a strange puzzle! 
While upgrading some old 0.17 to 0.18. I received this error message:

```
I cannot find module 'String'.

Module 'Adventure' is trying to import it.

Potential problems could be:
  * Misspelled the module name
  * Need to add a source directory or new dependency to elm-package.json
```

Here's the section of the `Adventure` module that's trying to import 
`String`:

```
module Adventure exposing (..)

import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import String

```
I know that `String` is part of `core`, and checking my 
`elm-stuff/exact-dependencies.json` file, I can see that the latest version 
of `core` is installed:

```
{
"elm-lang/animation-frame": "1.0.1",
"mdgriffith/elm-style-animation": "3.5.1",
"elm-lang/virtual-dom": "2.0.3",
"elm-lang/html": "2.0.0",
"elm-community/list-extra": "4.0.0",
"elm-lang/svg": "2.0.0",
"elm-lang/core": "5.0.0"
}
```
And checking the `packages/elm-lang` confirms that it's there.

I've tried deleting `elm-stuff` and rebuilding, but that doesn't fix the 
problem.

Can anyone suggest where I should look next, or what I should try?
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: Task.perform in 0.18?

2017-01-09 Thread Rex van der Spuy


On Friday, January 6, 2017 at 4:23:03 PM UTC-5, OvermindDL1 wrote:
>
> Ahh, see that there, the return type of `Scroll.toTop` is `Task.Task 
> Dom.Error ()`, this in this case also change `Task.perform` to 
> `Task.attempt`.  :-)
>
>
Thanks so much, that did the trick!! 

-- 
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: Task.perform in 0.18?

2017-01-06 Thread Rex van der Spuy
Thanks Overmind!

I've done as you suggested and removed one `(always NoOp)` - that's makes 
sense to me! 
The compiler now gives me this error message:

``

The 2nd argument to function `perform` is causing a mismatch. 215| Task.perform 
(always NoOp) (Scroll.toTop "questionsContainer") 
^ Function `perform` is expecting the 2nd 
argument to be: Task.Task Never b But it is: Task.Task Dom.Error ()
...

`Scroll.toTop` comes from `elm-dom`:

http://package.elm-lang.org/packages/debois/elm-dom/1.2.3/DOM

... but I now just realized that the API has changed in 0.18.

Hmmm I need to think about this one! :)

-- 
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] Task.perform in 0.18?

2017-01-06 Thread Rex van der Spuy
Hi Everyone,

In upgrading an 0.17 app I ran across this line of code:

```
Task.perform (always NoOp) (always NoOp) (Scroll.toTop 
"questionsContainer") 
```

I understand that `Task.perform` was re-designed with this signature:

```
perform : (a -> msg) -> Task Never a -> Cmd msg
```

But, I haven't been able to figure out how to apply this to my old line of 
code.
Can anyone suggest what I should try?

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: Elm events 2017

2017-01-06 Thread Rex van der Spuy



> Doesn't seeem to be much on meetup.com outside of the USA, although there 
> do seem to be plenty Elm user groups in Europe.
>

...for anyone in Toronto, there is now an Toronto Elm meetup group: 

https://www.meetup.com/Elm-Toronto/
 

-- 
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: Replacing Json.Decode.customDecoder for new 0.18 code?

2017-01-06 Thread Rex van der Spuy
Thanks Matt, that worked perfectly!
I would not have been able to get this working without your help.

-- 
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] Replacing Json.Decode.customDecoder for new 0.18 code?

2017-01-06 Thread Rex van der Spuy
Hi Everyone,

I'm busy bumping some old 0.17 code to 0.18 and ran into a problem I could 
figure out.
I've got these blocks of code that rely on `Json.Decode.customDecoder`:

```
questionsDecoder : Json.Decode.Decoder Questions.Question
questionsDecoder =
Json.Decode.Pipeline.decode Questions.Question
|> Json.Decode.Pipeline.required "question" Json.Decode.string
|> Json.Decode.Pipeline.required "answer" Json.Decode.string
|> Json.Decode.Pipeline.required "completed" Json.Decode.bool
|> Json.Decode.Pipeline.required "editing" Json.Decode.bool
|> Json.Decode.Pipeline.required "id" Json.Decode.int
|> Json.Decode.Pipeline.required "paragraphId" Json.Decode.int
|> Json.Decode.Pipeline.required "rows" Json.Decode.int
|> Json.Decode.Pipeline.required "maxlength" Json.Decode.int
|> Json.Decode.Pipeline.required "format"* formatStyleDecoder*


formatStyleDecoder : Json.Decode.Decoder Format.FormatStyle
*formatStyleDecode*r =
let
decodeToFormatStyle string =
case string of
"Normal" ->
Result.Ok Format.Normal

"Quotation" ->
Result.Ok Format.Quotation

"AuthorOfQuotation" ->
Result.Ok Format.AuthorOfQuotation

_ ->
Result.Err ("Not a valid FormatStyle: " ++ string)
in
*Json.Decode.customDecoder Json.Decode.string decodeToFormatStyle*
```

I'm getting this error message:

```

Cannot find variable `Json.Decode.customDecoder`. 280| 
Json.Decode.customDecoder 
Json.Decode.string decodeToFormatStyle  `Json.Decode` 
does not expose `customDecoder`. 
```

Can anyone suggest what I should replace `customDecoder` with?

-- 
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: Emphasizing /r/elm more

2017-01-04 Thread Rex van der Spuy


On Wednesday, January 4, 2017 at 12:05:33 PM UTC-5, Brian Hicks wrote:
>
> the fact remains that /r/elm is going to be a place that people go to ask 
> questions, and if nobody is there to answer them we're giving people a 
> really bad experience.
>
>
That was my problem: When I started learning Elm I first posted questions 
on /r/elm. 
But, I soon found I received many more, and better, replies here on 
elm-discuss, so I hardly visit /r/elm anymore.

I think for this move to work need to somehow pull the plug on elm-discuss.
Maybe we should set a kill date, and then after that just lock down this 
list for good with a big sign saying "Please visit /r/elm"...?

-- 
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] Elm-mdl 8.0.0

2016-12-28 Thread Rex van der Spuy
Thanks so much Søren!! :)

-- 
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: Upgrading to 0.18 and elm-webpack-starter

2016-12-22 Thread Rex van der Spuy


 It's possible that your elm-webpack-loader is pointing to the wrong 
> executable.
>
 
Thanks Nathan! Everything else seem fine so it seems that this is likely 
the problem. 
Do you know where this needs to be set? 
I noticed this from the README in elm-webpack-loader but I wasn't sure 
where or how it should be set (in webpack.config.js?)

```
All options are sent down as an `options` object to node-elm-compiler. For 
example, you can explicitly pick the local `elm-make` binary by setting the 
option `pathToMake`:

```js
  ...
  loader: 'elm-webpack?pathToMake=node_modules/.bin/elm-make',
  ...
```
 

-- 
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] Upgrading to 0.18 and elm-webpack-starter

2016-12-22 Thread Rex van der Spuy
Hi Everyone,

I'm trying to figure out the best way to get my newly upgraded 0.18 code to 
work with an existing elm-webpack-starter installation.
My new code works fine in reactor, but elm-webpack-starter is still trying 
to compile it as 0.17.

Can anyone suggest how to turn-on 0.18 compilation in the 0.7.1 version of 
elm-webpack-starter?
Or, should I just clone a the latest version, 0.8, (which is pre-configured 
for 0.18) and copy my upgraded Elm source code into it? 

-- 
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: DOM geometry / SVG library

2016-12-22 Thread Rex van der Spuy


>  Currently the solution seems to be 1) compute the bounding box manually 
> inside the update function whenever the selection  is modified, 2) keep 
> the bounding box data in the model and 3) use the bounding box from the 
> model when the update function performs other operations on the model (e.g. 
> detect if a click is inside).
>

That's how us game developers do it: all the geometry and position data is 
in the model. That data is then used to blindly draw the shapes in the 
view.  

-- 
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: DOM geometry / SVG library

2016-12-22 Thread Rex van der Spuy



> 1. Is someone working on an higher-level SVG library than elm-lang/svg ? 
> Im thinking about support for path intersection, bounding box operations, 
> etc.
>
> I don't know if this is what you're looking for, but it's excellent:

http://package.elm-lang.org/packages/MacCASOutreach/graphicsvg/latest/GraphicSVG
 

-- 
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] What up with elm-mdl?

2016-12-22 Thread Rex van der Spuy
Peter, as usual, a brilliant and lucid explanation!!!
Thanks so much for patiently summarizing all this, it makes perfect sense.

So I wonder now what I should do?

- elm-mdl?: 
Looks like it might die on the vine, and the fork many not survive another 
Elm version bump.

- web components and Polymer?:
It's a risky dependency, hacky to implement, and very possibly another dead 
end in the long term.

But, all I really need are just grid layouts and buttons with ripple 
effects :)
Maybe I should just stick to a plain vanilla css file (bootstrap? mdl? 
picnic?) and just add styling with classes?
Boring, but risk-free!

I've got 5 "production" projects using elm-mdl and as I'm bumping them all 
to 0.18 I need to decide now which path I should take.
What would all of you reading this recommend I 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] What up with elm-mdl?

2016-12-21 Thread Rex van der Spuy
Hi Everyone,

I'm just starting to bump my Elm projects to 0.18 and found out that my 
beloved elm-mdl is still at 0.17.
But there's there's a MichealCombs28 fork of elm-mdl for 0.18.
Should I use that instead?

I'm confused! :)
I gingerly pryed open the #elm-mdl Slack channel to try and figure out what 
was going on, but it didn't help.
A lot of talk about Polymer and web components, warnings about not using 
components or elm-mdl at all, and suggestions to use strictly css-based 
"components"

Can anyone explain what's going on?

-- 
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: What do you think Elm's biggest shortcomings are when it comes to natively supported API's?

2016-12-14 Thread Rex van der Spuy
Oh, one more important thing: Touch.
Ideally, if we just had access to a universal Pointer (that applies to both 
touch and mouse) that would be perfect.

-- 
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: Design concepts. Too many Msg's?

2016-12-13 Thread Rex van der Spuy
One of the things I like most about Elm is how programs are organized 
around messages.
You can almost read them like a table of contents to your program, or like 
book chapters.
They act as a high-level map to your program, so the more the merrier :)

-- 
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] What do you think Elm's biggest shortcomings are when it comes to natively supported API's?

2016-12-12 Thread Rex van der Spuy


> For me, these things would be nice to have:
>   * WebAudio API
>

That's a big one for me too because I use Elm exclusively for game and 
"interactive multimedia" development. 
At the moment I have to drop into ports for Audio - I'd love to it all in 
Elm.

-- 
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-12-08 Thread Rex van der Spuy
On Tuesday, October 4, 2016 at 2:46:50 PM UTC-4, Joaquín Oltra wrote:
>
> Here's a mini-example for posterity 
> http://jsbin.com/hipeba/edit?html,css,js,output
>

Thanks Joaquín, I just had an opportunity to use your code snippet and it 
was extremely handy! 

-- 
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: Why not components?

2016-12-05 Thread Rex van der Spuy
Thanks so much, your simple button example is extremely helpful!!


-- 
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: Dynamically switching video source and browser caching problem....

2016-12-05 Thread Rex van der Spuy
... Oh, no worries!!
I solved my own problem.
The trick is to change the `src` property on the `video` tag, *not* the in 
the `source` element.
(I found the answer in one of the comments here: 
http://stackoverflow.com/a/3732711/1282216)

So, something like this works:

videoElement = 
  case currentAnswerType model of
QuestionNotClear ->
  video [ width 400, height 300, autoplay True, loop True, *src 
(defaults.videoLocation ++ "general.mp4"*) ]  [  source [ src 
(defaults.videoLocation ++ "general.mp4") ] [ ] ]

None ->
  video [ width 400, height 300, autoplay True, loop True,* src 
(defaults.videoLocation ++ "waiting.mp4"*) ]  [  source [ src 
(defaults.videoLocation ++ "waiting.mp4") ] [ ] ]

Hopefully this will help someone in the future with the same problem :)

-- 
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] Dynamically switching video source and browser caching problem....

2016-12-05 Thread Rex van der Spuy
Hi Everyone,

On the current project I'm working on I'm trying to dynamically switch the 
`src` in a video element based on the application state 
(The project is a simple conversation chatbot).
For example, I have function like this that returns the correct video 
element to use:

videoElement = 
  case currentAnswerType model of
QuestionNotClear ->
  video [ width 400, height 300, autoplay True, loop True ]  [ 
 source [ src (defaults.videoLocation ++ "one.mp4") ] [ ] ]

Angry ->
  video [ width 400, height 300, autoplay True, loop True ]  [ 
 source [ src (defaults.videoLocation ++ "two.mp4") ] [ ] ]

General ->
  video [ width 400, height 300, autoplay True, loop True ]  [ 
 source [ src (defaults.videoLocation ++ "three.mp4") ] [ ] ]

Annoyed ->
  video [ width 400, height 300, autoplay True, loop True ]  [ 
 source [ src (defaults.videoLocation ++ "four.mp4") ] [ ] ]

FinishedAngry ->
  video [ width 400, height 300, autoplay True, loop True ]  [ 
 source [ src (defaults.videoLocation ++ "five.mp4") ] [ ] ]

FinishedPolite ->
  video [ width 400, height 300, autoplay True, loop True ]  [ 
 source [ src (defaults.videoLocation ++ "six.mp4") ] [ ] ]

None ->
  video [ width 400, height 300, autoplay True, loop True ]  [ 
 source [ src (defaults.videoLocation ++ "seven.mp4") ] [ ] ]


This technique works fine for images, but it turns out it doesn't work for 
video.
It seems that browsers will cache the first video loaded, but not 
automatically reload any new video sources if the `src` changes dynamically.
This is the best information I could find about this:

http://stackoverflow.com/questions/5235145/changing-source-on-html5-video-tag

I had hoped Elm's virtual DOM would re-flash the cache on each update, but 
this doesn't seem to be the case.
>From the StackOverflow link above it seems that I need to manually call the 
video element's `load` and `play` methods to force a video re-load.

Does anyone know if it's possible to call these methods directly in Elm, or 
would I have to do this via ports?
Or, is there a better, simpler way for me force a video cache refresh in 
Elm to make this work?

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: Why not components?

2016-12-04 Thread Rex van der Spuy
Thanks so much for writing that up!
This is exactly the point in my Elm learning that I'm struggling with at 
the moment, so this extremely helpful.
In the past I've always made my "components" as self-contained M/U/V 
modules - that was great because I could re-use them in other projects just 
by dropping the .elm module file into my new project folder and it would 
just work.
So if I needed a button, I'd just drop my button from Project A into 
Project B, and voila!
I had been building my own little library of these components.
And, I *love* the fact that sub-modules have exactly the same M/U/V 
structure as the parents modules in a kind of fractal nested way - that 
makes my code really easy for me to understand.
But, I always found updating submodules and bubbling up their effects a bit 
of a chore, so I'm looking forward to exploring the (seemingly?) simpler 
world of pure components.

But.. I'm still a bit confused! :)
I found both Evan's sortable table example and your (excellent!) dropdown 
menu just a few levels too advanced for my poor beginner's brain to fully 
grok.

I have a request!
Could anyone point me to a blindingly, brain-dead-simple example of this 
system in action?
For example, what would a simple, stand-alone, reusable, "pure" button 
component look like that just triggers a message update in the parent 
module when clicked?

-- 
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: What's the best way to chain updates?

2016-12-02 Thread Rex van der Spuy

Oh, now it seems obvious! :)
Thanks so much!

On Friday, December 2, 2016 at 12:28:40 PM UTC-5, Simon wrote:
>
> I think you want to do something like:
>
>  { model | -- update the record properties -- }
> |> update SecondThing 
> |> update ThirdThing 
> |> update FourthThing
>
> ​
>

-- 
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: How to Modularize Big Files?

2016-12-02 Thread Rex van der Spuy


On Friday, December 2, 2016 at 11:46:49 AM UTC-5, Matthew Griffith wrote
>
>
> First, (and this is kinda unrelated to organization) but I'd recommend 
> using elm-format and having type signatures.
>

... guilty as charged! :)
I actually could never get elm-format to integrate with Sublime Text 
despite many attempts - no idea why.
Type signatures... I'll try using them more often! (... the compiler scares 
me sometimes, so I usually just let it try and figure all the types out on 
its own.)
 

>
>
> Side note, you can combine all your animation subscriptions into one 
> message.
>

Oh, I think this is something I fundamentally don't understand about 
elm-style-animation.
Could you point me to reference on how to set that up?

-- 
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: How to Modularize Big Files?

2016-12-02 Thread Rex van der Spuy


On Friday, December 2, 2016 at 11:44:42 AM UTC-5, Max Goldstein wrote:
>
> I would want to move all of the view code to a new module, exposing only 
> the view function itself. In order to do that, you'll have to move the 
> definition of Model and Msg to a module imported by both Main and View. You 
> can call this module Common. I think the initial model belongs next to its 
> definition, in Common. I wish there was a way to keep Msg near update but 
> View needs it too. 
>
> If you have many helper functions that called from update directly, those 
> can live in Main. If you have many helpers that are only called from other 
> helpers, try to find the small interface update needs, expose that, and 
> hide the rest. 
>

Thanks so much, Max, that's extremely helpful and practical advice! :)
So your suggestion would give me a file structure that looks like this?

- common.elm: initial model and messages
- view.elm: all the view code
- main.elm: imports common, view. includes all the update code, 
subscriptions and app wiring

I also think of Msg as part of update, so I know what you mean about that 
separation seeming awkward.

Great, I'l try 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.com/d/optout.


[elm-discuss] What's the best way to chain updates?

2016-12-02 Thread Rex van der Spuy
Hi Everyone,

Usually when I want a series of updates to chain in sequence, I'll write 
some code like this:

FirstThing ->
  let 
newModel = { model | -- update the record properties -- }
  in
update SecondThing newModel

SecondThing ->
  let 
newModel = { model | -- update the record properties -- }
  in
update ThirdThing newModel

ThirdThing ->
  let 
newModel = { model | -- update the record properties -- }
  in
update LastThing newModel

LastThing ->
  let 
newModel = { model | -- update the record properties -- }
  in
newModel ! [ ]


But... isn't this similar to using a GOTO statement in BASIC?
(Hey, I love BASIC, but... !)
I've found that when I have a few of these chained in sequence, spaghetti 
code is the guaranteed result.

Is there someway to manage this sequencing in some kind of centralized way?
For example, something like:

SequenceOfSteps ->
  FirstThing 
  SecondThing
  ThirdThing
  LastThing

It would be nice to do this so that I can selectively insert or remove 
steps while testing my application.

Is this possible?
Any advice or opinions?

-- 
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] How to Modularize Big Files?

2016-12-02 Thread Rex van der Spuy
Hi Everyone,

Over the past few months I've been follow the Best Practice recommendations 
in Elm World to not use nested Model/Update/View modules.
The general consensus seems to be just to keep one giant M/U/V engine 
running, and farm out specialized work to helper functions.
Cool, that make sense!
Updating child modules is a big chore anyway that I'm happy not to have to 
do.

But, the "small" application that I'm working at the moment has now grown 
to over 1000 lines of code.
I'm starting to have to hunt for things, do a lot of scrolling, and I'm 
forgetting how it's organized.
And I realized I have absolutely no idea at all how to modularize it into a 
sensible/understandable collection of smaller files.

Can anyone help?

Here's a code dump of what my main application code looks like so far:

https://gist.github.com/kittykatattack/e30d860bbdfba57e0af2341c0c59552c

(It's a kind of Eliza-like chat-bot - the code above won't run without some 
dependencies that I haven't included, but hopefully it illustrates my 
problem?)
*Disclaimer: this is a work-in-progress and there is some redundant and, 
frankly, plain bad code I need to clean up -- so please ignore my messy 
work!!*

But, can anyone recommend to me how I can organize this into a manageable 
series of smaller files?

The general way it's structured is:

- imports
- initial model
- update (including update helper functions)
- view (including css and elm-mdl components)
- subscriptions
- main app wiring


Thanks, Everyone!


-- 
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] Listening for a video's "ended" event?

2016-12-02 Thread Rex van der Spuy
Hi Everyone!

I'm hoping you can all help me figure out the best strategy to handle this 
problem:
It's probably not complicated, but I would love to hear your ideas on the 
best solution.

I have a video tag in my `view` that looks like this:

```
video [ width 400, height 300, autoplay True, loop True ]  [  source [ src 
"video/general.mp4" ] [ ] ]
```

When it's finished, I want another video to start playing automatically.
I know that in JavaScript you can listen for an `ended` event 
(http://stackoverflow.com/questions/2741493/detect-when-an-html5-video-finishes)
But how do you handle this in Elm?
Would I need to listen for this using ports, or is there some way to 
trigger trigger the `update` function directly in Elm?




-- 
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: Map.!: given key is not an element in the map

2016-11-28 Thread Rex van der Spuy


> I'm assuming this should actually never happen.
>

Yes, "have you tried deleting elm-stuff?" is a bit of oral tradition 
folklore that can magically cure all manner of ailments.   
It's Elm's take on "Have you tried turning it off and on again?"
It burned me as a beginner too, and has been a problem since I started 
using Elm with 0.15

Does anyone know if it's possible to prevent this from being necessary? 
Or is there a technical reason why the complier can't forcibly clear the 
elm-stuff cache?

-- 
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: style-elements v2 published

2016-11-28 Thread Rex van der Spuy
This is AWESOME!!! :)
About 75% of my time debugging Elm apps is actually spent debugging the 
mind-bending quirks in CSS - I can't wait to try 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.com/d/optout.


Re: [elm-discuss] What Elm needs to move forward

2016-11-25 Thread Rex van der Spuy


Also, I just sent a request to Elm Weekly  to 
> post their newsletter here on the mailing list. Because everybody should 
> know about it!
>
 
Yes, Elm Weekly is ground-zero in Elm world. Subscribe, everyone!! 

-- 
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] [JOB] Interactive Media Specialist at TV Ontario

2016-11-25 Thread Rex van der Spuy
Hi Everyone,

TV Ontario, the company I currently work for, is hiring 4 new Interactive 
Media Specialists:

https://careersen-tvo.icims.com/jobs/1846/interactive-media-specialists-%284%29/job

(I believe you have to be a Canadian citizen to apply.)
The job is essentially making educational interactive games and 
applications for high school curriculum courses.
It’s essentially a programming position that also requires strong 
conceptual creative abilities, interest in education, and at least some 
ability or interest in graphic design and video production.
We also have an entire TV Studio at our disposal, including technical staff 
and actors, to produce whatever video work we want.
The work is highly self-directed and multidisciplinary with a lot of 
freedom to choose the kind of things you want to make.
In one week you might find yourself doing game programming, music 
composition, script writing, graphic design work and video production.
Where else can you work that offers such variety? Nowhere!

Yes, you can use Elm! 
I've been using it (and a bit of Pixi) for all the games and apps I've made 
over the past year, and I'd love to get another Elm developer on board.
Strong background in HTML5 game development would be a big asset (Pixi, 
Phaser, or low-level Canvas/WebGL.)
We’re hiring for 4 of these positions, so if you know of anyone who might 
be interested, please pass this on.

Cheers,
Rex

PS: Board game lunches every Tuesday and Thursday!



-- 
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] Rename Just to Something, as the counterpart to Nothing?

2016-11-23 Thread Rex van der Spuy


On Wednesday, November 23, 2016 at 12:15:50 PM UTC-5, Daniel Walker wrote:
>
> My opinion on this isn't nothing, it's just that just makes the most sense.
>

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] Re: Tell me how to teach Web Apps

2016-11-23 Thread Rex van der Spuy
I agree - 100% JavaScript (node on the backend) if finding jobs is 
important.
I would stay away from TypeScript in an introductory course because it's 
important for students to learn how to problem-solve the deficiencies of 
working in raw JS.  

-- 
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: Passing properties as arguments to messages?

2016-11-22 Thread Rex van der Spuy
Thanks so much for explaining that.

-- 
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: Passing properties as arguments to messages?

2016-11-22 Thread Rex van der Spuy
Thanks for all your replies everyone!!
I'm glad to have confirmation that this really is impossible and it's not 
just me.

I think for now I'm just going to leave it as is.
It's nice and simple and I understand it :)

But, can anyone explain why Elm doesn't let us do 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.com/d/optout.


[elm-discuss] Passing properties as arguments to messages?

2016-11-21 Thread Rex van der Spuy
Hi Everyone,

Is it possible to pass model properties as message arguments and use those 
arguments to construct a new model?

For example, the only difference between these two messages is the model's 
properties:

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

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

Is it somehow possible to combine these into one message, using a generic 
"property" placeholder that could be provided by the argument?:

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

That doesn't work of course, but is there some way to make it work?

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: ANN: update-clock for fixed-time-step game loops

2016-11-16 Thread Rex van der Spuy
Wow, that's absolutely brilliant!!!
(My username was `d13` by the way - so that was me!)
Congratulations!!!

-- 
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: Convincing my team that Elm isn't just going to die like CoffeeScript

2016-11-07 Thread Rex van der Spuy
Just a few comments:

> The one thing I'm not really sure I'm prepared to answer is how I can be 
sure that Elm isn't just another CoffeeScript or Dart, and in 2 or 3 years 
we'll have an impossible time hiring anyone > > who knows how to use it 
because everyone's going to go back to JavaScript.

Don't invest in any single technology or workflow - just invest in your own 
ability to adapt quickly to constant change.
Front-end software for the web is essentially disposable - let's embrace 
this!
If you get a couple of years of mileage out of your front end app before it 
you need re-write it from scratch using a completely new or different 
technology, you're doing great!
My advice is just grab the best technology you can at the moment, milk it 
for all its worth, jump to something better when it comes along - and don't 
look back.
The path my career took over the past 25 years was: Basic, Hypercard, 
Director/Lingo, Java, Flash/AS3, JavaScript, and now Elm.
Nothing is forever in this industry, and most things are deliriously short 
lived.
Just relax and enjoy the ride! :)

... However!
Until Elm reaches v.1.0 (which could be years from now, nobody knows) every 
version bump, every six months or so, results in API breaking changes at 
the language level.
Some of those changes, like from 0.16 to 0.17 have been huge and have 
required quite a painful upgrade.
(For example It took me 7 hours to upgrade a 3000 LOC app, making over 200 
changes. All of those 7 hours, except the last five minutes, was done blind 
just following the compiler's messages.)
Are you prepared to invest in upgrading your entire Elm codebase with every 
version bump to keep it current?
In that regard, although you can definitely use Elm in production, its 
still very much an experimental technology - and we are the lab rats.
But, it says a lot for the dismal state front end web development even 
under these conditions Elm is way better than anything else out there!

Regarding learning Elm:
I'm a non-talented, slow learner who has to do everything about 10 times 
before it sinks in.
And then I have to do it another 10 times just to make sure.
It took me about 2 weeks of true beginner-level head-banging to get to 
grips with Elm, and another 2 weeks of tentative experimentation before I 
started being productive.
But, the time I spent learning Elm has been paid back many times over by 
the time I've saved debugging my apps.
Elm has unquestionably saved me **months** of debugging time.
I've had experiences with Elm's compiler that have bordered on the 
supernatural - it's pointed me to bugs that would have taken me weeks of 
laborious mine-sweeping if I have had been using pure JS.
And, the best part about learning Elm? 
It makes programming fun again!

Regarding hiring:
A search for companies hiring Elm programmers will turn up exactly 1: No 
Red Ink.
There is no statistically significant demand for Elm programmers whatsoever.
However, the smartest programmers in the world are all here on elm-discuss!
Elm users self-select as top talent that you would never find in such high 
concentrations anywhere else.
So, just post your job applications here and I'm sure you'll have dozens of 
high-quality applications. 




On Saturday, November 5, 2016 at 6:01:42 PM UTC-4, Zacqary Adam Xeper wrote:
>
> Hey Elmos,
>
> I've finally gotten an opportunity to pitch Elm to my fairly large dev 
> team. I feel like I'm prepared to make the case for it against a lot of 
> objections: i.e. how will we learn yet another programming language, do we 
> really need something that never throws exceptions, etc. etc.
>
> The one thing I'm not really sure I'm prepared to answer is how I can be 
> sure that Elm isn't just another CoffeeScript or Dart, and in 2 or 3 years 
> we'll have an impossible time hiring anyone who knows how to use it because 
> everyone's going to go back to JavaScript.
>
> How do I convince Elm skeptics that this thing is here to stay? I can do a 
> great job of incorporating a small bit of Elm code into our stack to show 
> how great it is, but they won't even let me merge it into prod unless I can 
> make the case for its longevity.
>
>

-- 
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: Suggested small edit to official Elm guide (for beginner-friendliness) ... and maybe the Elm error message?

2016-11-03 Thread Rex van der Spuy
Just for interest, I had exactly the same problem with that example when I 
fist started learning Elm about a year ago.

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

2016-10-05 Thread Rex van der Spuy

On Tuesday, October 4, 2016 at 9:08:45 PM UTC-4, Tanya Bouman wrote:
>
> We have also developed our own graphics library 
> http://package.elm-lang.org/packages/MacCASOutreach/graphicsvg/latest/GraphicSVG
>  
> which makes it easy to use notifications. 
>

This is awesome!!! 

-- 
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-04 Thread Rex van der Spuy
It works!!! :)
Thanks so much for walking me through it (and thanks again for a fantastic 
library!)

I do a *lot* of these sorts of these simple transitions so it's definitely 
been worth the effort to get this up and running.

On Tuesday, October 4, 2016 at 10:30:37 AM UTC-4, Matthew Griffith wrote:
>
> Oh!  You need to add the animation subscription as well.
>
> Sub.batch this with your current subscriptions
>
> subscriptions : Model -> Sub Msgsubscriptions model =
> Animation.subscription Animate [ model.storyTextStyle ]
>
>
> On Tuesday, October 4, 2016 at 9:28:25 AM UTC-4, Rex van der Spuy wrote:
>>
>> Thanks Mathew!!
>> I've added your code suggestion, but so far no luck yet (FadeInOut is 
>> called, but not SendStoryComponents)
>>
>> If anyone wants to take a look at the current Main.elm file where all 
>> this code is running, it's here:
>>
>> https://gist.github.com/kittykatattack/f05b42efc6ecf09ddf244bbafd18edb3
>>
>>
>> On Monday, October 3, 2016 at 5:24:43 PM UTC-4, Matthew Griffith wrote:
>>>
>>> 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 `SendStoryComp

[elm-discuss] Re: Simple Fade In/Out effect?

2016-10-04 Thread Rex van der Spuy
Thanks Mathew!!
I've added your code suggestion, but so far no luck yet (FadeInOut is 
called, but not SendStoryComponents)

If anyone wants to take a look at the current Main.elm file where all this 
code is running, it's here:

https://gist.github.com/kittykatattack/f05b42efc6ecf09ddf244bbafd18edb3


On Monday, October 3, 2016 at 5:24:43 PM UTC-4, Matthew Griffith wrote:
>
> 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] 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.


[elm-discuss] Simple Fade In/Out effect?

2016-09-30 Thread Rex van der Spuy
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: Does CSS model the right problem?

2016-09-26 Thread Rex van der Spuy
So far the best solution I've seen for CSS is Elm's own Graphics.Element:

http://package.elm-lang.org/packages/elm-lang/core/3.0.0/Graphics-Element

A little more granularity, and integration with elm-html, and it would be 
killer.

>

-- 
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: Post mortem for my first attempt at using Elm in a real app.

2016-09-20 Thread Rex van der Spuy


On Tuesday, September 20, 2016 at 10:18:02 AM UTC-4, OvermindDL1 wrote:
>
> SCSS helps 'some' of the CSS woes at least.  I keep my CSS outside of elm 
> and in SCSS and it works decently(ish).
>
>  
For me SCSS helps in the way that TypeScript or Coffeescript helps 
JavaScript - it's still just patching up a fundamentally broken system. 

-- 
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: Looking for feadback on API design for my upcoming 2d game library

2016-09-19 Thread Rex van der Spuy
Hi,

Have you had a look at Pixi?

http://www.pixijs.com/

It's not perfect, but its API very practical, usable and flexible.
Also, a resource loader and texture cache/manager would be a definite 
requirement.
 

-- 
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: Upgrading 0.16 `Effects.task <| Task.succeed` to 0.17

2016-09-19 Thread Rex van der Spuy
Thanks for the advice and links!

I realized I could greatly simplify all my code by recursively calling 
`update` rather than batching Tasks - that's what I've done and it's 
working great.

-- 
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: Post mortem for my first attempt at using Elm in a real app.

2016-09-19 Thread Rex van der Spuy
Peter, 

Having now done a few moderate sized "production" Elm apps (2-3k loc) in 
the past year (with invaluable help from you!) I agree with all your points 
absolutely.
I specifically agree with your point about CSS.
CSS is hell-on-wheels: the most time I've spent debugging my Elm apps have 
not been with my Elm code, but with the CSS.

Hey, Elm Community, we've solved JavaScript now we need a real solution to 
CSS! :)

-- 
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] Upgrading 0.16 `Effects.task <| Task.succeed` to 0.17

2016-09-15 Thread Rex van der Spuy
Hi Everyone!

I'm upgrading some complex old 0.16 code to 0.17 and came across this in my 
`update` function:

```
(
  model''
, Effects.batch
[ Effects.task <| Task.succeed FadeOutOldPage 
, Effects.task <| Task.succeed FadeInNewPage 
, Effects.task 
<| Task.succeed (UpdateInfoBox (InfoBox.UpdateData storyLevel 
inventoryQuantities storyPhaseChapter))
]
 )

```
Does anyone know what this should look like in 0.17?

-- 
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: Permission denied: Elm package install

2016-09-14 Thread Rex van der Spuy
This happens to me too! :)
I delete `elm-stuff` and then run `elm package install` an arbitrary number 
of times until it inevitably starts working.


-- 
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: Basic behavioral composition

2016-09-05 Thread Rex van der Spuy


Hadn't noticed this section in the guide before. Great explanation
>

... It's just been added :) 

-- 
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: Do the counters in the Guide teach us a wrong scaling approach?

2016-08-31 Thread Rex van der Spuy
Thanks so much everyone!
There's lots of great stuff here to dig into :)

-- 
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 Package Skimmer

2016-08-29 Thread Rex van der Spuy
Wow, that's beautiful, thanks so 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.


[elm-discuss] Re: Do the counters in the Guide teach us a wrong scaling approach?

2016-08-29 Thread Rex van der Spuy

>
>
> For newcomers to Elm, *wouldn't it be better to change the scaling from 1 
> to multiple counters in the guide in a different way? *
> E.g.
>
>1. Build everything in 1 module, e.g. save a copy of counter.elm as 
>counter-list.elm
>2. Change every building block (Model, Msg, update, view) one at a 
>time, and upgrade each to handle multiple counters
>   - Suggested order: Model, view, Msg, update
>3. After that, separate out the view (and only the view) of an 
>individual counter, with signature like "msg -> msg -> Int -> Html msg"
>   - with the two msg's being for increment and decrement
>
>
>
I would love to know how to do this!
Can anyone point me to a brain-dead-simple practical and working example 
for a non-expert Elm user like myself?

I, like Wouter, have modelled all the Elm apps I've built over the last 9 
months on the counter-list example - commonly nesting 3 layers deep.

-- 
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: Design of Large Elm apps

2016-08-28 Thread Rex van der Spuy


On Sunday, August 28, 2016 at 4:14:43 AM UTC-4, Richard Feldman wrote:
>
>
>> I gather that this is has to do with an interaction between two update 
> functions...is there some way to rephrase it in terms of how those two 
> update functions interact?
>

Richard, this has been a huge area of confusion for me in the child-parent 
discussions that I've been following over the past few months! What's a 
"module", what's a "child", what's a "component"? Everyone seems to have 
different mental models for what these things are include me :) ... 
resulting in some muddy and inconclusive discussions.

... just a observation from someone in the Peanut Gallery.
Carry on! This is a fun thread :)

-- 
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: Should I have a CSS file for my made-with-Elm web app?

2016-08-26 Thread Rex van der Spuy


On Friday, August 26, 2016 at 12:10:30 PM UTC-4, Thibaut Assus wrote:
>
> I think css stylesheets are useless in Elm. Inline styles are a lot better 
> imo for reactive procramming. I plan to write a blogpost on that soon. An 
> exemple of my ideas in a repo : 
> https://github.com/tibastral/elm-credit-card. Look at the style part.
> Have a good day !


Thibault... I agree!!
(Well, almost... stylesheets can be the more useful option in some cases...)
But, I find that for interactive web apps (not "websites") it's more useful 
for me to work with self-contained components where the style and 
functionality is all in one place.
That way I don't have the pieces of my components spread out all in lots of 
disparate files that I have to go hunting around around for.
I'm using Elm for exactly what I used to use Flash for 10 years ago - in 
Flash you made integrated components too, and I overall think it's a much 
better paradigm for interactive design.

-- 
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: Old browsers

2016-08-26 Thread Rex van der Spuy


On Thursday, August 25, 2016 at 3:14:17 PM UTC-4, Luke Westby wrote:
>
> You're welcome! I apologize for the terseness of my previous comments, was 
> in a hurry and let that get in the way of friendliness.
>

Sir, no need to apologize! Your posts are always extremely friendly and 
helpful :)
I'm always posting in-between rushed breaks at work too.

I've submitted an Issue to elm-hot-loader - thanks again! 

-- 
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: Old browsers

2016-08-25 Thread Rex van der Spuy




> Rex, you should file an issue with elm-hot-loader about their use of 
> Object.assign()
>

Thanks Luke, that must be it! 

-- 
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: Old browsers

2016-08-24 Thread Rex van der Spuy
Just wish to alert everyone that Elm's port code will not work with any 
version of IE without a ployfill for `Object.assign` 
(https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)

-- 
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: Composability without extensible records

2016-08-24 Thread Rex van der Spuy

>
> Just break it into modules so your similar functions are grouped together 
> in files.  Use them just like you already are.  
>

The part I don't understand is: how do you create UI components that 
maintain their internal state without nesting them as child components?

-- 
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: mdl layout

2016-08-20 Thread Rex van der Spuy


> It only works when it is the top-most 
> element in your app. 
>

That makes sense :)

I've been playing around with 7.4/5 all week and it's a delightful 
experience!
What so nice is that it's effortless to mix and match elm-mdl components 
with elm-html elements.

-- 
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: mdl layout

2016-08-20 Thread Rex van der Spuy
Yes, that video it's excellent - I didn't understand how layout worked 
until I watched it either.

On a side-note: Is layout just applicable to the entire viewport window?
I tried using it inside an MDL grid cell and it seemed to get confused 
about how wide things should be.

-- 
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: Design of Large Elm apps

2016-08-13 Thread Rex van der Spuy
Thanks so much Richard, that's absolutely fascinating!

The way that I've been building my current generation of Elm apps has been 
modelled on the Counter/Pair example.
So it's not uncommon for me to have apps with nested M/V/U models 3 levels 
deep (For example, a "page" containing a "panel" which contains a "button" 
- that kind of structure.)
And, yup, it's a kind of a pain to manage the chain of updates through 
those nested structure and bubble up their effects.
So just having one structure to deal with sounds kind of. easy and nice 
:)

-- 
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: Design of Large Elm apps

2016-08-12 Thread Rex van der Spuy
Thanks, Richard, this is great advice:

>
>1. For a given page, start with one model, one view, and one update.
>2. If one of those (model, view, or update) gets too big and starts 
>feeling unwieldy, *subdivide only that thing.* For example, if view 
>feels too big, split it into some helper functions but *don't touch 
>model or update.* If update feels too big, same thing - split out 
>helper functions but don't touch the view or model. If your model feels 
> too 
>big, *reorganize only the model*. Split it from one record into some 
>nested records, but don't rearchitect update or view.
>3. Any time you find yourself thinking "I bet this will be nicer if I 
>split it into its own model/update/view" your next thought should be 
>"whoops! That's a classic beginner mistake. My code will actually be worse 
>if I do that. Glad I didn't do that!" (It's an easy trap to fall into - I 
>fell into it myself, and fell hard, as a beginner.)
>
> Basically, whenever I meet someone who is new to Elm and asking about 
> parent-child communication, what I really want to say is "a parent-child 
> relationship in an application is very rarely the right tool for the job, 
> and is almost certainly not what you want as a beginner. How can I help you 
> avoid falling into the same trap I fell into when I was just starting out?" 
> :)
>

But, I have a question! :)

Are you suggesting that each self-contained Elm "app" ("page", "game" etc.) 
should only have one Model/View/Update and avoid using nested modules for 
sub-components?
For example, do you mean that something like the nested counter example 
from the Elm Archtecture guide is a bad idea?

https://github.com/evancz/elm-architecture-tutorial/tree/master/nesting

If that's the case, can you suggest a better way to modularize that kind of 
nesting that keeps everything inside a single M/V/U?
Or, am I misunderstanding "parent-child-communication" in this context? 
(... that's very likely!)


-- 
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: Which text editor do you prefer for Elm?

2016-08-10 Thread Rex van der Spuy
I've found the HTML5 based editors like Atom and Lightable a bit laggy in 
the past (maybe things have changed?) so for me it's Sublime all the way 
down :)

-- 
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: public keyword instead of exposing

2016-08-08 Thread Rex van der Spuy


On Monday, August 8, 2016 at 3:44:30 AM UTC-4, Robin Heggelund Hansen wrote:
>
> There's one thing that has always bothered me with Haskell, and now also 
> Elm, and that is how functions are exposed. My problem with the way it 
> currently works is that you have go to the top of the file to see/alter if 
> a function is exposed to the "outside world".
>
>
Just for the record, I like this feature.
I prefer to have my list of exposed functions in one convenient place 
rather than scattered throughout the file. 

-- 
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] elm-mdl 7.0.0 — supports all components of Material Design Lite

2016-08-08 Thread Rex van der Spuy

>
>
> You should be using the " 7.0.0 <= v < 8.0.0" constraint and you should 
> also set your elm version constraint to `"elm-version": "0.17.1 <= v < 
> 0.18.0"` because it requires at least elm 0.17.1, which I am betting you do 
> not have based on your error message.
>
>  
That was exactly the problem, thanks so much for your help! 

-- 
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] elm-mdl 7.0.0 — supports all components of Material Design Lite

2016-08-05 Thread Rex van der Spuy
This is brilliant, thanks so much!
I use elm-mdl everyday, for everything :)

I have one question about upgrading.
I ran `elm package install debois/elm-mdl` and received this message:

Error: This is a tricky update, you should modify elm-package.json yourself.
Package debois/elm-mdl is already listed as a dependency:
   "debois/elm-mdl": "6.0.3 <= v < 7.0.0"
You probably want one of the following constraints instead:
   6.0.3 <= v < 7.0.0
   7.0.0 <= v < 8.0.0

So, I did what it suggested and modified `elm-package.json` to match that.
When I ran `elm package install` again I received:

Error: Unable to find a set of packages that will work with your 
constraints.

I'm sure it's just my lack of experience managing elm packages which is to 
blame.
Can you suggest the best way to upgrade?

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


  1   2   >