All Downloads are FREE. Search and download functionalities are using the official Maven repository.

defs.main-tests.source.idltest.services.domain Maven / Gradle / Ivy

The newest version!
domain idltest.services

enum TestServiceEnum {
    Value1
    Value2
}

mixin SuccessData {
  greeting: str
}

data SuccessDataData {
    &SuccessData
}

mixin ErrorData {
  message: str
}

mixin Request {
  firstName: str
  secondName: str
}

enum Environment {
    Dev
    Prod
}

data Package {
    name: str
}

service TestService {
  def unitToUnit()
  def anotherVoid() => ()
  def unitResult(package: Package)

  def parameterless(): str
  def simpleMethod(a: str): str
  def simpleIntMethod(a: i32): i32
  def simpleMethodWithGenerics(a: list[str]): list[str]
  def simple(+Request): (+Request)
  def simpleEnum(v: TestServiceEnum): str
  def simpleEnum2(e: Environment): str
  def returnsList(e: Environment): list[Package]
  def returnsMap(e: Environment): map[str,Package]

  def simpleGoReserved(package: Package): bool

  def simpleVoid(a: str)

  // simple instance
  def greetSingularOut(firstName: str, secondName: str) => str

  // implicitly created structure
  def greetImplicitStructOut(firstName: str, secondName: str) => (a: str)

  // implicitly created structure
  def greetImplicitStructMultilineSyntax
    (
      region: str
      , age: int8
    )
      =>
    (
        + SuccessData
        , bullshit: str
    )

  // implicitly created structure
  def greetImplicitStructureMultilineCurlyBracesSyntax
    {
      region: str
      , age: int8
    } => {
        + SuccessData
        , bullshit: str
    }

  // ADT
  def greetAlgebraicOut(firstName: str, secondName: str) => ( SuccessDataData | ErrorData )

  // ADT
  def greetAlgebraicMultilineSyntax(firstName: str, secondName: str) => (
     SuccessDataData
   | ErrorData
  )

  // alternatives

/*  def greetAlgebraicMultilineCurlyBracesSyntax
   {
     firstName: str
     secondName: str
   } => {
     SuccessData
   } !! {
     ErrorData
   }
*/
   def alternative(firstName: str, secondName: str) => SuccessData !! ErrorData
   def alternativeSame(firstName: str, secondName: str) => SuccessData !! SuccessData
   def alternativeGeneric() => list[SuccessData] !! set[ErrorData]
   def alternativeGeneric2() => map[str,SuccessData] !! map[string, ErrorData]
   // This is not supported, currently will fail miserably in C# during usings, which
   // are now disabled for alternatives
   // def alternativeGeneric3() => map[str,SuccessData] !! (ErrorData | SuccessData)

  // def voidAlternative(firstName: str, secondName: str) => () !! ()

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy