[Haskell-cafe] Converting EpochTime to Integer

Roman Cheplyaka roma at ro-che.info
Wed Sep 16 13:54:54 UTC 2015


On 16/09/15 16:04, Brandon Allbery wrote:
> On Wed, Sep 16, 2015 at 7:19 AM, Bram Neijt <bneijt at gmail.com
> <mailto:bneijt at gmail.com>> wrote:
> 
>     If I use
>         return (toInteger mtime)
>     I get
>         src/Main.hs:21:13:
>             No instance for (Integral System.Posix.Types.EpochTime)
> 
> 
> I had been wondering about the claim that it had an Integral instance,..
> it has Num but not Integral.
> 
> It *does* have an Enum instance, so fromEnum shoiuld work.

Except that's not 2038-safe (fromEnum :: Enum a => a -> Int).

Roman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150916/f958597d/attachment.sig>


More information about the Haskell-Cafe mailing list