Skip to content

Add flag to infer undefined for variables with only types

It would be convenient to be able to write only type declarations for some or all variables and have the compiler assume that the definitions of those variables are 'undefined'.

For example:

functionOne :: x -> y
functionTwo :: y -> z
functionThree :: x -> y
functionThree = functionOne . functionTwo

would be equivalent to

functionOne :: x -> y
functionOne = undefined
functionTwo :: y -> z
functionTwo = undefined
functionThree :: x -> y
functionThree = functionOne . functionTwo

I feel this would make type-driven development significantly more convenient/clean.

Trac metadata
Trac field Value
Version 7.8.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information