Re: [elm-discuss] Pattern matching on aliased types

2016-06-03 Thread Joey Eremondi
ng return it with 'x' appended >> as a result. If it is a number return its increment? >> If what I am asking makes no sense, what are the potential usages of non >> tagged union types? >> >> -- >> Thanks >> >> On Friday, 3 June 2016 22:25:59 UTC+1, Joey Erem

Re: [elm-discuss] An array of arbitrarily nested arrays?

2016-06-06 Thread Joey Eremondi
It's not directly possible: what would the type of such an array be? What's the problem you're trying to solve with this? You could do something like: type NestedList a = Element a | InnerList (List (NestedList a)) Then you mark each element as either being a single item, or a deeper

Re: [elm-discuss] Static Tzpe Checking in Elm vs Java

2016-05-26 Thread Joey Eremondi
kill eventually! But I like how Idris feels so far, >>> and I like the extra inference features you get from the extra type >>> precision too... >>> >>> Zachary Kessin <zkes...@gmail.com> schrieb am Mi., 25. Mai 2016 04:13: >>> >>>>

Re: [elm-discuss] Re: Feature Request: Code Generation/ Macro System

2016-06-11 Thread Joey Eremondi
> > elm-package could require package names to be at a certain "distance" from > one another That still doesn't resolve the problem of running arbitrary code. If our community gets big enough that I don't know and trust every author from this mailing list, we need a way to stop people from being

Re: [elm-discuss] Re: Feature Request: Code Generation/ Macro System

2016-06-11 Thread Joey Eremondi
Some things to consider: *Templating and Macros are Separate Issues* We can decide that we want to allow for macros for brief code generation, without making a separate templating language. I'm with Max on the sentiment that having to learn a new language. *Macros *need* to be type safe, but

Re: [elm-discuss] Download elm

2016-05-30 Thread Joey Eremondi
Are you on Linux? BuildFromSource needs Internet access because it is fetching several different projects from github. You could try using the npm installer: https://www.npmjs.com/package/elm Want to install elm from source already tried with buildfromsource.hs but it also connects with internet.

Re: [elm-discuss] Re: [ANN] ElmFiddle.io - Elm snippets sharing made almost entirely using Elm

2016-05-26 Thread Joey Eremondi
Either that or GHCJS, which seems to have a lot more support from the Haskell community. (Not sure why though). Looking here it sounds like GHCJS is more complete and closer to GHC, but Haste makes

Re: [elm-discuss] Re: [ANN] ElmFiddle.io - Elm snippets sharing made almost entirely using Elm

2016-05-26 Thread Joey Eremondi
time to try again. > If anyone has experience with GHCJS a client side elm com.piler can be > awesome! > On May 26, 2016 11:02 PM, "Joey Eremondi" <joey.eremo...@gmail.com> wrote: > >> Either that or GHCJS, which seems to have a lot more support from the >&g

Re: [elm-discuss] Download elm

2016-05-30 Thread Joey Eremondi
I'm confused what the actual problem is. You need to use internet to get Elm. Are you in a situation where you're behind a proxy? The npm page I linked gives instructions for how to deal with that. If you want to build them yourself, you need to download elm-compiler, elm-make, and elm-package

Re: [elm-discuss] Learning Elm and feeling alone in the world

2016-06-20 Thread Joey Eremondi
You a Haskell" has already been adapted. I hope the community can > contribute more to this project - > https://github.com/learnyouanelm/learnyouanelm.github.io > > > fredag 13. november 2015 20.26.36 UTC+1 skrev Joey Eremondi følgende: >> >> It's worth noting that

Re: [elm-discuss] Documentation for packages removed from Core is too hard to find

2016-05-23 Thread Joey Eremondi
Perhaps there could be an option for a "landing page" or multi-version README, so the documentation for the old versions can point to the new versions? Like, a PackageInfo.md in master on GitHub? Or maybe, when a library is deprecated, it should be good practice to release a "dummy" version with

Re: [elm-discuss] Will ELM become a general purpose language?

2016-05-22 Thread Joey Eremondi
> > Will ELM ever be something I can replace Python with? Evan has explicitly said that we won't be compiling to JS forever, and there is a lot of interest in Elm on the server side. So I think we can say that Elm will most likely become a general purpose language. That said, to my knowledge,

Re: [elm-discuss] Static Tzpe Checking in Elm vs Java

2016-05-24 Thread Joey Eremondi
Are you interested in the actual type checking algorithms, or just the type systems? Big differences of the type systems: * Elm has tagged union types, meaning that you can make a value that many have one of many types, and pattern match on its possible variants. * Elm has type inference, Java

Re: [elm-discuss] Result.mapX should be Result.foldlX?

2016-07-25 Thread Joey Eremondi
Being fully parallelizable is a nice side-effect for the List version (and functional programming in general), bit that's not what actually makes a map a map. First, realise that List, (Result a), Maybe, etc. are all "type constructors". You give them a type argument, then they are a type. List

[elm-discuss] Elm page of the new StackOverflow docs

2016-07-21 Thread Joey Eremondi
StackOverflow just announced a new Community Documentation feature, and there's already an Elm page up: http://stackoverflow.com/documentation/elm/topics I think this has the possibility to fill a different purpose than the main Docs or the GitBook, mainly that it is very example oriented, and

Re: [elm-discuss] Elm inspired by ML?

2016-07-30 Thread Joey Eremondi
I'd say Elm is a mix of ML and Haskell (which is itself ML inspired) ML: : for type signatures :: for cons Strict evaluation No typeclasses (extensible) Records Let-expressions instead of where statements Haskell: no mutable variables Left to right notation for type constructors ("List a"

Re: [elm-discuss] Re: Scope for shorter syntax?

2016-07-31 Thread Joey Eremondi
Elm currently lets you do something similar. If you have type alias MyRecord = {init : Foo, view : Bar, update : Baz, subscriptions : Something} then you can do Html.App.program (MyRecord init view update subscriptions ) where it follows the order they were declared in the type alias. What

Re: [elm-discuss] elm first impressions (and frustrations)

2016-07-31 Thread Joey Eremondi
> > ok, no package manager options Did you try NPM? https://www.npmjs.com/package/elm I also don't fully understand why the Mac installer isn't suitable: http://install.elm-lang.org/Elm-Platform-0.17.1.pkg ...and the download is not served over https It's downloading source, not

Re: [elm-discuss] Scope for shorter syntax?

2016-07-31 Thread Joey Eremondi
ubscriptions )" >> is *not* shorter than >> the long version of Html.App.program { init = init, view = view, update = >> update, subscriptions = subscriptions }. So, not really sure of your point. >> >> Secondly, you mention variables? To the best of my knowledge,

Re: [elm-discuss] Elm Jobs Board

2016-07-31 Thread Joey Eremondi
Advertising jobs, this is probably the best place, though you'll probably get good feedback on reddit.com/r/elm as well. You can look for jobs here, but Elm is *very* new. I'm sure there are a few people hiring Elm developers, but I doubt there are many specifically looking for Elm people. On

Re: [elm-discuss] Elm Records as a platform-agnostic data type?

2016-08-01 Thread Joey Eremondi
I'm not sure this is a great idea. Syntax-wise, Elm records aren't different that much from JSON. But in terms of semantics, they can store any Elm value, which includes functions and other things that can't be serialized well. At the end of the day, an Elm record is just a mapping from names to

Re: [elm-discuss] Re: Which text editor do you prefer for Elm?

2016-08-10 Thread Joey Eremondi
Elm-light is full of features, and actively maintained by someone who is pretty active on this mailing list, which is nice. https://github.com/rundis/elm-light On Aug 10, 2016 7:56 AM, "Nick H" wrote: > I use emacs elm-mode too, and I agree that the default formatting

Re: [elm-discuss] elm-lang.org's Framework

2016-08-10 Thread Joey Eremondi
Elm is frontend only, so Haskell is what's running on the back end and actually serving the HTML and js. As for framework, I think it's using Snap as a Haskell Web framework. So, I'm looking at elm-lang.org's source ( github.com/elm-lang/elm-lang.org ), and I see that very little of its code is

Re: [elm-discuss] Re: Record update syntax

2016-08-14 Thread Joey Eremondi
, but that's how you get the hundreds of GHC extensions like Haskell has, most of which break type inference and require you to annotate things yourself. On Sun, Aug 14, 2016 at 9:47 AM, Joey Eremondi <joey.eremo...@gmail.com> wrote: > @OvermindDL1: I'm still grokking what you've proposed,

Re: [elm-discuss] Re: Record update syntax

2016-08-14 Thread Joey Eremondi
@OvermindDL1: I'm still grokking what you've proposed, but it's problematic for a few reasons. I'm 99% sure that it can't be done in a way that is type safe. What you're doing doesn't need Higher-Kinded types, it's just not type safe, at least not as how it's presented here. One is that you've

Re: [elm-discuss] installation on Mint 18

