[racket-dev] typed/scheme n00b question

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Sep 6 22:28:20 EDT 2010

On Sep  6, Sam Tobin-Hochstadt wrote:
> On Sun, Sep 5, 2010 at 5:30 PM, Eli Barzilay <eli at barzilay.org> wrote:
> >
> > I think that this is the type for `file-or-directory-modify-seconds':
> >
> >  (case-lambda
> >    [String -> Exact-Nonnegative-Integer]
> >    [String (Option Exact-Nonnegative-Integer)
> >            -> (U Exact-Nonnegative-Integer Void)]
> >    [String (Option Exact-Nonnegative-Integer) (-> Any)
> >            -> Any])
> 
> Probably you want something more specific that handles the [String
> Integer] and [String False] cases separately.

Yeah, but that's the part that I can never remember.  This:

  (U (String -> Exact-Nonnegative-Integer)
     (String False -> Exact-Nonnegative-Integer)
     (String Exact-Nonnegative-Integer -> Void)
     (String (Option Exact-Nonnegative-Integer) (-> Any) -> Any))

is more precise, but IIRC, it's not equivalent to the above -- ?

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.