Re: [elm-discuss] Elm events 2017

2017-04-05 Thread Christopher Anand
Not at the same level as the other events, but elm was featured at the 
can{CODE} 2017 conference (for high school students, organized by high school 
students).

https://www.cancodecanada.com


> On Apr 5, 2017, at 10:50 AM, Noah Hall  wrote:
> 
> There's a talk about Elm at flatmap by Erik Wendel, and a workshop run
> by me. Also, we're running https://osloelmday.no, a day dedicated to
> Elm talks in Oslo on the 10th of June. The call for papers are open!
> 
> On Wed, Apr 5, 2017 at 4:15 PM, Austin Bingham  
> wrote:
>> If you're still building this list, I've got an Elm talk at ACCU:
>> https://conference.accu.org/site/stories/2017/sessions.html#XFunctionalProgrammingfortheWebwithElm
>> 
>> Also, it looks like there is both an Elm workshop and a talk at NDC Oslo:
>> http://ndcoslo.com/
>> 
>> In case you never got an answer to your earlier question about NDC, it
>> doesn't have a specific focus per se, though it does tend to lean quite
>> Microsoft. There are efforts underway to give it a broader perspective, and
>> those seem to be working, though slowly.
>> 
>> On Friday, January 6, 2017 at 12:19:39 AM UTC+1, Rupert Smith wrote:
>>> 
>>> Thinking of drawing up a list of events, dates and places where Elm will
>>> be on the menu in 2017. Would people be interested in contributing what they
>>> know to build up the list? Also, I have a feeling someone may already have
>>> done this, in which case point me to it.
>> 
>> --
>> 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.

-- 
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] Svg without getBBox?

2017-02-01 Thread Christopher Anand
I got better results by using centered alignment and fixed-width text.  
Embedding html in svg was so unreliable, I gave up on it, but it seems to me 
that should be the right way of doing it.

> On Feb 1, 2017, at 8:16 AM, paplor...@gmail.com wrote:
> 
> Hello everyone,
> 
> I've been playing around with Elm recently and there are numerous things I 
> really like about it.
> I'm trying to create a simple SVG app (rectangle, text, arrow), but can't 
> seem to align them properly without getBBox (not even with monospaced fonts).
> E.g. how do you scale a G from the center otherwise?
> 
> Is there really no way to get back any information from the browser without a 
> proper event?
> 
> There seems to be a related topic, without any answers: 
> https://groups.google.com/forum/#!topic/elm-discuss/VvTZ2mXLYIU
> 
> Thanks!
> Pap Lőrinc
> 
> -- 
> 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] [Suggestion] Type values and simplifying the language still

2017-01-15 Thread Christopher Anand
I use constructors with multiple values a lot, so please don’t take them away.

> On Jan 15, 2017, at 11:15 AM, Maxime Dantec  wrote:
> 
> Not really, take this example :
> 
> type Foo = Bar ( Int, Bool, (String, Foo) )
> 
> foo : Int -> Bool -> (String, Foo) -> Foo
> foo = Foo << (,,)

How is  <<  (,,) easier to explain than ADTs?

ADTs are not just some syntax to be leaned, they are a powerful way to model 
data. The particular syntax is sparse, and you could argue the addition of 
labels would be an improvement, but I know many people who use elm or Haskell 
data types to document models before implementing them in other languages.  It 
is so quick, it is like type-checked pseudo-code.

> 
> And again, it seems to be the exception to have multiple values.
> 
> On Sunday, January 15, 2017 at 5:09:46 PM UTC+1, Janis Voigtländer wrote:
> This would take away the possibility of partially applying the constructors 
> like Bar. Not a good idea. There's a reason these have curried types. 
> 
> 
> Am 15.01.2017 um 17:03 schrieb Maxime Dantec :
> 
>> Not really, sorry I assumed that everybody knew how elm compile values but 
>> it was very presumptuous. Currently, all type values in Elm are converted in 
>> Javascript values in the { ctor, _0, _1... _n } shape. For example, Nothing 
>> becomes { ctor: "Nothing" } and (Just 10) becomes { ctor : "Just", _0: 10 }. 
>> The {type, value} part, would change that to : Nothing becomes { type: 
>> "Nothing" } and (Just 10) becomes { type : "Just", value: 10 }.
>> 
>> The { ctor, _0, _1... _n } shape is, I assume, why we can't automatically 
>> send type values though ports. The rationale is: if it's really the reason, 
>> since we barely use more than one value in type values, why not facilitate 
>> port usage instead of larger type values. Does it makes sense at all?
>> 
>> In other words, currently you can do that:
>> 
>> type Foo = Foo | Bar Int Bool (String, Foo)
>> where: Bar : Int -> Bool -> (String, Foo) -> Foo
>> that you use like this in elm: Bar 1 False ("fooBar", Foo)
>> which compiles down to in js: { ctor: "Bar", _0: 10, _1: false, _2: { ctor: 
>> "Tuple2", _0: "fooBar", _1: { ctor: "Foo"} } }
>> 
>> It would become impossible, because the type value Bar has 3 values.
>> Instead, you would have to give only one value to the Bar constructor :
>> 
>> type Foo = Bar { id: Int, isSomething: Bool, foo: (String, Foo) }
>> where: Bar : { id: Int, isSomething: Bool, foo: (String, Foo) } -> Foo
>> that you would use like this: Bar { id = 0, isSomething = False, foo = 
>> ("fooBar", Foo) }
>> would compiles down to: { type: "Bar", value: { id: 0, isSomething: false, 
>> foo: ["fooBar", { type: "Foo" }] } }
>> 
>> The record could be as well replaced by a Tuple ( Int, Bool, (String, Foo) )
>> 
>> I hope it's clearer enough?
>> 
>> On Sunday, January 15, 2017 at 4:33:50 PM UTC+1, Duane Johnson wrote:
>> I'm trying to see if I understand your suggestion correctly.
>> 
>> So would an enumeration like this:
>> 
>> type Msg
>> = ClickedButton
>> | EnteredAge value
>> | EnteredHeight value
>> 
>> become...
>> 
>> type Msg = { action : String, value : String }
>> 
>> ?
>> 
>> I'm trying to figure out how you'd "authorize up to one value" in a 
>> situation like this, since the whole point of an enumeration is to allow 
>> multiple possibilities.
>> 
>> Duane
>> 
>> On Sun, Jan 15, 2017 at 6:59 AM, Maxime Dantec > wrote:
>> Hi folks,
>> 
>> The last 3 versions of elm were somewhat unusual for a young programing 
>> language: features were removed and it has been simplified, to the point 
>> that you can't remove anything else. Well, about that.
>> 
>> I believe that the last thing that could be simplified still are ADT. No 
>> type value has more than one value in the core repository, with the 
>> exception of Dict and Color. I have used a few types with more than one 
>> value myself, but I hardly see the difference with a type value that has 3 
>> values and a type value that has a tuple3 as unique value, if you except the 
>> constructor signature. Does yourself make an intensive usage of this feature?
>> 
>> So here is my suggestion: Why not authorize up to one value to type values? 
>> If you need to bundle values, you can still use a tuple or a record. The 
>> reasoning behind this, is to get rid of the _0, _1, _2 in the "native" part 
>> of the type values. we could have {ctor:"Enum"} or {ctor:"TypeValue", value: 
>> {...}}, and why not automatic serializer/deserializers in the ports thanks 
>> to this too?
>> 
>> Everyone has an opinion, and it's very easy to make a suggestion while not 
>> implementing it. I'm not pretending that this is a good idea, I humbly think 
>> that it's worth mentioning given that it's in the scope of simplifying the 
>> language. Please share you opinion :)
>> 
>> Cheers!
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Elm Discuss" 

