[Haskell-beginners] Conciseness question
Michael Snoyman
michael at snoyman.com
Sun Aug 7 15:19:41 CEST 2011
Sorry, forgot to explain the phrase. In Hebrew, the ending "ayim" is
the dual form, used often for limbs (yadayim = hands, raglayim = feet,
etc). "Paam" means "time", and "paamayim" means "two times". "Nekuda"
means dot/period, and "nekudotayim" means two dots (== colon).
Paamayim Nekudotayim therefore is double-double dots, or two colons.
On Sun, Aug 7, 2011 at 4:17 PM, Michael Snoyman <michael at snoyman.com> wrote:
> I was just glancing through that chapter when I saw the phrase
> "Paamayim Nekudotayim." I was most certainly not expecting Hebrew
> phrases to pop up here. Has this phrase somehow made it into a larger
> circle without my knowing, or is there some explanation out there as
> to why it's used in LYAH?
>
> On Sun, Aug 7, 2011 at 4:10 PM, Thiago Negri <evohunz at gmail.com> wrote:
>> Hey Manfred.
>>
>> Take a look at "Record Syntax" topic of the book "Learn you a Haskell
>> for great good". It looks like what you want.
>>
>> http://learnyouahaskell.com/making-our-own-types-and-typeclasses#record-syntax
>>
>> Thiago.
>>
>> 2011/8/7 Manfred Lotz <manfred.lotz at arcor.de>:
>>> Hi all,
>>> In Lua I could do something like this:
>>>
>>> -- initialize empty table
>>> P = {}
>>>
>>> P.a = "bla1"
>>> P.b = "bla2"
>>>
>>> and so on.
>>>
>>> Now I can refer to each value by name, and I also can easily iterate
>>> over the table P.
>>>
>>>
>>> How can I do something similar in Haskell. Note: I do want only write
>>> each variable one time (or two times if I count the type definition).
>>>
>>>
>>> I thought about:
>>>
>>> data P = P {
>>> a :: String,
>>> b :: String
>>> }
>>>
>>> Then I have one definition
>>>
>>> pval = P {
>>> a = "bla1",
>>> b = "bla2"
>>> }
>>>
>>> Now I could refer to each val easily, e.g. a pval. However, I don't see
>>> that I could iterate over the members of pval.
>>>
>>>
>>> It there a way to do what I want without defining a list like this?
>>> pls p = [ (a p), (b p)]
>>>
>>> Perhaps a comletely different way?
>>>
>>>
>>>
>>> --
>>> Manfred
>>>
>>>
>>>
>>> _______________________________________________
>>> Beginners mailing list
>>> Beginners at haskell.org
>>> http://www.haskell.org/mailman/listinfo/beginners
>>>
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>
More information about the Beginners
mailing list