I was testing returning a specific type for a function, and it required using an Opaque type vs a type alias. Why is this?
Point := { x: Str, y: Str, z: Str }
toPoint : Num a, Num b, Num c -> Point
toPoint = \a, b, c -> @Point { x: Num.toStr a, y: Num.toStr b, z: Num.toStr c }
vs
Point : { x: Str, y: Str, z: Str }
toPoint : Num a, Num b, Num c -> Point
toPoint = \a, b, c -> { x: Num.toStr a, y: Num.toStr b, z: Num.toStr c } #how to say this is type Point?
I thought I would be able to create a function that returns a type alias Point like in Haskell.
I can run the second snippet, can you further specify your issue?
Never mind, the second example worked. I was getting a compile error earlier, and apparently fixed it while typing up this example :rolling_on_the_floor_laughing:
Last updated: Jul 06 2025 at 12:14 UTC