jamiebuilds / ghost-lang

:ghost: A friendly little language for you and me.
302 stars 10 forks source link

Async/iterable function types #8

Closed aleclarson closed 6 years ago

aleclarson commented 6 years ago

Would they be something like this?

// Async function
type MyType = async fn (param: String): Number

// Iterable function
type MyType = iter fn (param: String): Number
jamiebuilds commented 6 years ago

I'm thinking more like this:

type AsyncValue = Async<Number>
type IterValue = Iter<Number>
type AsyncIterValue = AsyncIter<Number>

type AsyncFunction = fn (param: String): Async<Number>
type IterFunction = fn (param: String): Iter<Number>
type AsyncIterFunction = fn (param: String): AsyncIter<Number>
jamiebuilds commented 6 years ago

documented