Re: [elm-discuss] Re: State of CSS in Elm

2017-07-03 Thread Peter Damoc
On Mon, Jul 3, 2017 at 6:59 PM, Greg Coladarci  wrote:

> A year later, I've just discovered this thread as I am new to the Elm
> world and was interested in how others solved for the styling side of
> things.
>
> In the spirit of trying to figure out how Elm can help solve long-standing
> shortcomings w/ CSS, I see there being two massive opportunities:
>

One of the best projects that came up in this domain is:
https://github.com/mdgriffith/style-elements

The solution will be something like that: separating layout concerns from
surface concerns.

As a more exotic alternative, I have toyed in January with an approach that
rests on custom elements but I haven't put in enough thought to flesh that
out. It was inspired by this article:
https://www.smashingmagazine.com/2017/01/styled-components-enforcing-best-practices-component-based-systems/




-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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] Local third-party packages

2017-07-03 Thread Peter Damoc
On Mon, Jul 3, 2017 at 4:15 PM, Jens Egholm  wrote:

> Just a thought; shouldn't this be available through native Elm package
> management?
>
>
NO!

This kind of unsafe use of code is and should forever be discouraged.

I have dabbled in Native code and the main lesson from my experiences is
that this is highly dangerous and should be avoided as long as possible.

There are contexts in which using Native is unavoidable but one should be
very careful treading on those paths. If they want to encourage others to
follow them, a warning should be issued about dangers.

The official package is for safe things that every beginner could use.


-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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] http://elm-lang.org/try should support saving

2017-07-03 Thread Eduardo Cuducos
Hi Raoul,

Have you tried Ellie? https://ellie-app.com/

; )


On Mon, 3 Jul 2017 at 23:14 Raoul Duke  wrote:

> hi,
>
> I have hit a syntax issue and was hoping to make a "paste" to be able
> to show to people what I am trying to do. But I don't see a way to
> save what I'm doing in the 'try' online repl.
>
> ?
>
> --
> 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.
>
-- 
Eduardo Cuducos
http://cuducos.me/

-- 
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] http://elm-lang.org/try should support saving

2017-07-03 Thread Raoul Duke
hi,

I have hit a syntax issue and was hoping to make a "paste" to be able
to show to people what I am trying to do. But I don't see a way to
save what I'm doing in the 'try' online repl.

?

-- 
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] Local third-party packages

2017-07-03 Thread Jens Egholm
Just a thought; shouldn't this be available through native Elm package 
management?

Le lundi 30 janvier 2017 08:23:09 UTC+1, Peter Damoc a écrit :
>
>
>
> On Mon, Jan 30, 2017 at 8:48 AM, Lyle Kopnicky  > wrote:
>
>> So I wonder if I can use elm-package to install a package from another 
>> directory, so hopefully the references will work out right?
>>
>
> elm-package does not support that BUT, elm-github-install 
>  was designed for such 
> contexts. 
> Add the package manually to your dependencies and then use 
> elm-github-install to install it. 
>  
>
>> when I build my project, because I'm using the default project URL, it 
>> gets referenced as _user$project$Native_KaTeX, which doesn't match.
>
>
> You need a valid github project. Default values don't work. So, if you 
> fork the project and replace the user in that Native function name, you 
> should be able to compile it just fine. 
>  
>
>> Another possibility is given by looking at 
>> https://github.com/eeue56/take-home/wiki/Writing-your-first-Elm-Native-module.
>>  
>> Here the author shows some very different boilerplate, which doesn't seem 
>> to involve the project name in the variable names. I'd have to copy the 
>> elm-katex code into my own project and tweak it a bit, but that's OK for 
>> now as I'll only be building/running my project locally for the foreseeable 
>> future. Also I'd be able to update the version of KaTeX that's embedded in 
>> the file.
>>
>
> The guide you referenced is for an old way to do Native. That API is 
> obsolete. 
>
>
> -- 
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>

-- 
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: State of CSS in Elm

2017-07-03 Thread Greg Coladarci
A year later, I've just discovered this thread as I am new to the Elm world 
and was interested in how others solved for the styling side of things. 

In the spirit of trying to figure out how Elm can help solve long-standing 
shortcomings w/ CSS, I see there being two massive opportunities:

1) You can't do anything clever w/ inheritance, code re-useage, variables, 
etc. SASS and LESS "solve this" but both have their own annoyances in the 
project setup and compilation phases; it's important to consider them as 
perhaps bandaids for a larger problem.

