[Haskell-beginners] Conciseness question

David Place d at vidplace.com
Sun Aug 7 18:52:59 CEST 2011


On Aug 7, 2011, at 12:36 PM, Manfred Lotz wrote:

> because then I have to write names d1, ..., d15 two times in order to
> get my definitions right. I'm looking for a more elegant way doing this.
> 
> 
> Hope this is a bit clearer what I'm after.

Yes, thank you, that is quite clear.   I think that is the best you can do in Haskell.  I really don't see it as inelegant at all.  You define the variables d1 through d15 and then dirList is a function of those definitions.   You type d1 once for its definition and next for its use.  You would like to combine the two activities?  Something like this perhaps?
 
dirLst  = [d1 = "somedir",  d15 = "otherdir"]

How would these variables be scoped?

____________________
David Place   
Owner, Panpipes Ho! LLC
http://panpipesho.com
d at vidplace.com






More information about the Beginners mailing list