Re: [elm-discuss] What do you think Elm's biggest shortcomings are when it comes to natively supported API's?

2016-12-12 Thread Christopher Anand
I would use an elm-only audio solution in teaching.

> On Dec 12, 2016, at 1:00 PM, Rex van der Spuy  wrote:
> 
> 
> For me, these things would be nice to have:
>   * WebAudio API
> 
> That's a big one for me too because I use Elm exclusively for game and 
> "interactive multimedia" development. 
> At the moment I have to drop into ports for Audio - I'd love to it all in Elm.
> 
> -- 
> 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] control structure

2016-10-16 Thread Christopher Anand
Elm has “if", like ?: in C, and the more general “case".

If you don’t like the medium post below, maybe you would like

http://www.cas.mcmaster.ca/~anand/ThinkingComputationallyWithElm.pdf


> On Oct 16, 2016, at 6:05 PM, Patricia Nicole Benedicto 
>  wrote:
> 
> 
> thankyou :) but how about the selection control structure and i will ask 
> again about how elm declaring an array?  :)
> On Wednesday, October 12, 2016 at 7:37:18 PM UTC+8, Eduardo Cuducos wrote:
> Hi Patricia,
> 
> Elm, as a functional language, doesn't have for and while as declarative 
> languages. There a lot of paradigms to have in mind: the sort of problem 
> loops address in declarative languages usually is addressed with recursion in 
> Elm and other functional languages (as Duane said).
> 
> IMHO a really good introduction to these new paradigms is this series of 
> articles 
> https://medium.com/@cscalfani/so-you-want-to-be-a-functional-programmer-part-1-1f15e387e536
>  
> 
> 
> Hope you enjoy and come back with more doubts ; )
> 
> 
> 
> 
> 
> Eduardo Cuducos
> http://cuducos.me/ 
> 
> On Wed, Oct 12, 2016 at 8:29 AM, Peter Damoc  
> wrote:
> What do you need repetition for? 
> 
> If you give us some examples of what you are trying to achieve, maybe we can 
> give you some examples of how that would look in Elm. 
> 
> If you want to process each element of a list, `map` is the best option. 
> If you want to extract a sub list based on some criteria `filter` is needed 
> If you want to create a value from a list (like adding all elements in a list 
> of ints) then foldl or foldr are the functions to use. 
> 
> 
> 
> 
> On Wed, Oct 12, 2016 at 12:44 PM, Patricia Nicole Benedicto 
>  wrote:
> hi can i ask what is the repetiton control structucture of this programming 
> languages?
> 
> -- 
> 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 
> .
> 
> 
> 
> -- 
> 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...@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 
> .

-- 
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] Equality Error Undecidable

2016-07-11 Thread Christopher Anand [g]

> On Jul 11, 2016, at 7:28 PM, Mark Hamburg  wrote:
> 
> On Jul 11, 2016, at 4:23 PM, Mark Hamburg  wrote:
>> 
>> A bigger problem is that the requirement that something be equatable or the 
>> property that a type is not equatable becomes a hidden part of the interface.
> 
> So, here is a more harsh suggestion: if a type can't be locally proven 
> equatable, then it is not equatable.
> 
> This would break a lot of programs that use equality and inequality, but many 
> of those programs are arguably runtime errors waiting to happen.

Do you have examples of programs which would break and should not break?

I had assumed the pessimistic rule would be applied, anyway, although I’m sure 
I’ve deleted previous posts which would have told me otherwise.  :)

If there are equatable types which could not be proven so, it would be better 
to give as an error message that 

“The type you are testing for equality with (==) cannot be proven to be 
equatable at this time.  If you believe it really is equatable, try simplifying 
the involved code.”  

Christopher

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