Hello, Ralf!
In fact, he mentions that values can be retrieved by either type or
index, while only the former is discussed in detail, if I am right. To
me it seems, he would also need to end up using dependant-type
encoding of naturals, say data Zero ... and data Succ ..., for
look-up. If I
If I have this Foo.hs:
---
module Foo (foo) where
import Word (Word8)
import Control.Monad.ST (ST)
import Data.Array.ST (STUArray, writeArray)
foo :: STUArray s Int Word8 - [Word8] - Int - ST s ()
foo arr ps i = writeArray arr i w
where i' = 4 * i
|let {
| n :: GHC.Prim.Int#
| Str: DmdType
| n = GHC.Prim.*# 4 ww3
|} in
| case GHC.Prim.# n 0 of wild1 {
|
| Is this really a lazy let, or is there some magic going on
| that means it is
Hi Oleg, I like the polymorphic list indexed by Ints... there
do seem to be a couple of differences between this and the list
indexed by natural numbers.
The list indexed by integers cannot determine the type of the
return value through induction on the class... in other words
it cannot
On Wed, Mar 10, 2004 at 09:41:46AM -, Simon Marlow wrote:
Yes, this let will be done strictly.
Thanks (and to the other Simon too)
Like how ISTR Int#s always
appear to have strictness L (these inconsitencies make things
much more difficult as a user IMO, incidentally).
ISTR?
I
MR K P SCHUPKE wrote:
Hi Oleg, I like the polymorphic list indexed by Ints... there
do seem to be a couple of differences between this and the list
indexed by natural numbers.
...
Agreed with these differences.
Another difference: it is initially a heterogeneous set
rather than list!
This is the latest varient. Let me know whether you guys find this
interesting, as I am coding what I need for a practical application,
it may be tedious for you... I am still of the opinion that some
kind of polygenious list (or maybe heteromorphic?) would be good in
the standard libraries,