Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Instant module (originally implemented by Stephen Torku) #1214

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading