[elm-discuss] Re: Why does this not work via record intersection
Monday, October 10, 2016 at 5:09:39 AM UTC+1, 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. > Just tagging as being for missing docs. Should really be described in http://elm-lang.org/docs/syntax#records -- 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: Why does this not work via record intersection
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
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.