Paste: syntax

Author: Axle Longhorn
Mode: factor
Date: Mon, 4 May 2009 05:46:22
Plain Text |
Which is the better syntax? The type information will be optional, but I'm trying to decide where the type statement should go. White space is insignificant, so these can be moved around to some extent.

The current syntax without type specification:

        2dip : { bury_2 2slip }

1. Haskell-esque (may require some kind of newline recognition)

  2dip :: A (A -> B) a b -> B a b
  2dip : { bury_2 2slip }

2. (Java / C / C++)-esque

  A a b (A -> B) -> B a b ::
  2dip : { bury_2 2slip }

  A a b (A -> B) -> B a b :: 2dip : { bury_2 2slip }

  A a b (A -> B) -> B a b :: 2dip : {
    bury_2 2slip
  }

3. After name (ML-esque)

  2dip :: A a b (A -> B) -> B a b : { bury_2 2slip }

  2dip :: A a b (A -> B) -> B a b :
  { bury_2 2slip }

  2dip :: A a b (A -> B) -> B a b : {
    bury_2 2slip
  }

4. After definition

  2dip : { bury_2 2slip } :: A a b (A -> B) -> B a b

  2dip : { bury_2 2slip }
  :: A a b (A -> B) -> B a b

  2dip : {
    bury_2 2slip
  } :: A a b (A -> B) -> B a b

New Annotation

Summary:
Author:
Mode:
Body: