home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / function / 978 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  1.7 KB

  1. Path: sparky!uunet!mcsun!sunic!chalmers.se!cs.chalmers.se!augustss
  2. From: augustss@cs.chalmers.se (Lennart Augustsson)
  3. Newsgroups: comp.lang.functional
  4. Subject: Re: programs that are too lazy
  5. Keywords: n
  6. Message-ID: <1992Jul29.164919.2677@cs.chalmers.se>
  7. Date: 29 Jul 92 16:49:19 GMT
  8. References: <1992Jul27.083020.6061@st-andrews.ac.uk>
  9. Sender: news@cs.chalmers.se (News administrator)
  10. Organization: Chalmers University of Technology
  11. Lines: 34
  12.  
  13.  
  14. Sorry about my last posting, the mailer mangled it.
  15. In article <1992Jul27.083020.6061@st-andrews.ac.uk> ajtd@st-andrews.ac.uk (Antony J. T. Davie) writes:
  16. >Julian Seward writes
  17. >>I believe the Haskell committee should
  18. >>consider the provision of two built-in functions:
  19. >>
  20. >>   hyperstrict, whnf :: Eq a => a -> b -> b
  21. >>
  22. >>both of which evaluate their first argument (fully or to whnf)
  23. >>and return the second.  We can simulate this at the moment using
  24. >>Haskell 1.2, but it might be more efficient if compilers could
  25. >>regard these as primitive.
  26. >
  27. >Whether or not one agrees with the provision of these fns., why restrict
  28. >them to Eq types? Certainly one can only easily simulate them if they
  29. >operate on equality types, but that's no reason to restrict primitive
  30. >versions of them so.
  31. >
  32. There should be some suitable restriction on the values that allow
  33. whnf.  E.g.
  34.     whnf :: (WHNFable a) => a -> b -> b
  35. The function with type a->b->b that evaluates its first argument
  36. and return the second is not definable within lambda calculus.
  37. Having it enables you to distinguish between BOT and \x.BOT,
  38. which are usually regarded as equal.  (whnf BOT 0 --> BOT, but
  39. whnf (\x.BOT) 0 --> 0)
  40.  
  41.     -- Lennart
  42.  
  43. -- 
  44.  
  45.     -- Lennart Augustsson
  46. [This signature is intentionally left blank.]
  47.