mirror of
https://github.com/macocianradu/RosettaHaskellCompiler.git
synced 2026-03-18 21:10:07 +00:00
Fixed subtyping
This commit is contained in:
@@ -14,6 +14,8 @@ type TestZeroOneType extends Period:
|
||||
|
||||
type ObservationPrimitive:
|
||||
observationPrimitive int (1..1)
|
||||
condition important: <"This is an important condition">
|
||||
observationPrimitive < 0
|
||||
|
||||
func EquityPriceObservation: <"Function specification for the observation of an equity price, based on the attributes of the 'EquityValuation' class.">
|
||||
inputs:
|
||||
@@ -21,7 +23,6 @@ func EquityPriceObservation: <"Function specification for the observation of an
|
||||
valuationDate ObservationPrimitive (0..1)
|
||||
valuationTime int (0..1)
|
||||
timeType TestType (0..1)
|
||||
determinationMethod ObservationPrimitive (1..1)
|
||||
output:
|
||||
observation ObservationPrimitive (0..1)
|
||||
|
||||
@@ -38,6 +39,8 @@ func Something: <"asd">
|
||||
|
||||
func SomethingElse: <"dsa">
|
||||
inputs:
|
||||
num1 int (1..1)
|
||||
num2 int (0..1)
|
||||
valuationTime ObservationPrimitive (1..1)
|
||||
output:
|
||||
valuation ObservationPrimitive (0..1)
|
||||
|
||||
36
resources/Rosetta/test-function.rosetta
Normal file
36
resources/Rosetta/test-function.rosetta
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace test.all : <"Something">
|
||||
version "${version.ok}"
|
||||
|
||||
type ObservationPrimitive:
|
||||
observationPrimitive int (1..1)
|
||||
condition important: <"This is an important condition">
|
||||
observationPrimitive < 0
|
||||
|
||||
|
||||
func UsingFunctions: <"This function will use the other functions">
|
||||
inputs:
|
||||
val ObservationPrimitive (1..1)
|
||||
bol boolean (1..1)
|
||||
output:
|
||||
valuation ObservationPrimitive(0..*)
|
||||
|
||||
assign-output: if bol then Something (bol, val) else SomethingElse (1, 2, val)
|
||||
|
||||
func Something: <"asd">
|
||||
inputs:
|
||||
equity1 boolean (1..1)
|
||||
valuationTime ObservationPrimitive (1..1)
|
||||
output:
|
||||
valuation ObservationPrimitive (0..*)
|
||||
|
||||
assign-output: if True and False then valuationTime
|
||||
|
||||
func SomethingElse: <"dsa">
|
||||
inputs:
|
||||
num1 int (1..1)
|
||||
num2 int (0..1)
|
||||
valuationTime ObservationPrimitive (1..1)
|
||||
output:
|
||||
valuation ObservationPrimitive (0..1)
|
||||
|
||||
assign-output: if True and False then valuationTime
|
||||
Reference in New Issue
Block a user