aeternity / aesophia

Stand alone compiler for the Sophia smart contract language
https://docs.aeternity.com/aesophia
ISC License
52 stars 19 forks source link

Hole expressions #391

Closed radrow closed 1 year ago

radrow commented 2 years ago

In Haskell and Scala there is an expression variant called "hole". It represents a yet-unimplemented expression that throws error on build. A nice feature of that is that it can be used to check what the typechecker expects in a given place:

entrypoint test(l) =
  List.head(List.map(???, l)) + 1 // note the question marks
Type error: found a hole of type 'a => int

I propose ??? as it doesn't clash with patterns

hanssv commented 2 years ago

Just what every newly converted Solidity developer wants/needs, right? 🤣