2016-08-12 Thread Joey Eremondi
Can you show is the output of 'echo $PATH' ? You might just have to manually add the Elm directory to your path. On Aug 12, 2016 2:07 AM, "'audun' via Elm Discuss" < elm-discuss@googlegroups.com> wrote: > I have searched the group for answers to my question, but didn't find any > relevant ones.

Re: [elm-discuss] Improve Elm docs.

2016-07-14 Thread Joey Eremondi
Key-value pairs is a misnomer. Records are name-value pairs, the same way that you can give names to members of a Python objects. So while the docs need to be fixed, I think the use of the term "key-value" pair is the problem. In Python, you can do myObject.foo, but not myObject."foo" or

Re: [elm-discuss] Converting regex submatches to tuple?

2016-07-20 Thread Joey Eremondi
Follow Nick's suggestion, use :: instead of :, otherwise you'll get a weird parse error. They're reversed in Haskell, which I was working in when I responded, so I got confused. On Wed, Jul 20, 2016 at 4:30 PM, Nick H wrote: > The submatches can't be a tuple because

[elm-discuss] DependencyCI, new CI tool with Elm support

2016-07-12 Thread Joey Eremondi
I haven't tried it, but they list Elm as one of their supported languages on the main page, which is also some nice exposure for us. As usual, it's free to use with open-source projects. https://dependencyci.com/ -- You received this message because you are subscribed to the Google Groups "Elm

Re: [elm-discuss] Re: Should [ 1..5 ] exist?

2016-08-04 Thread Joey Eremondi
of these give [3.5,4.5,5.5]. Who's right? Who knows. But it's confusing currently. On Thu, Aug 4, 2016 at 2:36 PM, Joey Eremondi <joey.eremo...@gmail.com> wrote: > If we went crazy with this, most keywords / common functions from other >> languages would be listed as keywords for their

Re: [elm-discuss] Re: Should [ 1..5 ] exist?

2016-08-04 Thread Joey Eremondi
> > If we went crazy with this, most keywords / common functions from other > languages would be listed as keywords for their elm equivalents > and it could make life easier, I imagine A far more robust solution is just to have Hoogle-like search, where you put in the type, and it tells you what

Re: [elm-discuss] Better componentization - Language Addition [Proposal]

2016-08-06 Thread Joey Eremondi
I will keep an eye on them. > > > El sábado, 6 de agosto de 2016, 18:46:28 (UTC+2), Joey Eremondi escribió: >> >> Hi Fernando. Thanks for your input! A few things: >> >> 1. Why can't you just do this: >> type Action = LoginOut | EventAction Events >> >

Re: [elm-discuss] Better componentization - Language Addition [Proposal]

2016-08-06 Thread Joey Eremondi
Hi Fernando. Thanks for your input! A few things: 1. Why can't you just do this: type Action = LoginOut | EventAction Events i.e. you create a new tag for Action that lets you use an Events 2. Do you know how this will affect type inference? Elm's type system is nearly maximal, in the sense

Re: [elm-discuss] Shouldn't this kind of naming error... be an error?

2016-08-02 Thread Joey Eremondi
I'm not sure that the problem is that the filename doesn't match the module name, but that the module name needs to start with a capital letter. That's why it's a syntax error: the parser is looking for a capitalized word, and it's not seeing one. Certainly the message could be more clear and

Re: [elm-discuss] Re: Unit Types : A Radical Proposal

2016-07-28 Thread Joey Eremondi
There is also some prior art with Haskell for this: https://hackage.haskell.org/package/uom-plugin https://hackage.haskell.org/package/units https://hackage.haskell.org/package/Measure On Thu, Jul 28, 2016 at 12:33 PM, Duane Johnson wrote: > > On Thu, Jul 28, 2016

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

2017-01-23 Thread Joey Eremondi
+1. My previous concerns basically go away if the "core" elm people make an effort to upvote newbie threads and comments on the weekly beginner thread. If new people get ~5 upvotes, that should be enough to make them not feel excluded. But yeah, moderation, pinned FAQs/guidelines, and all that

Re: [elm-discuss] Benchmarking with no JavaScript dependencies

2017-01-27 Thread Joey Eremondi
> > I have some thoughts on how to fix the effectful functions… namely, > lifting them to Tasks. But that doesn't seem like quite the right approach, > since Tasks can fail and these can't. This makes me think that an effect > module may be the best way to handle this. > Couldn't you just make

Re: [elm-discuss] I wish ELM could just be used in the browser

2017-01-28 Thread Joey Eremondi
Also: if you don't have a separate compiler, what's the point of static types? On Sat, Jan 28, 2017 at 10:38 AM, Peter Damoc wrote: > Elm was designed to help with reliability and maintainability of large > scale apps. > > If it is a toy app or if reliability and

Re: [elm-discuss] Re: How to pattern match nested types?

2017-01-29 Thread Joey Eremondi
This is certainly a case where the message could be better, perhaps we should log it at https://github.com/elm-lang/error-message-catalog if something similar is not already there. Types and expressions (including Constructors) are in different namespaces. So while there is a Type named Response,

Re: [elm-discuss] Re: How to pattern match nested types?

2017-01-29 Thread Joey Eremondi
either the compiler distinguishes between implicit & > explicit declarations, or constructors and tags are treated differently (my > money's on the latter). > > On Sunday, 29 January 2017 23:25:25 UTC, Joey Eremondi wrote: >> >> This is certainly a case where the message

Re: [elm-discuss] Why are unbound type variables forbidden for functions in records?

2017-01-20 Thread Joey Eremondi
> > toString and the equality operators are the only functions that take > arguments of unspecified type and return a value with a fixed type Except for functions that ignore their argument. It's perfectly valid to do intoInt : a -> Int intoInt _ = 3 But it's probably not what you're looking

Re: [elm-discuss] Re: Elm doesn't seem to do do TCO in my case. Bug?

2017-01-20 Thread Joey Eremondi
But Succ shouldn't be called recursively, it should just take its argument, wrap it in a record, and return immediately. So Succ is getting called 5000 times, but never in a stack 5000 deep. (This is clearly the case, because if it wasn't returning, we'd never hit the continue to jump back to the

Re: [elm-discuss] New to Elm, need help understanding type Node msg = Node in source code

2017-02-15 Thread Joey Eremondi
1. In node, the msg parameter is for the types of messages the node can emit. So if you have a text-box that emits messages when its value changes, it could have type "Node String". 2. The "type Node msg = Node" is really just some hackery to get things working with Native. It's just declaring to

Re: [elm-discuss] Is type inference in Elm fully decideable?

2017-02-10 Thread Joey Eremondi
Here's the paper you're looking for: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/scopedlabels.pdf I believe it's fully decidable. Elm is basically Damas Milner plus these records, so it stays decidable. It's usually called row polymorphism, and isn't really subtyping,

Re: [elm-discuss] Re: [Suggestion] Type values and simplifying the language still

2017-01-15 Thread Joey Eremondi
I don't think this would actually make the language simpler, for the following reason: *Flat is Better than Nested* When you only allow one value per tag, you end up having records/tuples nested inside of tagged-union types. Your nesting gets deeper and more complex. So while it clearly makes

Re: [elm-discuss] Edit New issue Support for unicode "variables"?

2017-01-19 Thread Joey Eremondi
So, I'm all for internationalization and full Unicode support. But separately, is Japanese the primary language of you or those who will be reading and maintaining your code? Because if not, this seems like a really bad naming practice. It greatly hurts the readability of your code to those who

Re: [elm-discuss] Why are unbound type variables forbidden for functions in records?

2017-01-20 Thread Joey Eremondi
I'm still grokking what you want, but I think what you're describing is higher-rank polymorphism. This is unlikely to end up in Elm any time soon: it's pretty advanced, and it breaks type inference. If you *really* want a language that has it, try Haskell(GHCJS) or PureScript. But I suspect

Re: [elm-discuss] Remove ways of importing except `import exposing (..)`?

2016-08-18 Thread Joey Eremondi
Okay, so I think this is somewhat of a special case. The problems you are running into come because toString is provided by Basics, so you expected your import to shadow it, but it did not. This is a bit of a tricky scenario: * The typechecker can't help us, because Basics.toString has type

Re: [elm-discuss] Remove ways of importing except `import exposing (..)`?

2016-08-18 Thread Joey Eremondi
riable `toX` is ambiguous. > > > 5| toX "r" > > ^^^ > > Maybe you want one of the following? > > > Module1WithToX.toX > > Module2WithToX.toX > > > > On Thursday, August 18, 2016 at 10:23:57 PM UTC+1, Joey Eremondi wrote: >>

Re: [elm-discuss] Please explain 'type Never = Never Never'

2016-08-21 Thread Joey Eremondi
It is, and that's the point. Never is a type with no values. The only way to construct one is to already have one. Doing it that way is just a nice way to ensure that nobody can accidentally create a Never value. It's most useful as a type parameter, for example, as the error type of a task.

Re: [elm-discuss] TypeNats, SafeList and Array-Multidim updated for 0.17

2016-08-21 Thread Joey Eremondi
mmunity organizations have dropped elm- prefixes > from package names, or are in the process of doing so, because something > like elm-community/elm-list-extra reads strange. I don’t think anything > is wrong or inappropriate with JoeyEremondi/elm-typenats, though. > ​ > >

[elm-discuss] TypeNats, SafeList and Array-Multidim updated for 0.17

2016-08-20 Thread Joey Eremondi
Hi All, I've updated my libraries for 0.17. Nothing changed really for the API, but I've changed the naming to match the "don't start with elm-" guideline. http://package.elm-lang.org/packages/JoeyEremondi/typenats/1.0.0

Re: [elm-discuss] Decoding JSON with variable key names

2016-08-05 Thread Joey Eremondi
What are you trying to do? It looks like you're encoding what is basically a Dict: http://package.elm-lang.org/packages/elm-lang/core/4.0.4/Dict If you use a dict, the Json.Decode.Dict function is probably what you want: http://package.elm-lang.org/packages/elm-lang/core/4.0.4/Json-Decode#dict

Re: [elm-discuss] Moderating elm-discuss

2016-09-06 Thread Joey Eremondi
I check the list basically constantly, so I would be willing to act as a moderator purely for the purpose of spam removal. Alternately, we could shift to a different system, that has better built in spam detection, and a higher barrier to entry than just having an email address... This would also

Re: [elm-discuss] Idea / suggestion: Debug.todo - Fill gaps during prototyping

2016-09-01 Thread Joey Eremondi
This is basically the same as Typed Holes, which Haskell has. There was a proposal for this a while back (which I fully support). https://groups.google.com/forum/#!searchin/elm-dev/type$20holes%7Csort:relevance/elm-dev/_mS33Io74vs/qR0qESkyBwAJ On Thu, Sep 1, 2016 at 5:21 PM, Max Goldstein

Re: [elm-discuss] Re: Missing deps trying to build elm-lang.org

2016-08-30 Thread Joey Eremondi
@suttlecommakevin Are you trying to use Elm from Hackage, or the Elm platform? Hackage elm is woefully out of date. On Tue, Aug 30, 2016 at 9:38 AM, Janis Voigtländer < janis.voigtlaen...@gmail.com> wrote: > You don't feel like telling us which GHC version you are trying to do this > with? > >

Re: [elm-discuss] Elm Runtime Exceptions

2016-09-07 Thread Joey Eremondi
So, a more nuanced statement would be "Elm has no unchecked runtime exceptions". We use Maybe and Result in place of Null and Exceptions. But the key is that the type system *forces* you to catch these. There's no (fromMaybe : Maybe a -> a) function, like there is in Haskell. What's also

Re: [elm-discuss] Re: Elm Runtime Exceptions

2016-09-08 Thread Joey Eremondi
@Dave Ford: that's literally what Maybe.andThen and Result.andThen are for. See also Maybe.map, and Result.map. They let you chain together several computations that may throw an exception. You can take a computation which throws an exception, and a computation which expects a non-exception

Re: [elm-discuss] (Meta) Does Google Groups automatically delete posts?

2016-09-09 Thread Joey Eremondi
Elm dev posts all need moderator approval before they appear . Yours probably got caught in the backlog? On Sep 9, 2016 1:15 AM, "John Bugner" wrote: > Note: I haven't used Google Groups before talking on elm-discuss and > elm-dev, so I don't fully understand how it works.

Re: [elm-discuss] Re: Module manipulation

2016-09-13 Thread Joey Eremondi
It's also worth mentioning that first class modules are a decent replacement for type classes. On Sep 13, 2016 7:28 AM, "OvermindDL1" wrote: > It seems you are wanting something like OCaml has, first-class modules > that can be passed around like types and data like OCaml

Re: [elm-discuss] Re: Sort a list of strings independant of case

2016-09-10 Thread Joey Eremondi
@Sergey Right, but the List.sortBy examples just sort based on the toUppercased version, but don't put the toUppercase results in the final list. sortBy is different than using List.map On Sat, Sep 10, 2016 at 1:00 PM, Sergey Zubtsovskiy < sergey.zubtsovs...@gmail.com> wrote: > Well, I meant

Re: [elm-discuss] What languages do you write your back-ends in?

2016-09-10 Thread Joey Eremondi
I used Haskell, but it's been a while since I've had a chance to work on an app with a backend... On Sep 10, 2016 8:57 AM, "Mario Sangiorgio" wrote: > Being compiled doesn't really mean that the compiler helps the programmer. > There is the need for a good type system

Re: [elm-discuss] Proposal: shorthand record names

2016-09-24 Thread Joey Eremondi
Can you give a concrete example of what this would look like in Elm? Are you sure this is compatible with type inference? On Sep 24, 2016 10:46 AM, "Zane Hitchcox" wrote: > Shorthand property names like in javascript >

Re: [elm-discuss] Elm could use some positive stories on Reddit

2016-10-07 Thread Joey Eremondi
> off their work. > > "I made this with Elm" is a lot more convincing than trying to argue for > or against some language feature. > > > > > > On Fri, Oct 7, 2016 at 6:49 PM, Joey Eremondi <joey.eremo...@gmail.com> > wrote: > >> There's a &qu

Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-07 Thread Joey Eremondi
If you want Exception Bubbling like that, use Maybe.andThen or Result.andThen. These are exactly what they are for. You can bubble your exceptions as high as you like, but (1) that bubbling is always expressed in the type signature, and (2) there's always something that will catch it eventually,

Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-07 Thread Joey Eremondi
n your whole program. Elm doesn't allow safety, it enforces safety. On Fri, Oct 7, 2016 at 10:11 AM, Joey Eremondi <joey.eremo...@gmail.com> wrote: > If you want Exception Bubbling like that, use Maybe.andThen or > Result.andThen. These are exactly what they are for. > > You ca

[elm-discuss] Elm could use some positive stories on Reddit

2016-10-07 Thread Joey Eremondi
There's a "PureScript vs Elm" thread going on on the Haskell Reddit right now: https://www.reddit.com/r/haskell/comments/569cax/factors_going_to_elm_purescript_selection/ Elm's getting a lot of negative press. I certainly don't want to start a flamewar, but I think it would be helpful it people

Re: [elm-discuss] View: Model -> Html Msg

2016-10-08 Thread Joey Eremondi
Exactly, it's a type parameter. Html is parameterized by the type of messages the form can produce. On Oct 8, 2016 9:25 AM, "Dave Ford" wrote: > I understand this function signature: > > update: Msg -> Model -> Model > > to mean the function takes two inputs, a Msg and a

Re: [elm-discuss] Maybe.andThen with List.foldr type trick?

2016-10-08 Thread Joey Eremondi
Oops, in the first case it should return Just [], not [] On Oct 8, 2016 9:02 AM, "Joey Eremondi" <joey.eremo...@gmail.com> wrote: > I'm not sure using and then will work like this in the accumulator, you're > giving it a list of thunks, but andThen tries to chain function

Re: [elm-discuss] Maybe.andThen with List.foldr type trick?

2016-10-08 Thread Joey Eremondi
I'm not sure using and then will work like this in the accumulator, you're giving it a list of thunks, but andThen tries to chain functions together, and your functions don't chain like that. How about this: forMaybe list = case list of [] -> [] hm::tm -> hm `andThen` \h -> (forMaybe tm)

Re: [elm-discuss] In

2016-10-08 Thread Joey Eremondi
Nothing except when paired with a let. You do let x = foo y = bar ... in baz This let's you break up large expressions, and avoid recomputing values that are used more than once. On Oct 8, 2016 9:26 AM, "Dave Ford" wrote: > What does the in keyword do? > >

Re: [elm-discuss] Re: Functional programming, or why should I use Elm instead of vanilla javaScript?

2016-10-06 Thread Joey Eremondi
You can get good code without Elm's type system, but what you won't get is a compiler as an assistant. Made a small typo? The compiler tells you. Mixed up the first and second arguments to a function? Usually a type error, so the compiler tells you. Most importantly, refactoring becomes easy.

Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-08 Thread Joey Eremondi
Do not use Either. The Result type in the standard library is the same, but with the names more intuitive. On Oct 7, 2016 11:58 PM, "Arthur Welf" wrote: > If you want error messages, you can use type Either: > > type Either a b > = Left a > | Right b > > You define the

Re: [elm-discuss] Re: Pattern matching functions

2016-10-08 Thread Joey Eremondi
Much like how we don't have where clauses, the general approach in Elm is to only have one syntax for a particular thing. On Oct 8, 2016 7:18 AM, "Luke Westby" wrote: > case .. of statements are only expressions, not functions, so you'll need > to continue wrapping those

Re: [elm-discuss] Some questions about types.

2016-09-20 Thread Joey Eremondi
Both int and float end up as a JS number at the end of the day, so definitely bounded. Defer to the JS spec? Not sure about bignum, there's definitely not language support, but there might be a library doing it somewhere, and if not, someone should write one! On Sep 20, 2016 10:03 PM, "'Rupert

Re: [elm-discuss] Can you have a port that takes no args? What is its type?

2016-09-16 Thread Joey Eremondi
If you need this, make it take an arg of type (), which is just a placeholder (0 element tuple to be precise, carries no data). port logout : () -> Cmd msg On Fri, Sep 16, 2016 at 7:13 AM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > port logout : Cmd msg > > yields:

Re: [elm-discuss] Re: Elm Runtime Exceptions

2016-09-07 Thread Joey Eremondi
The worst offender for runtime errors right now, in my mind, is this: myTest = (\x -> x) == (\y -> y) This crashes and prints a message to the console. But this has been discussed at length. On Wed, Sep 7, 2016 at 12:54 PM, Charlie Koster wrote: > Having said all of that,

Re: [elm-discuss] elm-lang/virtual-dom/VirtualDom.js, F2(), F3(), A2(), A3()

2016-08-23 Thread Joey Eremondi
https://github.com/elm-lang/elm-make/blob/master/src/Pipeline/Generate.hs They get bundled into the Runtime of a generated Elm file. They allow for currying of JS functions. F2 takes a 2-argument JS function and returns a curried version of it (takes one argument, and returns another function

Re: [elm-discuss] Partially applied record updates?

2016-08-28 Thread Joey Eremondi
There have been requests for this before. I personally think they'd be great, but there's not a current way to do it other than lambda. On Aug 28, 2016 2:42 PM, "Esad Hajdarevic" wrote: > Hi, > > with the current Elm syntax, is there a way to partially apply a record > update?

Re: [elm-discuss] Partially applied record updates?

2016-08-28 Thread Joey Eremondi
his approach could even >> delegate the type checking to the type checker and just rely on the syntax >> tree. >> >> You could write a code generator which created methods which act like >> copy, one for each field, or one big one where each field was a Maybe type. >> &g

Re: [elm-discuss] Is the 'as' keyword officially part of Elm?

2016-09-27 Thread Joey Eremondi
It's official as far as I know, just poorly documented. I can't imagine why it would go away, it's incredibly useful. But nothing is 100% safe before 1.0! A list of missing documentation would also be valuable. Not sure where the right place to put it would be though. On Tue, Sep 27, 2016 at

Re: [elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-26 Thread Joey Eremondi
Yeah, aliases make easy to write, but harder to read and learn, since a user might have only ever seen one and might not know what the other does. On Wed, Oct 26, 2016 at 11:42 AM, Mike MacDonald wrote: > Aliases could also remain forever, so people could choose which they

Re: [elm-discuss] Re: Is Elm really wrong?

2016-11-10 Thread Joey Eremondi
> > Nobody has done this (or similar) yet, to my knowledge My knowledge was wrong, apparently! On Thu, Nov 10, 2016 at 2:31 PM, Oliver Searle-Barnes wrote: > I'm surprised this hasn't come up already, http://package.elm-lang.org/ > packages/eeue56/elm-all-dict/latest > > --

Re: [elm-discuss] Re: Is Elm really wrong?

2016-11-10 Thread Joey Eremondi
Something else that hasn't been said: I don't think people have pushed current Elm to its limit yet. The big example is Dict. It is possible, in Elm, to write a dictionary which has its key type as a type parameter, which takes as an argument the comparison function between keys. This would allow

Re: [elm-discuss] Proposal: Rename case..of -> match..with

2016-10-20 Thread Joey Eremondi
There's precedence in both directions, case comes from Haskell. So changing it doesn't necessarily mean we'll match everyone else, pardon the pun. Being easier for non native English speakers seems pretty subjective, some people might find case more intuitive as non native speakers. To me, case

Re: [elm-discuss] Re: Can I throw strings at the elm compiler?

2016-10-21 Thread Joey Eremondi
Maybe take a look at what the Atom and Light table modes do? They both do something like this. On Oct 21, 2016 6:57 AM, "art yerkes" wrote: > Recently, I've been working on a cradle for the compiler that can serve as > an example for your use case > >

Re: [elm-discuss] OT: Elm Style formatting for other languages?

2016-10-19 Thread Joey Eremondi
Haskell has hindent, which (now) follows the Elm philosophy of having a single style, not customizable. It's quite as nicely spread out as Elm, but it's at least close. On Wed, Oct 19, 2016 at 9:52 AM, Peter Damoc wrote: > On Wed, Oct 19, 2016 at 3:02 PM, John Orford

Re: [elm-discuss] Rename Just to Something, as the counterpart to Nothing?

2016-11-25 Thread Joey Eremondi
> > type Maybe a = Nothing | Maybe a > To me this makes no sense. Maybe implies uncertainty: it's either there or it's not. But in the case that it's there, there's no uncertainty. Maybe 3 isn't uncertain, we know that the value is there. The uncertainty is in the type, before you pattern match,

Re: [elm-discuss] What is the motivation for using google groups?

2016-11-25 Thread Joey Eremondi
What's the story on importing old Google groups messages? Do we lose years of searchable history? On Fri, Nov 25, 2016 at 4:17 PM, OvermindDL1 wrote: > The Elixir forum (which has an Elm section if anyone wants to give it a > try) has resolved its mailing list oddities

Re: [elm-discuss] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Joey Eremondi
Honestly, these choices seem pretty arbitrary. Everyone has a preference. ML uses Some/None, Haskell uses Just/Nothing. Some people find Something intuitive, some don't. Given that the choices is (mostly) arbitrary, it seems best to stick with the status quo. On Mon, Nov 21, 2016 at 7:47 AM,

Re: [elm-discuss] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Joey Eremondi
l White <will.n.wh...@gmail.com> > wrote: > > I think that’s because you already know what Just means. I don’t think it’s > arbitrary though from an accessibility point of view. Some or None is > easier > for newcomers to understand than Just or Nothing, especially as Some isn’t

Re: [elm-discuss] Split a list into a list of lists with a comparator

2016-11-12 Thread Joey Eremondi
So, to be clear, you want to remove, and split on, any element that satisfies the predicate? How's this? splitWith : (a -> Bool) -> List a -> List (List a) splitWith = let helper accum current f lst = case lst of [] -> accum (first :: rest) -> if

Re: [elm-discuss] Re: Why Range syntax got removed in favor of List.range

2016-11-12 Thread Joey Eremondi
> > it's also not as flexible as a regular function > For example, if you want the range [0 .. n] for n in [0 .. k]: Old syntax: map (\x -> [0 .. x]) [0 .. k] New syntax: map (Range 0) (Range 0 k) Not much savings in terms of length, but one less lambda, since it turns into a partial

Re: [elm-discuss] Re: text editor in Elm

2016-11-19 Thread Joey Eremondi
> > there is no way to implement rich text editor in pure elm That's certainly not true, it's certainly possible, but you'd have to write all the editor code yourself, and there aren't (I think) any good libraries for doing it yet. On Sat, Nov 19, 2016 at 1:39 AM, Bulat Shamsutdinov <

Re: [elm-discuss] Re: Making imports more pleasant

2016-11-15 Thread Joey Eremondi
I'm not sure what your proposing, the Python syntax you stated does the exact same thing as exposing (..). Showing where a name came from would be a great IDE feature though, Haskell can do this on Atom and it's really helpful. On Nov 15, 2016 10:33 AM, "Alejandro Do Nascimento"

Re: [elm-discuss] Re: Why Range syntax got removed in favor of List.range

2016-11-14 Thread Joey Eremondi
It's also worth mentioning that adding syntax for something usually indicates that it's a "core" feature. In C-like languages, looping from integers in a range is the key iteration structure. But in Elm, fold and map are much more important. So having special syntax could give beginners the idea

Re: [elm-discuss] Re: control structure

2016-10-13 Thread Joey Eremondi
> > One current limitation of Elm is that there is no tail call elimination Like Janis says, this is not true, and in most cases, tail-recursive functions will become while-loops in the resulting JS. For example, consider a list-summing function: sum : List Int -> Int sum = let helper

Re: [elm-discuss] Firebase package - should be an effect module or native module?

2016-11-29 Thread Joey Eremondi
Is such a module even necessary? Couldn't you just write a library that uses the existing http library? Then it could be published. On Nov 29, 2016 11:36 AM, "Nick H" wrote: > (I mentioned version 0.16 because I think that is when the native review > process was

Re: [elm-discuss] Why latest versions of elm-compiler not available on Hackage?

2016-12-09 Thread Joey Eremondi
Jan, can you tell us about your use case? Elm-compiler doesn't export the parser as a library. If you're looking to do stuff like that, elm-format might be a better starting point for a parser: https://github.com/avh4/elm-format The syntax is not exported as an API because it is subject to

Re: [elm-discuss] Stance on native APIs for 0.18?

2016-12-15 Thread Joey Eremondi
> > sticking it into a monad does not make it any more reasonable The thing is, it's not about calling unreasonable code, it's about calling *potentially* unreasonable code. Putting it in a Monad doesn't make it more reasonable, but it means that the reasonability of pure Elm code is not

  1   2   >