Re: [elm-discuss] Re: Moving Color to evancz/graphics

2016-09-29 Thread Janis Voigtländer
Given this:

The Gradient type is opaque, so it’s impossible for anyone but
evancz/graphics to use it.

How about moving the Gradient type and functions related to it to
evancz/elm-graphics?
​

-- 
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] Print date/time as text like '3 days ago'

2016-09-29 Thread Jacky See
I'm wondering how can I print a date/time as '3 days ago' like this library 
http://timeago.yarp.com/ ?

What I can think of is to use subscription and Time.every to pass current 
date time to model for rendering.
Is it possible to update current date to model only when update function is 
called?

-- 
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: Moving Color to evancz/graphics

2016-09-29 Thread Matthew Griffith

elm-style-animation accepts the Color types from core as arguments for 
color property animations. So does my color mixing library (though who 
knows how many people use that :)  I'm working on another library that 
utilizes it as well.

Having a centralized idea of color seems like a pretty basic and useful 
thing to me, even if two prominent libraries don't use it directly.  Moving 
it to evancz/graphics means I have to either make my users depend on 
evancz/graphics(which doesn't make a ton of sense as they're probably using 
the html/svg libraries), or it means that every library that wants to work 
with color has to export their own type, which seems a bit much as well.

So, I guess I'm happy where it is:)

-Matt










On Thursday, September 29, 2016 at 4:17:38 PM UTC-4, Nick H wrote:
>
> P.S. If this sounds like a good idea, I am happy to do the work.
>
> On Thu, Sep 29, 2016 at 1:16 PM, Nick H  > wrote:
>
>> Hi everybody,
>>
>> Since 0.18 is going to involve some module juggling in core, I thought 
>> this would be a good time to bring this up.
>>
>> This is a follow-up to an elm-discuss thread from last month. Robin 
>> argued that the Color module should not be in elm-lang/core. I agreed and 
>> suggested that it be moved to evancz/graphics.
>>
>> For me the strongest indicator that Color doesn't belong in core is to 
>> look at who depends on it. Neither of the UI-related elm-lang packages 
>> (html, svg) use it. elm-css and elm-mdl both define their own color types.
>>
>> The only library that operates well with Color is evancz/graphics. 
>> Furthermore, it is the only one that can use the entire thing. The Gradient 
>> type is opaque, so it's impossible for anyone but evancz/graphics to use it.
>>
>> I hate to suggest "one more thing" to add to the release, but it feels 
>> like low-hanging fruit. I'm sure there is a reason Color stayed behind when 
>> Graphics was extracted. One way or the other, it should be easy to decide. 
>> And if it makes sense to move it, the lack of dependencies means the change 
>> would be easy to implement.
>>
>> Thanks for humoring me,
>>
>> ~Nick
>>
>
>

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


[elm-discuss] Re: elm-make behavior different between localhost dev and production

2016-09-29 Thread OvermindDL1
Not really, exrm is pretty easy (I've not migrated to distillery yet, I 
have an old project), but I did 
find https://github.com/epsanchezma/exrm-heroku although it appears pretty 
old but could try it, if it works then exrm could deploy straight to heroku.


On Thursday, September 29, 2016 at 2:06:49 PM UTC-6, Wil C wrote:
>
> I checked on both, and they're both elm 0.17.1
>
> [ruby-2.2.0 ~/projects/code/pithy  master]
>>  > elm -v
>> 0.17.1
>> [ruby-2.2.0 ~/projects/code/pithy  master]
>>  > heroku run "elm -v"
>> Running elm -v on ⬢ pithy... up, run.5500
>> 0.17.1
>
>
> Yeah, I'm using Phoenix. Ah, I just wanted something simple to get up and 
> running, so I didn't mess around with exrm or distillery. When I have more 
> time, I'll get that going instead. Got any tips or links to a write up on 
> how to package it up in exrm/distillery and throw it on heroku?
>
>
> Wil
>
>
>
> On Thursday, September 29, 2016 at 7:19:31 AM UTC-7, OvermindDL1 wrote:
>>
>> Hmm, I use the same type of setup with the same type of arguments as you 
>> though I've not tried heroku.  Is the elm version between your dev machine 
>> and heroku the same?  It looks like you might be using phoenix, you really 
>> should be generating a production output of all files on your dev server so 
>> that manifests are built, code is optimized, and everything is packed 
>> together into a release (via exrm or distillery) and you should deploy that 
>> release to heroku instead as it is entirely self-contained and standalone. 
>>  I use the release process and never had an issue.
>>
>>
>> On Thursday, September 29, 2016 at 3:06:55 AM UTC-6, Wil C wrote:
>>>
>>> Hi all,
>>>
>>> I have a puzzling situation that I hope someone can shed some light on. 
>>> I'm using elm with elixir, and compiling it with elm-brunch. I'm able to 
>>> 'brunch build' without a problem locally, but on the remote heroku servers, 
>>> I get the following problem:
>>>
>>> remote:Running default compile
 remote:Elm compile: src/rei.elm, in web/elm, to 
 ../static/vendor/rei.js
 remote:*I cannot find module 'Codefragment'.*
 remote:
 remote:Module 'Rei' is trying to import it.
 remote:
 remote:Potential problems could be:
 remote:  * Misspelled the module name
 remote:  * Need to add a source directory or new dependency to 
 elm-package.json
 remote:29 Sep 08:42:47 - error: Compiling of 
 web/elm/src/rei.elm failed. Command failed: 
 ../../node_modules/elm/binwrappers/elm-make --yes --output 
 ../static/vendor/rei.js src/rei.elm
 remote:I cannot find module 'Codefragment'.
 remote:
 remote:Module 'Rei' is trying to import it.
 remote:
 remote:Potential problems could be:
 remote:  * Misspelled the module name
 remote:  * Need to add a source directory or new dependency to 
 elm-package.json
 remote: 
>>>
>>>
>>> I checked that the source_directories are set. my elm-package.json is:
>>>
>>>
>>> {
 "version": "1.0.0",
 "summary": "helpful summary of your project, less than 80 
 characters",
 "repository": "https://github.com/user/project.git;,
 "license": "BSD3",
 

 *"source-directories": ["src"],*
 "exposed-modules": [],
 "dependencies": {
 "elm-lang/core": "4.0.5 <= v < 5.0.0",
 "elm-lang/html": "1.1.0 <= v < 2.0.0"
 },
 "elm-version": "0.17.1 <= v < 0.18.0"
 }
>>>
>>>
>>> All the elm files are under web/elm/src. my brunch's config files for 
>>> elm is:
>>>
>>>   plugins: {
 elmBrunch: {
   elmFolder: "web/elm",
   

 *mainModules: ["src/rei.elm"  ],*
   outputFolder: "../static/vendor",
   executablePath: "../../node_modules/elm/binwrappers"
 },
 babel: {
   // Do not use ES6 compiler in vendor code
   ignore: [/web\/static\/vendor/]
 }
   },
>>>
>>>
>>> Reading brunch-elm code  
>>> and 
>>> the mainModules should be correct. However, through trial and error, 
>>> "src/rei.elm" fails on production, but not on my local machine. However, 
>>> using "src/*.elm" seems to not fail in production, but while it compiles, 
>>> it doesn't seem to write to the output. 
>>>
>>> Has anyone else run into this? It seems like elm-make has a different 
>>> behavior on macos, compared to on heroku.
>>>
>>> For now, I'm just committing the generated file to the repo, which 
>>> works. But I'd rather have the file build in production. If someone has 
>>> something to shed the light on this, I'd really appreciate it.
>>>
>>> Wil
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group 

[elm-discuss] What's the convention for modules with more than one word?

2016-09-29 Thread Wil C
Oddly enough, for the stuff I've written in elm, I've not had to name a 
multi-word module.

What's the naming convention for multi-word modules? Is it CamelCase for 
the module name, but snake_case for the file name? I can't seem to find an 
example.

Wil

