Skip to content

Commit

Permalink
Merge pull request #1214 from AttilaMihaly/add-instant-type-2
Browse files Browse the repository at this point in the history
Added Instant module (originally implemented by Stephen Torku)
  • Loading branch information
AttilaMihaly authored Dec 23, 2024
2 parents e062362 + 9cad5f8 commit 106edf6
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Morphir/IR/SDK.elm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Morphir.IR.SDK.Basics as Basics
import Morphir.IR.SDK.Char as Char
import Morphir.IR.SDK.Decimal as Decimal
import Morphir.IR.SDK.Dict as Dict
import Morphir.IR.SDK.Instant as Instant
import Morphir.IR.SDK.Int as Int
import Morphir.IR.SDK.Key as Key
import Morphir.IR.SDK.List as List
Expand Down Expand Up @@ -76,6 +77,7 @@ packageSpec =
, ( [ [ "number" ] ], Number.moduleSpec )
, ( [ [ "key" ] ], Key.moduleSpec )
, ( [ [ "aggregate" ] ], Aggregate.moduleSpec )
, ( [ [ "instant" ] ], Instant.moduleSpec )
, ( [ [ "u", "u", "i", "d" ] ], UUID.moduleSpec )
]
}
Expand Down
49 changes: 49 additions & 0 deletions src/Morphir/IR/SDK/Instant.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{-
Copyright 2020 Morgan Stanley
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-}


module Morphir.IR.SDK.Instant exposing (..)

import Dict
import Morphir.IR.Documented exposing (Documented)
import Morphir.IR.Module as Module exposing (ModuleName)
import Morphir.IR.Name as Name
import Morphir.IR.Path as Path exposing (Path)
import Morphir.IR.SDK.Common exposing (toFQName)
import Morphir.IR.Type exposing (Specification(..), Type(..))


moduleName : ModuleName
moduleName =
Path.fromString "Instant"


moduleSpec : Module.Specification ()
moduleSpec =
{ types =
Dict.fromList
[ ( Name.fromString "Instant"
, OpaqueTypeSpecification []
|> Documented "Type that represents a specific instantaneous point on the timeline."
)
]
, values =
Dict.fromList
[]
, doc = Just "Contains the Instant type (representing a specific instantaneous point in time), and it's associated functions."
}


instantType : a -> Type a
instantType attributes =
Reference attributes (toFQName moduleName "Instant") []
27 changes: 27 additions & 0 deletions src/Morphir/SDK/Instant.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{-
Copyright 2020 Morgan Stanley
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-}


module Morphir.SDK.Instant exposing (..)

{-| This module adds the definition of an instantaneous point in time.
@docs Instant
-}

import Time exposing (Posix)


type alias Instant =
Posix

0 comments on commit 106edf6

Please sign in to comment.