1.9.0
RiddlResult[T] ADT
New cross-platform sealed trait RiddlResult[T] replaces Either[Messages, T] as the return type for all RiddlLib methods.
Changes
RiddlResult[T]sealed trait withSuccess[T]andFailurecasesmap,flatMapfor chaining operationstoEitherfor backward compatibility with existing Scala codefromEitherfactory for bridging parser results
ast2bastnow returnsRiddlResult[Array[Byte]]instead of silently returning empty array on failure- TypeScript:
ParseResult<T>renamed toRiddlResult<T>across all method signatures- Deprecated
ParseResult<T>type alias kept for migration
- Deprecated
Migration
Scala: Replace result.isRight / result.isLeft with pattern matching:
RiddlLib.parseString(source) match
case RiddlResult.Success(root) => // use root
case RiddlResult.Failure(errors) => // handle errorsOr use result.toEither to convert back to Either[Messages, T].
TypeScript: Replace ParseResult<T> with RiddlResult<T> in type annotations. The deprecated alias will continue to work.