[Haskell-beginners] Conciseness question
David Place
d at vidplace.com
Sun Aug 7 22:27:11 CEST 2011
On Aug 7, 2011, at 3:55 PM, Manfred Lotz wrote:
>>
>> import Data.Map (Map, (!), lookup)
>>
>> lookup ConfigAppDir myDirs
>> myDirs ! ConfigAppDir
>>
>
> This is the solution I like. I have to accept that here I cannot reach
> the conciseness of which might be due to Haskell being strongly typed.
In your original note, you mentioned that you have a small number of entries in your list of directories. If so, you might find that association lists work just fine for you without needing to import Data.Map.
> http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.html#v:lookup
More information about the Beginners
mailing list