2) As your app grows larger and larger, if you skew too far towards the 
"one style sheet to rule them all" for your app, it's very difficult 
(potentially impossible) to ever determine what's actually being used. This 
can result in megs of styles and a team afraid to remove any of them (there 
are no tests in the CSS world).

The way we have solved this outside of Elm is:

1) use SASS and deal w/ slow and (sometimes) error-prone compilation. The 
errors are due to LibSass's C implementation running through NPM. Bad 
things just happen from time to time and it's crazy slow for large 
projects. 

2) Find a balance between inheritance (perhaps css resets + shared utility 
classes like .error-text) + component-css (auto-scoped css that only 
affects the component matching that file 
(https://github.com/ebryn/ember-component-css)).

These are the two places I would focus the brilliant minds of the Elm 
community. Hypothetically, if Elm could offer a promise like this:

"With ELM, you style your app w/ a similar syntax as you write SASS (but w/ 
native compilation) and you can add those styles to any module you want and 
they will be scoped to that view, but pulled out at compilation time to a 
separate CSS include"

I think some eyes would open and it would be yet another reason to give Elm 
a shot.

Again, just my two cents... I spent some time w/ elm-css and it's a steep 
learning curve and will alienate a large segment of people. Add to this 
having to learn a new markup language (a whole 'nother conversation) and it 
starts to feel like the markup and styling side of things come secondary to 
the business logic side of things.

On Tuesday, May 31, 2016 at 2:26:37 AM UTC-7, Peter Damoc wrote:
>
> How do you handle styling in your Elm programs? 
>
> Do you use one of the following libraries?
>
> rtfeldman/elm-css
>
> seanhess/elm-style
>
> massung/elm-css
>
> Or do you do something completely different (manual style inlining, 
> classes and external css) ? 
>
> I tried using Sean's library but I quickly ran into pseudo-selectors 
> trouble wanting to implement a simple hover effect. 
>
> Somehow, keeping a set of hover states for some simple nav-link seams such 
> an overkill. 
>
> How do you handle such scenarios? 
>
>
>
> -- 
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>

-- 
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] elm-package.json hierarchy?

2017-07-03 Thread Raoul Duke
thanks, cool.

-- 
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 pretty printers written in Elm?

2017-07-03 Thread 'Rupert Smith' via Elm Discuss
On Monday, July 3, 2017 at 6:17:22 PM UTC+1, Max Goldstein wrote:
>
> Can you please tell us more about what you are trying to pretty print 
> (JSON?) and why (restraints, assumptions, etc)?


To begin with Java code, XML, Elm code. I do a lot of stuff with code 
generators and currently use something horrible called String Template. I 
want to move away from that and am considering using Elm, or perhaps Frege 
or the other Haskell on JVM implementation, or Haskell, Ocaml. Doesn't need 
to be too sophisticated to start with, indentation and long line breaking.

-- 
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] elm-package.json hierarchy?

2017-07-03 Thread Peter Damoc
It is advisable to have elm-packages.json` in specialty folders like
`examples` or `tests`
Those folders might require packages that you don't want to add as
dependencies to the main `elm-packages.json`


On Mon, Jul 3, 2017 at 9:12 PM, Raoul Duke  wrote:

> Is there very often a good reason to have more than one
> elm-package.json in a project's tree, outside of elm-stuff/? If not,
> it would perhaps be nice if elm-package warned me that I am trying to
> (accidentally, duh) install packages in a subdir of a project that
> already has a higher/top level elm-package.json, so that I don't then
> have to spend more time cleaning up that accidental mess.
>
> --
> 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.
>



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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-package.json hierarchy?

2017-07-03 Thread Raoul Duke
Is there very often a good reason to have more than one
elm-package.json in a project's tree, outside of elm-stuff/? If not,
it would perhaps be nice if elm-package warned me that I am trying to
(accidentally, duh) install packages in a subdir of a project that
already has a higher/top level elm-package.json, so that I don't then
have to spend more time cleaning up that accidental mess.

-- 
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: deprecating packages?

2017-07-03 Thread Raoul Duke
Apparently, looking on http://package.elm-lang.org/,
elm-community/elm-linear-algebra "The following packages have not been
updated for 0.18 yet!" Maybe the elm-package help text could say that,
at least in this case it would seem to help be choose which one to
use. Of course, if something with a very similar name ever does get
updated it would be back to being less obvious which to prefer.

-- 
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] deprecating packages?

2017-07-03 Thread Raoul Duke
The 1st and 3rd of these look awfully similar, thus confusing. Doing a
quick google search didn't immediately make it obvious to me which to
prefer, either.


```
Here are some packages that have similar names:

