[Haskell-beginners] How would you write...

David McBride toad3k at gmail.com
Tue Apr 22 18:47:12 UTC 2014


There is nothing wrong with using real functions from a library, but you
never said what library it was or even enough info to guess.  Was it
diagrams?  Gloss?  FOV?  Or something you wrote?

If the library doesn't matter, as it didn't in this case, you can just
specify the types like so

data Color = Color

translate :: Int -> Int -> ()
translate = undefined

color :: Color -> ()
color = undefined

red :: Color
red = undefined

so that at least your snippet compiles for others.



On Tue, Apr 22, 2014 at 2:37 PM, John M. Dlugosz
<ngnr63q02 at sneakemail.com>wrote:

> On 4/22/2014 8:58 AM, Kim-Ee Yeoh wrote:
>
>>
>> On Tue, Apr 22, 2014 at 3:00 PM, John M. Dlugosz <
>> ngnr63q02 at sneakemail.com
>> <mailto:ngnr63q02 at sneakemail.com>> wrote:
>>
>>     chain1 = [ translate x y $ color red $ Circle r | (x,y,r) <- pappus
>> 100 [1..10] ]
>>
>>
>> What is translate? What is color? What is Circle? What is pappus?
>>
>> None of this is plain haskell.
>>
>> John, if you make your readers guess at undefined names, they'll go away
>> and hangout
>> somewhere friendlier!
>>
>> -- Kim-Ee
>>
>>
>>
>
> Sorry — I thought showing a form that did work would be enough.  The
> important part is that I have a input = map foo [0..10] and a bar
> (t1,t2,t3) = baz where baz returns a tuple, and the result of bar is the
> guts of another map.
>
> I didn't realize that using real words from a library instead of foo and
> bar was considered unfriendly!
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140422/9adf2cef/attachment-0001.html>


More information about the Beginners mailing list