Add Inject instances for Word types (#112)

This commit is contained in:
bosu 2017-08-28 02:06:57 +03:00 committed by Gabriel Gonzalez
parent 463126cb47
commit a03de76a41

View File

@ -60,6 +60,7 @@ import Data.Text.Buildable (Buildable(..))
import Data.Text.Lazy (Text)
import Data.Typeable (Typeable)
import Data.Vector (Vector)
import Data.Word (Word8, Word16, Word32, Word64)
import Dhall.Core (Expr(..))
import Dhall.Import (Imported(..))
import Dhall.Parser (Src(..))
@ -720,6 +721,34 @@ instance Inject Int where
declared = Integer
instance Inject Word8 where
injectWith _ = InputType {..}
where
embed = IntegerLit . toInteger
declared = Integer
instance Inject Word16 where
injectWith _ = InputType {..}
where
embed = IntegerLit . toInteger
declared = Integer
instance Inject Word32 where
injectWith _ = InputType {..}
where
embed = IntegerLit . toInteger
declared = Integer
instance Inject Word64 where
injectWith _ = InputType {..}
where
embed = IntegerLit . toInteger
declared = Integer
instance Inject Double where
injectWith _ = InputType {..}