[Haskell-cafe] Dhall for Word8, Word16, Double, etc

☂Josh Chia (謝任中) joshchia at gmail.com
Wed Aug 19 06:50:12 UTC 2020


Hi,

Let's say I have a record type:
data Foo = Foo { v :: Word16 }

I want to have a FromDhall instance for Foo. I know this is easy to do if v
is Integer instead of Word16. But v is Word16. Does Dhall enable the user
to cleanly express how to input a Word16 with the requisite range checks,
or is the user expected to only use Integer and do his own conversion and
range checks within Haskell after inputting the Integer from Dhall? I have
a record with Word32, Word16, Word8 & Double fields instead of Integer &
Scientific.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20200819/97a68b52/attachment.html>


More information about the Haskell-Cafe mailing list