In Idris, types are first-class values:
FooType : (Type, Type)
FooType = (Int, Int)
fst FooType -- Int : Type
I would like to use somehow this feature in Scala so that I can reuse type members over different methods:
class Foo {
type FooType = (Int, Int)
def foo : FooType = { ... }
def bar : Int = { ... } // Here I would like to reuse the first type of FooType (Int)
}
What is the recommended way to accomplish this in Scala?