On Wed, Jul 24, 2013 at 1:11 AM, Andreas Abel <andreas.a...@ifi.lmu.de> wrote:
> On 23.07.13 4:34 AM, Richard A. O'Keefe wrote:
>>
>>
>> On 22/07/2013, at 8:14 PM, Andreas Abel wrote:
>>
>>> Just today, my student asked me why the following program does nothing:
>>
>>
>> Did you ask your student why their code should not be torn into pieces,
>> burned to ashes, and incorporated into a pot for radioactive waste?
>>
>> All those occurrences of unsafePerformIO!
>
>
> No, here they are intended, to simulate something like uniqueness types in
> Clean, which incidentially has been mentioned on this thread before.
>
> The loop has nothing to do with unsafePerformIO, but stems from Haskell's
> idiosyncratic recursive let, which is a trap for all that come from another
> functional language.

Have your students turn on -fwarn-name-shadowing -Werror:

[1 of 1] Compiling Main             ( foo.hs, interpreted )

foo.hs:53:16: Warning:
    This binding for `arr' shadows the existing binding
      bound at foo.hs:50:28

foo.hs:62:18: Warning:
    This binding for `arr' shadows the existing binding
      bound at foo.hs:56:24

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to