-- 
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] Elmish -- Ruby inspired by Elm (I couldn't wait till April 1st)

2016-09-29 Thread j weir
Ruby is not Elm, don't even try to make it something it is not.

Not listening to my own advice here is a silly Ruby module which is 
inspired by Elm.

https://github.com/jweir/elmish

Punch line here (ie example) below:

require './elmish'

module Counter
  extend Elmish

  Actions %w|
Noop
Inc
IncN/Fixnum  # defines a Union type which takes a Fixnum
Dec
DecN/Fixnum
  |

  def self.init
[Inc, 0]
  end

  def self.update(msg, state)
case msg
when Inc then
  [Noop, state + 1]
when IncN then
  [Noop, state + msg.value]
when Dec then
  [Noop, state - 1]
when DecN then
  [Noop, state - msg.value]
else
  raise 'hell'
end
  end
end

def log(action, state)
  return_action, new_state = Counter.update action, state
  puts "#{action} #{state} -> #{new_state}"
  [return_action, new_state]
end

_, state = Counter.init
_, state = log(Counter::Inc, state)
_, state = log(Counter::IncN(3), state)
_, state = log(Counter::DecN(2), state)
_, state = log(Counter::Dec, state)
_, state = log(Counter::DecN('wrong!'), state)




-- 
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 to sell Elm to your client / boss

2016-09-29 Thread Martin DeMello
I think the best way to sell elm to your client/boss is to point to a
reasonably large scale project you have done in elm, and talk about your
experiences with it. Another alternative is to talk about the benefits you
gained from integrating small bits of elm into a larger project.

I'd be wary of selling my boss/client on any technology that I didn't have
in-depth experience of some sort with, because you never know what pitfalls
you might face after you have already committed a few months to it.

martin

On Thu, Sep 29, 2016 at 3:53 AM, Thibaut Assus 
wrote:

> Hello, I just posted a new blogpost on Medium :
>
> https://medium.com/elmlightments/how-to-sell-elm-to-your-client-boss-
> d2a697e7f8fe#.6t7mtl550
>
> Looking forward for your feedback
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[elm-discuss] elm-combine - Josh Adams and Corey Haines pair to create a Game of Life decoder

2016-09-29 Thread Josh Adams
I posted a story on medium wherein Corey and I paired to create a game of 
life decoder using Bogdan's (excellent) elm-combine.

https://medium.com/@dailydrip/josh-adams-and-corey-haines-pair-programming-and-test-driving-a-game-of-life-parser-in-elm-176487214f2d#.xf37z6dau

I've started referring to what I do as "staring at the docs and feeling 
dumb and then finally understanding it after a long time"-as-a-service. 
 Maybe it's helpful to some people! :)

-Joshie

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

2016-09-29 Thread Eduardo Cuducos
This idea makes a lot of sense to me. We, as developers, could go
“automagically” from JSON to Model if they match — and the Json.Decode will
still be there if one needs to parse a JSON differently.

On Thu, Sep 29, 2016 at 12:36 PM 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

> On Thursday, September 29, 2016 at 4:35:06 PM UTC+1, Rupert Smith wrote:
>>
>> I also have a little problem with the 'roles' encode to solve. At the
>> moment I have:
>>
>> , ( "roles"
>>   , case model.roles of
>> Just roles ->
>> roles |> List.map roleEncoder |> Encode.list
>>
>> Nothing ->
>> Encode.null
>>   )
>>
>> which will mean 'null' is output when the roles are Nothing.
>>
>
> Another option would be if Encode provided 'missing : Value', which means
> skip that field, but it doesn't.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[elm-discuss] Re: Routing, authentication etc. still on my 3rd Elm project.

2016-09-29 Thread 'Rupert Smith' via Elm Discuss
On Thursday, September 29, 2016 at 12:26:17 PM UTC+1, Wouter In t Velt 
wrote:
>
> Very useful to read your experiences with Elm. I am in a more-or-less 
> similar point on the learning curve.
> Small aside: The Elm Exts (extentions) package has a simple function 
> called catMaybes to filter out Nothings:
> catMaybes : List (Maybe a) -> List a
>
> Link here: 
> http://package.elm-lang.org/packages/krisajenkins/elm-exts/25.13.0/Exts-Maybe#catMaybes
>

Thanks, loads of useful stuff in Elm.Exts. 

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


[elm-discuss] Re: Is a decoder the right level of abstraction for parsing JSON?

2016-09-29 Thread 'Rupert Smith' via Elm Discuss
On Thursday, September 29, 2016 at 4:35:06 PM UTC+1, Rupert Smith wrote:
>
> I also have a little problem with the 'roles' encode to solve. At the 
> moment I have:
>
> , ( "roles"
>   , case model.roles of
> Just roles ->
> roles |> List.map roleEncoder |> Encode.list
>
> Nothing ->
> Encode.null
>   ) 
>
> which will mean 'null' is output when the roles are Nothing.
>

Another option would be if Encode provided 'missing : Value', which means 
skip that field, but it doesn't. 

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


[elm-discuss] Re: Is a decoder the right level of abstraction for parsing JSON?

2016-09-29 Thread 'Rupert Smith' via Elm Discuss
On Thursday, September 29, 2016 at 4:25:25 PM UTC+1, Rupert Smith wrote:
>
> Some scnearios that would need to be covered:
>>
>
I also have a little problem with the 'roles' encode to solve. At the 
moment I have:

, ( "roles"
  , case model.roles of
Just roles ->
roles |> List.map roleEncoder |> Encode.list

Nothing ->
Encode.null
  ) 

which will mean 'null' is output when the roles are Nothing. Which is not 
what I really want, as an explicit null will be interpreted by the server 
as meaning 'set the roles to null', whereas what I really want is no roles 
field set at all which the server will interpret as 'don't change the 
roles, they are not being defined by this request'.

But Encode.object takes a list of (String, Value) -> Value and its easiest 
for me to write this as an entry in a list rather than build up the list 
more conditionally. I suppose I could output a list of Maybe Value and then 
use the filter to remove Nothings from that list to arrive at a list of 
Value just for fields that are not Nothing.

I suppose what I am trying to point out, is that auto generating encoders 
and decoders requires dealing with a lot of different conventions depending 
on how you want it done. If I was using something like jackson in Java, the 
behaviour would be controlled by a set of flags when building the parsers, 
like "allowNoQuotes", "allowMissingFields", and so on. I think any attempt 
at auto generating would need to look at a good number of common variations 
in how json is treated and provide options to deal with them, in order to 
not be overly restrictive and useful.

-- 
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: Can anyone get linter-elm-make working on Atom?

2016-09-29 Thread 'Rupert Smith' via Elm Discuss
On Thursday, September 29, 2016 at 3:19:01 PM UTC+1, Magnus Rundberget 
wrote:
>
> Have you tried running `elm-make src/elm/Main.elm --output /dev/null` on 
> your project ? 
>

I did try that and noted that it fails.

It succeeds during the grunt build when elm-make is invoked, because all of 
the .elm files are passed to it explicitly.

I was not aware that directory name/structure has to exactly match the 
module name/structure in Elm. Is that officially required by the language 
or just a convention that one has to adopt to use linter-elm-make?

On Thursday, September 29, 2016 at 3:31:38 PM UTC+1, halohalospecial wrote:
>
> Hi!  I cloned https://github.com/rupertlssmith/thesett_style_lab and I 
> think the problem is that your directories are in lowercase (e.g. "menu" 
> instead of "Menu").  Can you try renaming them?
>

Thanks. You are right, renaming the directory to Menu instead of menu did 
help to find Menu.Types, but also the problems noted by Magnus above need 
to be sorted too. 

So I have quite a lot of moving and renaming to do to try and get this to 
work...

-- 
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] About `programWithFlags` naming

