[Haskell-cafe] How to turn Integer into Proxy (n :: KnownNat) with n equal to the integer?

David Kraeutmann kane at kane.cx
Fri Aug 3 21:14:54 UTC 2018


The best you can do is `someNatVal`:

case someNatVal 10 of
   Just (SomeNat p) -> _ {- do stuff with p -}
   _ -> _ {- not a nat -}

On 8/3/2018 11:01 PM, David Banas wrote:
> I’d like to use Data.Vector.Sized.slice’, but it wants the starting position and length parameters as Proxys, not Integers.
> How can I convert an Integer into a Proxy (n :: KnownNat) with n equal to the integer?
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180803/25ad5a02/attachment.html>


More information about the Haskell-Cafe mailing list