Here is an Array:

```elm
import Array

Array.fromList [1, 90, 5, 2]
```

http://package.elm-lang.org/packages/elm-lang/core/4.0.5/Array

Note that in many cases a list is preferred to an Array (and they are
treated as separate types in Elm). Lists are for sequences of things that
need to be processed one by one, and usually all together. Arrays are for
sequences of things that you need to access one individually.

Duane

On Oct 16, 2016 4:05 PM, "Patricia Nicole Benedicto" <
patriciabenedict...@gmail.com> 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-f
>> unctional-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 <pda...@gmail.com> 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 <
>>> patriciab...@gmail.com> 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.

Reply via email to