elm-community/linear-algebra
opensolid/linear-algebra
elm-community/elm-linear-algebra
elm-community/array-extra

Maybe you want one of those?
```

-- 
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] Looking for pretty printers written in Elm?

2017-07-03 Thread Max Goldstein
Can you please tell us more about what you are trying to pretty print (JSON?) 
and why (restraints, assumptions, etc)?

-- 
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] Looking for pretty printers written in Elm?

2017-07-03 Thread 'Rupert Smith' via Elm Discuss
There is this one, which I would need to upgrade from 0.17:

http://package.elm-lang.org/packages/vilterp/elm-pretty-print/1.0.1

Any others?

-- 
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] any editor supports elm simple whole-buffer reformat?

2017-07-03 Thread Chad Woolley
FWIW, I was able to get elm-format to auto-format on save in Jetbrains IDEs
(RubyMine specifically, but should work in any of them).  Took a little
extra scripting glue and macros, but it worked.

-- Chad

On Fri, Jun 30, 2017 at 2:49 PM, Raoul Duke  wrote:

> hi,
>
> One use case I have in all programming systems is to auto reformat a whole
> file buffer (let alone a whole directory tree of code). I tried doing that
> in emacs elm-mode but it seems that it doesn't quite know enough to do what
> I am hoping for. Is there any emacs mode for elm that knows what to do
> automagically?
>
> I also just tried it in atom, with language-elm, and it doesn't seem to
> know either. Is there any good working editor system that can do it? Is
> there something about elm's BNF-or-whatever that prevents editors from
> being able to do it? (Does it support my long held believe that whitespace
> sensitive syntax being a bad idea when all concerns are weighed? :-)
>
> (I did try to get set up with lighttable but that was sort of a miserable
> experience for me to date, so i haven't gotten to the point of trying auto
> reformat there.)
>
> thank you!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] any editor supports elm simple whole-buffer reformat?

2017-07-03 Thread 'Rupert Smith' via Elm Discuss
On Monday, July 3, 2017 at 7:55:41 AM UTC+1, Zachary Kessin wrote:
>
> I have found elm and emacs work just fine it just takes some fine tuning
>

Care to share some of your emacs configuration? 

-- 
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: How to manage long running computations in Elm?

2017-07-03 Thread 'Rupert Smith' via Elm Discuss
On Monday, July 3, 2017 at 9:42:09 AM UTC+1, Jakub Hampl wrote:
>
> In JS, you could measure the time of each iteration and then only do so 
> many that it would fit into a “frame budget” (so < 16ms, or if you are 
> updating the DOM you would probably only spend say 10ms). However, I’m not 
> sure how easy that would be in Elm.
>

Yes, I was considering that. I have a function that takes an argument 'n' 
which tells it how many loops of the search to run (or terminate sooner if 
it finds a goal state). I was thinking of running say 10 iterations and 
timing how long that takes, then using the throughput from that (= num 
iterations / time taken) to estimate how many iterations would fit in what 
you call a "frame budget". Then on subsequent iterations try and do a frame 
budgets worth each time.

Could work. Or web workers. 

-- 
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: How to manage long running computations in Elm?

2017-07-03 Thread Jakub Hampl
In JS, you could measure the time of each iteration and then only do so many 
that it would fit into a “frame budget” (so < 16ms, or if you are updating the 
DOM you would probably only spend say 10ms). However, I’m not sure how easy 
that would be in Elm.

On Jul 2, 2017, 20:59 +0300, 'Rupert Smith' via Elm Discuss 
, wrote:
> On Friday, June 30, 2017 at 9:43:51 AM UTC+1, Jakub Hampl wrote:
> > One way of approaching this is to show the user progress in an interesting 
> > way. In this example, the computation that calculates the final layout of a 
> > network graph (which is pretty expensive) is animated so the user can watch 
> > the algorithm converge.
>
> Nice example, I like how you can interrupt it by clicking on one of the other 
> examples, so the UI is not getting frozen.
>
> One thing about this example, is that is driven off of a timer tick. So if 
> each iteration of the node layout takes say one microsecond of CPU time, and 
> the timer ticks every millisecond - it will only use 1/1000th of the CPU. Its 
> fine for animation.
>
> In my case I don't want to use a timer tick to drive the computation, because 
> I want to use 100% of the CPU (or close to it) to complete a computation as 
> quickly as possible, but still not block user interaction.
>
> We had a good first Elm Scotland Meetup btw, hope you can make the next one.
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/elm-discuss/M5teKjboylI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.