2016-09-29 Thread OvermindDL1
On Thursday, September 29, 2016 at 8:31:57 AM UTC-6, Bobby Priambodo wrote:
>
> I don't know if the use case (giving data to Elm app on init) is common 
> enough to justify doing that, though.
>

It has been so far for me, but still that is why I suggest having it 
default to some nil value like `()` or equivalent.  :-) 

-- 
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] About `programWithFlags` naming

2016-09-29 Thread Bobby Priambodo
`programWithArgs` could also work, but I agree that your second option can
make it more consistent throughout Elm apps (we will then just have
`beginnerProgram` and `program`). I don't know if the use case (giving data
to Elm app on init) is common enough to justify doing that, though.

On 29 September 2016 at 21:15, OvermindDL1  wrote:

> I'd personally use `programWithArgs`, or just `program` and bake flags in,
> defaulting to an empty tuple or some other nil type or so that comes from
> javascript's `undefined`.  Like define init via `init () = { blah model }`
> for the 'no argument' case, that way it accepts 'undefined' from
> javascript, such as when there is no argument passed in from javascript.
>
>
> On Wednesday, September 28, 2016 at 10:28:12 PM UTC-6, Bobby Priambodo
> wrote:
>>
>> Yeah, that’s also the conclusion I came to after some reasoning. But I
>> still think that it’s kind of confusing for first-timers in Elm; it might
>> make sense if the context was a CLI program, but I don’t think I've heard
>> it used in, say, web applications (other than feature flags). It’s great
>> that now it’s in the guide, but it was not on my first pass and left me
>> effectively confused.
>>
>>
>> If we want to be explicit, why not something along the lines of
>> `programWithInitialValues`?
>>
>> On Thursday, 29 September 2016 03:22:18 UTC+7, Nick H wrote:
>>>
>>> I think it's pretty common to use "flag" to refer to any option passed
>>> to a program when it starts. For instance, in
>>>
>>> elm-make src/Main.elm --output=main.js
>>>
>>> the "--output=main" is often referred to as a flag, even though it is
>>> not a boolean value.
>>>
>>> On Wed, Sep 28, 2016 at 12:55 AM, Bobby Priambodo 
>>> wrote:
>>>
 Hi! I'm building my first Elm app using the embed-to-HTML approach. I'm
 already using a backend (Node.js with Hapi), and since I think
 server-side-rendering is not supported anytime soon, I'm just passing the
 data from the server to Elm through JS interop.

 I've initially used subscription ports to do it, but several days ago
 Evan updated the interop part in guide.elm-lang.org/interop/jav
 ascript.html to show how to do it with `programWithFlags`. I remember
 skimming through the docs and saw that function, but I didn't even think
 that it will achieve what it does. It's kind of unintuitive that
 `programWithFlags` means "an app which allows initializing model through
 JS", since in many programming stuff "flags" just mean boolean values or
 switches.

 Was there any reason why it's named that 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...@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.
