In Haskell I find the
undefined function from prelude really useful. I’m guessing it’s defined as something like:
undefined : _|_ undefined = error "Undefined"
This seems like a useless function, but allows you to write code like …
myverycomplexfunction : Int -> Bool -> Text -> a -> Int myverycomplexfunction = undefined
… which then compiles.
Which is great for prototyping; it let’s you write out your program ‘top-down’, and get it to compile first, before going in to implement each individual bit.
Of course you can just write your own
undefined, but it would be nice if it were part of
Is there any obvious reason why this has been omitted from the standard library? Could we add it?