[Ur] last type decl wins?

Marc Weber marco-oweber at gmx.de
Sat Apr 16 11:25:21 EDT 2011


case 1)
  fn a = used twice (top level) and many lines in between
  of course this is unreadable. Hopefully both a functions differ in type

  urweb allows this usage without warning.

case 2)
  Two local scopes both defining a:
  This is totally fine. No clashing happens.

case 3)
  is case 2 using where instead of let .. in.
  I don't make a huge difference. So this is equally fine.

  I use let when I'm too lazy to pass all arguments again such as in

  fun_name a = do
    let printAandB b = print a >> print b
    in printAandB "b"

  This example is totally stupid only illustrating what would be called
  "closure" in JS.


I'm also fine with this usage:

    int i;

    for (i = 0; i < 100; i++)
      print(i);

    // do stuff

    for (i = 0; i < 100; i++)
      print(i);

.. Well - me assimilating more of urweb internals and the manual is more
important ..

Marc Weber



More information about the Ur mailing list