>



-- 
*Bobby Priambodo*

*+62 896 8815 7020*
*bobby.priamb...@gmail.com *

-- 
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: Can anyone get linter-elm-make working on Atom?

2016-09-29 Thread halohalospecial
Hi!  I cloned https://github.com/rupertlssmith/thesett_style_lab and I 
think the problem is that your directories are in lowercase (e.g. "menu" 
instead of "Menu").  Can you try renaming them?

-- 
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 sell Elm to your client / boss

2016-09-29 Thread Thibaut Assus
Hello, I just posted a new blogpost on Medium :

https://medium.com/elmlightments/how-to-sell-elm-to-your-client-boss-d2a697e7f8fe#.6t7mtl550

Looking forward for your feedback

-- 
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: Can anyone get linter-elm-make working on Atom?

2016-09-29 Thread Magnus Rundberget
Hi !

Have you tried running `elm-make src/elm/Main.elm --output /dev/null` on 
your project ? 
I'm getting all kind of errors due to erroneous module naming all over the 
place.

in Main.elm you try to import Main.Types, but Types.elm lives in the root 
folder (src/elm) so it should be named Types in it's module declaration and 
when importing it from Main it should be import Types.
... and so on and so on

Maybe you used to have a Main folder at some point ? 


bottom line. Make sure your project can build on the command line, then I'm 
sure the atom plugin will be much more cooperative !

-magnus



On Thursday, 29 September 2016 11:24:30 UTC+2, Rupert Smith wrote:
>
> On Wednesday, September 28, 2016 at 4:42:32 PM UTC+1, OvermindDL1 wrote:
>>
>> It works fine for me (also get Atom's elmjutsu plugin, made by same 
>> person as linter-elm-make and they work wonderfully together).
>>
>> So first of all the src directory in elm-package.json should be as it 
>> normally is in elm-package.json, the root directory of all your elm source, 
>> mine for example is:
>> ```json
>> "source-directories": [
>> "web/elm"
>> ],
>> ```
>> In linter-elm-make I also have 'Lint as you type' enabled, 'Always 
>> compile main' enabled (be sure to set your project main file(s) as per 
>> linter-elm-make instructions!  I.E. open the file, open command pallete, 
>> type 'main' and choose "Linter Elm Make: Set Main Paths".  With that it 
>> works wonderfully and real-time for me (and again, get elmjutsu).
>>
>
> Thanks for the advice. I tried all the above, also setting a 'work 
> directory'. It still doesn't work... perhaps I just need to add more stuff 
> to Main Paths? or can one even set /src/**/*.elm as the main path?
>
> Here is an example project set up with linter-elm-make that is not working:
>
> https://github.com/rupertlssmith/thesett_style_lab 
>

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


[elm-discuss] Re: elm-make behavior different between localhost dev and production

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


