diff --git a/dhall/src/Dhall/Marshal/Decode.hs b/dhall/src/Dhall/Marshal/Decode.hs index cf6b65283..ab72bc998 100644 --- a/dhall/src/Dhall/Marshal/Decode.hs +++ b/dhall/src/Dhall/Marshal/Decode.hs @@ -146,7 +146,6 @@ import Data.Functor.Contravariant , Predicate (..) ) import Data.Hashable (Hashable) -import Data.Int (Int16, Int32, Int64, Int8) import Data.List.NonEmpty (NonEmpty (..)) import Data.Typeable (Proxy (..), Typeable) import Dhall.Parser (Src (..)) diff --git a/dhall/src/Dhall/Marshal/Encode.hs b/dhall/src/Dhall/Marshal/Encode.hs index 07f303c4e..28246dce6 100644 --- a/dhall/src/Dhall/Marshal/Encode.hs +++ b/dhall/src/Dhall/Marshal/Encode.hs @@ -206,6 +206,34 @@ instance ToDhall Int where declared = Integer +instance ToDhall Int8 where + injectWith _ = Encoder {..} + where + embed = IntegerLit . toInteger + + declared = Integer + +instance ToDhall Int16 where + injectWith _ = Encoder {..} + where + embed = IntegerLit . toInteger + + declared = Integer + +instance ToDhall Int32 where + injectWith _ = Encoder {..} + where + embed = IntegerLit . toInteger + + declared = Integer + +instance ToDhall Int64 where + injectWith _ = Encoder {..} + where + embed = IntegerLit . toInteger + + declared = Integer + {-| Encode a 'Word' to a Dhall @Natural@. >>> embed inject (12 :: Word) diff --git a/dhall/src/Dhall/Marshal/Internal.hs b/dhall/src/Dhall/Marshal/Internal.hs index e345ab8b4..b100f0fdc 100644 --- a/dhall/src/Dhall/Marshal/Internal.hs +++ b/dhall/src/Dhall/Marshal/Internal.hs @@ -27,6 +27,10 @@ module Dhall.Marshal.Internal -- * Re-exports , Fix(..) , HashMap + , Int8 + , Int16 + , Int32 + , Int64 , Map , Natural , Scientific @@ -44,6 +48,7 @@ module Dhall.Marshal.Internal import Control.Monad.Trans.State.Strict import Data.Fix (Fix (..)) import Data.HashMap.Strict (HashMap) +import Data.Int (Int16, Int32, Int64, Int8) import Data.Map (Map) import Data.Scientific (Scientific) import Data.Sequence (Seq) diff --git a/stack.yaml b/stack.yaml index 395861212..4381d124f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-18.0 +resolver: lts-18.18 packages: - dhall - dhall-bash