[Haskell-beginners] Re: Is this overkill?
Magnus Therning
magnus at therning.org
Sun Apr 5 12:08:20 EDT 2009
Chaddaï Fouché wrote:
> On Sat, Apr 4, 2009 at 5:20 AM, Zachary Turner <divisortheory at gmail.com> wrote:
>>> With Conal's semantic editor combinators
>>>
>>> http://conal.net/blog/posts/semantic-editor-combinators/
>>>
>>> it would be written as
>>>
>>> trueIndices =
>>> (result . result) (map fst . filter snd . zip [0..]) (zipWith (&&))
>>
>> That was a pretty interesting blog post, and easily understandable which is
>> always nice. Thanks for the link. I also had never even used the zipWith
>> function, so thanks for pointing out that equivalence.
>
> I'm not sure you really want to write this pointfree... Generally I
> tend to avoid it when there's two arguments of identical standing.
> Also the (map fst . filter snd...) is a Data.List function
> (findIndices) :
>
> trueIndices xs ys = findindices id $ zipWith (&&) xs ys
>
> I love the pointfree style and it might be a good exercise to try and
> transcribe any function to pointfree, but sometimes pointful is just
> clearer.
Or to put it differently, sometimes "pointfree is pointless" ;-)
/M
--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnus@therning.org Jabber: magnus@therning.org
http://therning.org/magnus identi.ca|twitter: magthe
Haskell is an even 'redder' pill than Lisp or Scheme.
-- PaulPotts
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/beginners/attachments/20090405/cdb91aa1/signature.bin
More information about the Beginners
mailing list