Re: [elm-discuss] Re: Why does this not work via record intersection

2016-10-09 Thread Martin DeMello
thanks! now that i know the answer i can see that it was in the docs under
"extensible records", but it was indeed non-obvious.

martin

On Sun, Oct 9, 2016 at 9:09 PM, Max Goldstein 
wrote:

> You need a rather non-obvious piece of syntax:
>
> make_xword : { a | rows : Int, cols : Int } -> Xword
>
> This basically means that the input is a record with rows and cols, and
> any other fields. The origin of this syntax is that any record *a*, as
> long as it's extended with these fields, is acceptable.
>
> --
> 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: Why does this not work via record intersection

2016-10-09 Thread Max Goldstein
You need a rather non-obvious piece of syntax:

make_xword : { a | rows : Int, cols : Int } -> Xword

This basically means that the input is a record with rows and cols, and any 
other fields. The origin of this syntax is that any record *a*, as long as 
it's extended with these fields, is acceptable.

-- 
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] Why does this not work via record intersection

2016-10-09 Thread Martin DeMello
If I have the following:

make_xword : { rows : Int, cols : Int } -> Xword

import Xword exposing (Xword, make_xword)

type alias InCell =
  { x : Int
  , y : Int
  , contents : String
  }

type alias InXword =
  { rows : Int
  , cols : Int
  , cells : List InCell
  }

to_xword : InXword -> Xword
to_xword input =
  make_xword { rows = input.rows, cols = input.cols }

why can I not replace the last function with

to_xword : InXword -> Xword
to_xword input =
  make_xword input

since input is a superset of {rows; cols}?

martin

-- 
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: Anyone working on audio stuff?

2016-10-09 Thread Francesco Orsenigo
I did this https://github.com/xarvh/elm-audio



On Sunday, October 9, 2016 at 11:24:10 AM UTC+11, ratvis wrote:
>
> Either just HTLM5 audio element or web-audio? I kind of thought after .17 
> came out, some more stuff would come out. 
> Just a wrapper thing around html5 audio (onPause, onEnded,...) would 
> enable people to do fun stuff. 
>

-- 
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-new, a CLI tool for initializing new Elm projects

2016-10-09 Thread Erkal Selman
great, I needed something like this. 
thanks.

On Monday, August 8, 2016 at 9:11:15 AM UTC+2, Simone Vittori wrote:
>
> I recently worked on elm-new, a tool for creating a project scaffolding to 
> get started with Elm more easily and quickly. Please check it out:
>
> https://github.com/simonewebdesign/elm-new
>
> Personally I had the need to do some quick prototyping with Elm, but 
> always having to manually create a Main.elm file with the usual Elm 
> architecture boilerplate was repetitive work.
>
> Initially what I did was just create a generic project I could reuse every 
> time I wanted to build a new prototype. But then I figured it wasn't too 
> hard to automate this workflow, so I made elm-new.
>
> It works very similarly to other tools such as `mix new`, useful for 
> starting a new Elixir project. Also the Clojure community has `lein new` 
> that does the same.
>
> I hope the Elm community will find this tool useful. I'm happy to hear 
> suggestions for making it better.
>
>

-- 
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-new, a CLI tool for initializing new Elm projects

2016-10-09 Thread Simone Vittori
Thanks for the feedback guys, I decided to publish it on npm. Now you can 
do:

npm install -g elm-new

@Witold, feel free to install it locally if you want, but I think "global" 
makes more sense for this tool. It's something you may want to use 
independently between projects.

create-elm-app is pretty cool indeed, however it's also very different from 
elm new. My tool not only is independent from Node, it also tries to stay 
unopinionated. I'll write a blog post to explain my view when I have time.


On Monday, 8 August 2016 08:11:15 UTC+1, Simone Vittori wrote:
>
> I recently worked on elm-new, a tool for creating a project scaffolding to 
> get started with Elm more easily and quickly. Please check it out:
>
> https://github.com/simonewebdesign/elm-new
>
> Personally I had the need to do some quick prototyping with Elm, but 
> always having to manually create a Main.elm file with the usual Elm 
> architecture boilerplate was repetitive work.
>
> Initially what I did was just create a generic project I could reuse every 
> time I wanted to build a new prototype. But then I figured it wasn't too 
> hard to automate this workflow, so I made elm-new.
>
> It works very similarly to other tools such as `mix new`, useful for 
> starting a new Elixir project. Also the Clojure community has `lein new` 
> that does the same.
>
> I hope the Elm community will find this tool useful. I'm happy to hear 
> suggestions for making it better.
>
>

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