Ticket #393 (new feature request: None)

Opened 7 years ago

Last modified 3 years ago

functions without implementations

Reported by: c_maeder Owned by: simonpj
Priority: normal Milestone: _|_
Component: Compiler (Type checker) Version: None
Keywords: Cc: tomasz.zielonka@…, maeder@…, pho@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Moderate (less than a day)
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo) (diff)

Allow to declare a function by only supplying its type
signature.
This feature shall enhance rapid prototyping by fixing
an interface but leaving some functions unimplemented.

Currently this can be (only) simulated by supplying
dummy implementations, like 

f :: ...
f = undefined

Since it is possible to supply dummy data types by
"data T" (not followed by "="), allowing functions
without implementations seems almost to be a logical
consequence. Surely, the compiler should emit warnings
for missing implementations.

It would be nice if such function declarations via type
signatures could be repeated at any position within a
module. 

Change History

Changed 5 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.8
  • os set to Unknown
  • architecture set to Unknown
  • description modified (diff)

Changed 5 years ago by maeder@…

  • status changed from assigned to new
  • severity changed from minor to normal
  • component changed from None to Compiler (Type checker)
  • priority changed from lowest to normal
  • difficulty changed from Unknown to Easy (1 hr)
  • architecture changed from Unknown to Multiple
  • owner changed from nobody to simonpj
  • os changed from Unknown to Multiple

Changed 5 years ago by guest

from my POV, it's even faster to write "f=undefined" rather than signature, but i don't use sugnatures anyway :)

btw, if this feature will be implemented, it will be better to generate

f = error "Call to undefined f declared at Foo.hs:63"

Changed 5 years ago by guest

  • cc tomasz.zielonka@… added

Changed 5 years ago by maeder@…

  • cc tomasz.zielonka@… added; tomasz.zielonka@… removed

Changed 5 years ago by guest

  • cc tomasz.zielonka@…, maeder@… added; tomasz.zielonka@… removed

Changed 5 years ago by simonmar

  • milestone changed from 6.8 branch to _|_

No immediate plans to implement this.

Changed 4 years ago by PHO

  • cc pho@… added

Changed 4 years ago by simonmar

  • architecture changed from Multiple to Unknown/Multiple

Changed 4 years ago by simonmar

  • os changed from Multiple to Unknown/Multiple

Changed 3 years ago by maeder

Changed 3 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)

Changed 3 years ago by simonmar

  • difficulty changed from Easy (less than 1 hour) to Moderate (less than a day)
  • failure set to None/Unknown
Note: See TracTickets for help on using tickets.