<div dir="ltr">Correction to my original message: No problems for Double, which already has a FromDhall instance, but I'm trying to solve the problem for Word8, Word16 & Word32.<div><br></div><div>Interestingly, Word8, Word16 & Word32 have ToDhall instances but no FromDhall instances.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 19, 2020 at 2:50 PM ☂Josh Chia (謝任中) <<a href="mailto:joshchia@gmail.com">joshchia@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div>Let's say I have a record type:<div>data Foo = Foo { v :: Word16 }</div><div><br></div><div>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.</div><div><br></div></div>
</blockquote></div>