On Thursday, September 29, 2016 at 3:06:55 AM UTC-6, Wil C wrote:
>
> Hi all,
>
> I have a puzzling situation that I hope someone can shed some light on. 
> I'm using elm with elixir, and compiling it with elm-brunch. I'm able to 
> 'brunch build' without a problem locally, but on the remote heroku servers, 
> I get the following problem:
>
> remote:Running default compile
>> remote:Elm compile: src/rei.elm, in web/elm, to 
>> ../static/vendor/rei.js
>> remote:*I cannot find module 'Codefragment'.*
>> remote:
>> remote:Module 'Rei' is trying to import it.
>> remote:
>> remote:Potential problems could be:
>> remote:  * Misspelled the module name
>> remote:  * Need to add a source directory or new dependency to 
>> elm-package.json
>> remote:29 Sep 08:42:47 - error: Compiling of web/elm/src/rei.elm 
>> failed. Command failed: ../../node_modules/elm/binwrappers/elm-make --yes 
>> --output ../static/vendor/rei.js src/rei.elm
>> remote:I cannot find module 'Codefragment'.
>> remote:
>> remote:Module 'Rei' is trying to import it.
>> remote:
>> remote:Potential problems could be:
>> remote:  * Misspelled the module name
>> remote:  * Need to add a source directory or new dependency to 
>> elm-package.json
>> remote: 
>
>
> I checked that the source_directories are set. my elm-package.json is:
>
>
> {
>> "version": "1.0.0",
>> "summary": "helpful summary of your project, less than 80 characters",
>> "repository": "https://github.com/user/project.git;,
>> "license": "BSD3",
>> 
>>
>> *"source-directories": ["src"],*
>> "exposed-modules": [],
>> "dependencies": {
>> "elm-lang/core": "4.0.5 <= v < 5.0.0",
>> "elm-lang/html": "1.1.0 <= v < 2.0.0"
>> },
>> "elm-version": "0.17.1 <= v < 0.18.0"
>> }
>
>
> All the elm files are under web/elm/src. my brunch's config files for elm 
> is:
>
>   plugins: {
>> elmBrunch: {
>>   elmFolder: "web/elm",
>>   
>>
>> *mainModules: ["src/rei.elm"  ],*
>>   outputFolder: "../static/vendor",
>>   executablePath: "../../node_modules/elm/binwrappers"
>> },
>> babel: {
>>   // Do not use ES6 compiler in vendor code
>>   ignore: [/web\/static\/vendor/]
>> }
>>   },
>
>
> Reading brunch-elm code  
> and the 
> mainModules should be correct. However, through trial and error, 
> "src/rei.elm" fails on production, but not on my local machine. However, 
> using "src/*.elm" seems to not fail in production, but while it compiles, 
> it doesn't seem to write to the output. 
>
> Has anyone else run into this? It seems like elm-make has a different 
> behavior on macos, compared to on heroku.
>
> For now, I'm just committing the generated file to the repo, which works. 
> But I'd rather have the file build in production. If someone has something 
> to shed the light on this, I'd really appreciate it.
>
> Wil
>

-- 
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] About `programWithFlags` naming

2016-09-29 Thread OvermindDL1
I'd personally use `programWithArgs`, or just `program` and bake flags in, 
defaulting to an empty tuple or some other nil type or so that comes from 
javascript's `undefined`.  Like define init via `init () = { blah model }` 
for the 'no argument' case, that way it accepts 'undefined' from 
javascript, such as when there is no argument passed in from javascript.


On Wednesday, September 28, 2016 at 10:28:12 PM UTC-6, Bobby Priambodo 
wrote:
>
> Yeah, that’s also the conclusion I came to after some reasoning. But I 
> still think that it’s kind of confusing for first-timers in Elm; it might 
> make sense if the context was a CLI program, but I don’t think I've heard 
> it used in, say, web applications (other than feature flags). It’s great 
> that now it’s in the guide, but it was not on my first pass and left me 
> effectively confused.
>
>
> If we want to be explicit, why not something along the lines of 
> `programWithInitialValues`?
>
> On Thursday, 29 September 2016 03:22:18 UTC+7, Nick H wrote:
>>
>> I think it's pretty common to use "flag" to refer to any option passed to 
>> a program when it starts. For instance, in
>>
>> elm-make src/Main.elm --output=main.js
>>
>> the "--output=main" is often referred to as a flag, even though it is not 
>> a boolean value.
>>
>> On Wed, Sep 28, 2016 at 12:55 AM, Bobby Priambodo  
>> wrote:
>>
>>> Hi! I'm building my first Elm app using the embed-to-HTML approach. I'm 
>>> already using a backend (Node.js with Hapi), and since I think 
>>> server-side-rendering is not supported anytime soon, I'm just passing the 
>>> data from the server to Elm through JS interop.
>>>
>>> I've initially used subscription ports to do it, but several days ago 
>>> Evan updated the interop part in 
>>> guide.elm-lang.org/interop/javascript.html to show how to do it with 
>>> `programWithFlags`. I remember skimming through the docs and saw that 
>>> function, but I didn't even think that it will achieve what it does. It's 
>>> kind of unintuitive that `programWithFlags` means "an app which allows 
>>> initializing model through JS", since in many programming stuff "flags" 
>>> just mean boolean values or switches.
>>>
>>> Was there any reason why it's named that 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...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

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


[elm-discuss] Re: Routing, authentication etc. still on my 3rd Elm project.

2016-09-29 Thread Wouter In t Velt
Very useful to read your experiences with Elm. I am in a more-or-less 
similar point on the learning curve.
Small aside: The Elm Exts (extentions) package has a simple function called 
catMaybes to filter out Nothings:
catMaybes : List (Maybe a) -> List a

Link here: 
http://package.elm-lang.org/packages/krisajenkins/elm-exts/25.13.0/Exts-Maybe#catMaybes

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

2016-09-29 Thread Wil C
Hi all,

I have a puzzling situation that I hope someone can shed some light on. I'm 
using elm with elixir, and compiling it with elm-brunch. I'm able to 
'brunch build' without a problem locally, but on the remote heroku servers, 
I get the following problem:

remote:Running default compile
> remote:Elm compile: src/rei.elm, in web/elm, to 
> ../static/vendor/rei.js
> remote:*I cannot find module 'Codefragment'.*
> remote:
> remote:Module 'Rei' is trying to import it.
> remote:
> remote:Potential problems could be:
> remote:  * Misspelled the module name
> remote:  * Need to add a source directory or new dependency to 
> elm-package.json
> remote:29 Sep 08:42:47 - error: Compiling of web/elm/src/rei.elm 
> failed. Command failed: ../../node_modules/elm/binwrappers/elm-make --yes 
> --output ../static/vendor/rei.js src/rei.elm
> remote:I cannot find module 'Codefragment'.
> remote:
> remote:Module 'Rei' is trying to import it.
> remote:
> remote:Potential problems could be:
> remote:  * Misspelled the module name
> remote:  * Need to add a source directory or new dependency to 
> elm-package.json
> remote: 


I checked that the source_directories are set. my elm-package.json is:


{
> "version": "1.0.0",
> "summary": "helpful summary of your project, less than 80 characters",
> "repository": "https://github.com/user/project.git;,
> "license": "BSD3",
> 
>
> *"source-directories": ["src"],*
> "exposed-modules": [],
> "dependencies": {
> "elm-lang/core": "4.0.5 <= v < 5.0.0",
> "elm-lang/html": "1.1.0 <= v < 2.0.0"
> },
> "elm-version": "0.17.1 <= v < 0.18.0"
> }


All the elm files are under web/elm/src. my brunch's config files for elm 
is:

  plugins: {
> elmBrunch: {
>   elmFolder: "web/elm",
>   
>
> *mainModules: ["src/rei.elm"  ],*
>   outputFolder: "../static/vendor",
>   executablePath: "../../node_modules/elm/binwrappers"
> },
> babel: {
>   // Do not use ES6 compiler in vendor code
>   ignore: [/web\/static\/vendor/]
> }
>   },


Reading brunch-elm code  
and the 
mainModules should be correct. However, through trial and error, 
"src/rei.elm" fails on production, but not on my local machine. However, 
using "src/*.elm" seems to not fail in production, but while it compiles, 
it doesn't seem to write to the output. 

Has anyone else run into this? It seems like elm-make has a different 
behavior on macos, compared to on heroku.

For now, I'm just committing the generated file to the repo, which works. 
But I'd rather have the file build in production. If someone has something 
to shed the light on this, I'd really appreciate it.

Wil

-- 
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: Can anyone get linter-elm-make working on Atom?

2016-09-29 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, September 28, 2016 at 4:42:32 PM UTC+1, OvermindDL1 wrote:
>
> (also get Atom's elmjutsu plugin, made by same person as linter-elm-make 
> and they work wonderfully together).
>

That looks very useful. Hopefully one day someone will add 'extract 
function' and 'inline function' auto refactorings too.

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