Skip to content

Commit

Permalink
Added missing module declarations. finos#37
Browse files Browse the repository at this point in the history
  • Loading branch information
AttilaMihaly committed Mar 26, 2020
1 parent a20fba8 commit 0de01be
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 6 deletions.
12 changes: 11 additions & 1 deletion src/Morphir/IR/SDK.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@ module Morphir.IR.SDK exposing (..)

import Dict
import Morphir.IR.Advanced.Package as Package
import Morphir.IR.SDK.Bool as Bool
import Morphir.IR.SDK.Float as Float
import Morphir.IR.SDK.Int as Int
import Morphir.IR.SDK.List as List
import Morphir.IR.SDK.Maybe as Maybe
import Morphir.IR.SDK.String as String


packageDeclaration : Package.Declaration ()
packageDeclaration =
{ modules =
Dict.fromList
[ ( [ [ "int" ] ], Int.moduleDeclaration )
[ ( [ [ "bool" ] ], Bool.moduleDeclaration )
, ( [ [ "int" ] ], Int.moduleDeclaration )
, ( [ [ "float" ] ], Float.moduleDeclaration )
, ( [ [ "string" ] ], String.moduleDeclaration )
, ( [ [ "maybe" ] ], Maybe.moduleDeclaration )
, ( [ [ "list" ] ], List.moduleDeclaration )
]
}
15 changes: 14 additions & 1 deletion src/Morphir/IR/SDK/Bool.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Morphir.IR.SDK.Bool exposing (..)

import Morphir.IR.Advanced.Type exposing (Type(..))
import Dict
import Morphir.IR.Advanced.Module as Module
import Morphir.IR.Advanced.Type exposing (Declaration(..), Type(..))
import Morphir.IR.FQName as FQName exposing (FQName)
import Morphir.IR.Name as Name
import Morphir.IR.Path exposing (Path)
Expand All @@ -13,6 +15,17 @@ moduleName =
[ [ "bool" ] ]


moduleDeclaration : Module.Declaration ()
moduleDeclaration =
{ types =
Dict.fromList
[ ( [ "bool" ], OpaqueTypeDeclaration [] )
]
, values =
Dict.empty
}


fromLocalName : String -> FQName
fromLocalName name =
name
Expand Down
15 changes: 14 additions & 1 deletion src/Morphir/IR/SDK/Float.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Morphir.IR.SDK.Float exposing (..)

import Morphir.IR.Advanced.Type exposing (Type(..))
import Dict
import Morphir.IR.Advanced.Module as Module
import Morphir.IR.Advanced.Type exposing (Declaration(..), Type(..))
import Morphir.IR.FQName as FQName exposing (FQName)
import Morphir.IR.Name as Name
import Morphir.IR.Path exposing (Path)
Expand All @@ -13,6 +15,17 @@ moduleName =
[ [ "float" ] ]


moduleDeclaration : Module.Declaration ()
moduleDeclaration =
{ types =
Dict.fromList
[ ( [ "float" ], OpaqueTypeDeclaration [] )
]
, values =
Dict.empty
}


fromLocalName : String -> FQName
fromLocalName name =
name
Expand Down
15 changes: 14 additions & 1 deletion src/Morphir/IR/SDK/List.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Morphir.IR.SDK.List exposing (..)

import Morphir.IR.Advanced.Type exposing (Type(..))
import Dict
import Morphir.IR.Advanced.Module as Module
import Morphir.IR.Advanced.Type exposing (Declaration(..), Type(..))
import Morphir.IR.FQName as FQName exposing (FQName)
import Morphir.IR.Name as Name
import Morphir.IR.Path exposing (Path)
Expand All @@ -13,6 +15,17 @@ moduleName =
[ [ "list" ] ]


moduleDeclaration : Module.Declaration ()
moduleDeclaration =
{ types =
Dict.fromList
[ ( [ "list" ], OpaqueTypeDeclaration [ [ "a" ] ] )
]
, values =
Dict.empty
}


fromLocalName : String -> FQName
fromLocalName name =
name
Expand Down
20 changes: 19 additions & 1 deletion src/Morphir/IR/SDK/Maybe.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Morphir.IR.SDK.Maybe exposing (..)

import Morphir.IR.Advanced.Type exposing (Type(..))
import Dict
import Morphir.IR.Advanced.Module as Module
import Morphir.IR.Advanced.Type as Type exposing (Declaration(..), Type(..))
import Morphir.IR.FQName as FQName exposing (FQName)
import Morphir.IR.Name as Name
import Morphir.IR.Path exposing (Path)
Expand All @@ -13,6 +15,22 @@ moduleName =
[ [ "maybe" ] ]


moduleDeclaration : Module.Declaration ()
moduleDeclaration =
{ types =
Dict.fromList
[ ( [ "maybe" ]
, CustomTypeDeclaration [ [ "a" ] ]
[ ( [ "just" ], [ ( [ "value" ], Type.Variable [ "a" ] () ) ] )
, ( [ "nothing" ], [] )
]
)
]
, values =
Dict.empty
}


fromLocalName : String -> FQName
fromLocalName name =
name
Expand Down
15 changes: 14 additions & 1 deletion src/Morphir/IR/SDK/String.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Morphir.IR.SDK.String exposing (..)

import Morphir.IR.Advanced.Type exposing (Type(..))
import Dict
import Morphir.IR.Advanced.Module as Module
import Morphir.IR.Advanced.Type exposing (Declaration(..), Type(..))
import Morphir.IR.FQName as FQName exposing (FQName)
import Morphir.IR.Name as Name
import Morphir.IR.Path exposing (Path)
Expand All @@ -13,6 +15,17 @@ moduleName =
[ [ "string" ] ]


moduleDeclaration : Module.Declaration ()
moduleDeclaration =
{ types =
Dict.fromList
[ ( [ "string" ], OpaqueTypeDeclaration [] )
]
, values =
Dict.empty
}


fromLocalName : String -> FQName
fromLocalName name =
name
Expand Down

0 comments on commit 0de01be

Please sign in to comment.