Skip to content

Instantly share code, notes, and snippets.

@noughtmare
Last active September 27, 2022 10:27
Show Gist options
  • Select an option

  • Save noughtmare/f979c0fc9eed30abcd0849d19cf0f746 to your computer and use it in GitHub Desktop.

Select an option

Save noughtmare/f979c0fc9eed30abcd0849d19cf0f746 to your computer and use it in GitHub Desktop.
Standalone reproducer of missed fusion in vector streams without Skip
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE RoleAnnotations #-}
module All (test) where
import Data.Kind
import Control.Monad.ST
import Control.Monad.Primitive
import Data.Primitive.Array
import Prelude hiding (map, filter, length)
import Control.Monad
import GHC.Types (SPEC (..))
#define INLINE_FUSED INLINE [1]
#define INLINE_INNER INLINE [0]
type family Mutable (v :: Type -> Type) = (mv :: Type -> Type -> Type) | mv -> v
class MVector (Mutable v) a => Vector v a where
basicUnsafeFreeze :: Mutable v s a -> ST s (v a)
basicUnsafeThaw :: v a -> ST s (Mutable v s a)
basicLength :: v a -> Int
basicUnsafeSlice :: Int -- ^ starting index
-> Int -- ^ length
-> v a -> v a
basicUnsafeIndexM :: v a -> Int -> Box a
basicUnsafeCopy :: Mutable v s a -> v a -> ST s ()
{-# INLINE basicUnsafeCopy #-}
basicUnsafeCopy !dst !src = do_copy 0
where
!n = basicLength src
do_copy i | i < n = do
x <- liftBox $ basicUnsafeIndexM src i
basicUnsafeWrite dst i x
do_copy (i+1)
| otherwise = return ()
elemseq :: v a -> a -> b -> b
{-# INLINE elemseq #-}
elemseq _ = \_ x -> x
{-# MINIMAL basicUnsafeFreeze, basicUnsafeThaw, basicLength,
basicUnsafeSlice, basicUnsafeIndexM #-}
inplace :: (forall m. Monad m => Stream m a -> Stream m b)
-> (Size -> Size) -> Bundle Id v a -> Bundle Id v b
{-# INLINE_FUSED inplace #-}
inplace f g b = b `seq` fromStream (f (sElems b)) (g (sSize b))
where
fromStream :: Monad m => Stream m a -> Size -> Bundle m v a
{-# INLINE fromStream #-}
fromStream (Stream step t) sz = Bundle (Stream step t) (Stream step' t) Nothing sz
where
step' s = do r <- step s
return $ fmap (\x -> Chunk 1 (\v -> stToPrim $ basicUnsafeWrite v 0 x)) r
{-# RULES
"inplace/inplace [Vector]"
forall (f1 :: forall m. Monad m => Stream m a -> Stream m a)
(f2 :: forall m. Monad m => Stream m a -> Stream m a)
g1 g2 s.
inplace f1 g1 (inplace f2 g2 s) = inplace (f1 . f2) (g1 . g2) s #-}
map :: (Vector v a, Vector v b) => (a -> b) -> v a -> v b
{-# INLINE map #-}
map f = unstream . inplace (smap f) id . stream
filter :: Vector v a => (a -> Bool) -> v a -> v a
{-# INLINE filter #-}
filter f = unstream . inplace (sfilter f) toMax . stream
where
toMax :: Size -> Size
toMax (Exact n) = Max n
toMax (Max n) = Max n
toMax Unknown = Unknown
stream :: Vector v a => v a -> Bundle Id v a
{-# INLINE_FUSED stream #-}
stream v = fromVector v
where
fromVector :: (Monad m, Vector v a) => v a -> Bundle m v a
{-# INLINE_FUSED fromVector #-}
fromVector v = v `seq` n `seq` Bundle (Stream step 0)
(Stream vstep True)
(Just v)
(Exact n)
where
n = basicLength v
{-# INLINE step #-}
step i | i >= n = return Done
| otherwise = case basicUnsafeIndexM v i of
Box x -> return $ Yield x (i+1)
{-# INLINE vstep #-}
vstep True = return (Yield (Chunk (basicLength v) (\mv -> stToPrim $ basicUnsafeCopy mv v)) False)
vstep False = return Done
-- | Delay inlining a function until late in the game (simplifier phase 0).
delay_inline :: (a -> b) -> a -> b
{-# INLINE [0] delay_inline #-}
delay_inline f = f
-- | `min` inlined in phase 0
delayed_min :: Int -> Int -> Int
{-# INLINE [0] delayed_min #-}
delayed_min m n = min m n
data New v a = New (forall s. ST s (Mutable v s a))
run :: New v a -> ST s (Mutable v s a)
{-# INLINE run #-}
run (New p) = p
newunstream :: Vector v a => Bundle Id v a -> New v a
{-# INLINE_FUSED newunstream #-}
newunstream s = s `seq` New (vunstream s)
where
vunstream :: (PrimMonad m, Vector v a)
=> Bundle Id v a -> m (Mutable v (PrimState m) a)
-- NOTE: replace INLINE_FUSED by INLINE? (also in unstreamR)
{-# INLINE_FUSED vunstream #-}
vunstream s = vmunstream (lift s)
vmunstream :: (PrimMonad m, Vector v a)
=> Bundle m v a -> m (Mutable v (PrimState m) a)
{-# INLINE_FUSED vmunstream #-}
vmunstream s = case upperBound (sSize s) of
Just n -> vmunstreamMax s n
Nothing -> vmunstreamUnknown s
vmunstreamMax :: (PrimMonad m, Vector v a)
=> Bundle m v a -> Int -> m (Mutable v (PrimState m) a)
{-# INLINE vmunstreamMax #-}
vmunstreamMax s n
= do
v <- unsafeNew n
let {-# INLINE_INNER copyChunk #-}
copyChunk i (Chunk m f) =
do
f (mbasicUnsafeSlice i m v)
return (i+m)
n' <- sfoldlM' copyChunk 0 (sChunks s)
return $ unsafeSlice 0 n' v
vmunstreamUnknown :: (PrimMonad m, Vector v a)
=> Bundle m v a -> m (Mutable v (PrimState m) a)
{-# INLINE vmunstreamUnknown #-}
vmunstreamUnknown s
= do
v <- unsafeNew 0
(v', n) <- sfoldlM copyChunk (v,0) (sChunks s)
return $ unsafeSlice 0 n v'
where
{-# INLINE_INNER copyChunk #-}
copyChunk (v,i) (Chunk n f)
= do
let j = i+n
v' <- if mbasicLength v < j
then unsafeGrow v (delay_inline max (enlarge_delta v) (j - mbasicLength v))
else return v
f (mbasicUnsafeSlice i n v')
return (v',j)
unstream :: Vector v a => Bundle Id v a -> v a
{-# INLINE unstream #-}
unstream s = new (newunstream s)
new :: Vector v a => New v a -> v a
{-# INLINE_FUSED new #-}
new m = m `seq` runST (basicUnsafeFreeze =<< run m)
{-# RULES
"stream/unstream [Vector]" forall s.
stream (new (newunstream s)) = s
-- "New.unstream/stream [Vector]" forall v.
-- newunstream (stream v) = clone v
-- "clone/new [Vector]" forall p.
-- clone (new p) = p
-- "inplace [Vector]"
-- forall (f :: forall m. Monad m => Stream m a -> Stream m a) g m.
-- New.unstream (inplace f g (stream (new m))) = New.transform f g m
--
-- "uninplace [Vector]"
-- forall (f :: forall m. Monad m => Stream m a -> Stream m a) g m.
-- stream (new (New.transform f g m)) = inplace f g (stream (new m)) #-}
#-}
class MVector v a where
mbasicLength :: v s a -> Int
mbasicUnsafeSlice :: Int -- ^ starting index
-> Int -- ^ length of the slice
-> v s a
-> v s a
basicOverlaps :: v s a -> v s a -> Bool
basicUnsafeNew :: Int -> ST s (v s a)
basicInitialize :: v s a -> ST s ()
basicUnsafeReplicate :: Int -> a -> ST s (v s a)
basicUnsafeRead :: v s a -> Int -> ST s a
basicUnsafeWrite :: v s a -> Int -> a -> ST s ()
basicClear :: v s a -> ST s ()
basicSet :: v s a -> a -> ST s ()
mbasicUnsafeCopy :: v s a -- ^ target
-> v s a -- ^ source
-> ST s ()
basicUnsafeMove :: v s a -- ^ target
-> v s a -- ^ source
-> ST s ()
basicUnsafeGrow :: v s a -> Int -> ST s (v s a)
{-# INLINE basicUnsafeReplicate #-}
basicUnsafeReplicate n x
= do
v <- basicUnsafeNew n
basicSet v x
return v
{-# INLINE basicClear #-}
basicClear _ = return ()
{-# INLINE basicSet #-}
basicSet !v x
| n == 0 = return ()
| otherwise = do
basicUnsafeWrite v 0 x
do_set 1
where
!n = mbasicLength v
do_set i | 2*i < n = do mbasicUnsafeCopy (mbasicUnsafeSlice i i v)
(mbasicUnsafeSlice 0 i v)
do_set (2*i)
| otherwise = mbasicUnsafeCopy (mbasicUnsafeSlice i (n-i) v)
(mbasicUnsafeSlice 0 (n-i) v)
{-# INLINE mbasicUnsafeCopy #-}
mbasicUnsafeCopy !dst !src = do_copy 0
where
!n = mbasicLength src
do_copy i | i < n = do
x <- basicUnsafeRead src i
basicUnsafeWrite dst i x
do_copy (i+1)
| otherwise = return ()
{-# INLINE basicUnsafeMove #-}
basicUnsafeMove !dst !src
| basicOverlaps dst src = do
srcCopy <- basicUnsafeNew (mbasicLength src)
mbasicUnsafeCopy srcCopy src
mbasicUnsafeCopy dst srcCopy
| otherwise = mbasicUnsafeCopy dst src
{-# INLINE basicUnsafeGrow #-}
basicUnsafeGrow v by
= do
v' <- basicUnsafeNew (n+by)
mbasicUnsafeCopy (mbasicUnsafeSlice 0 n v') v
return v'
where
n = mbasicLength v
{-# MINIMAL mbasicLength, mbasicUnsafeSlice, basicOverlaps,
basicUnsafeNew, basicInitialize, basicUnsafeRead,
basicUnsafeWrite #-}
-- | Size hint
data Size = Exact Int -- ^ Exact size
| Max Int -- ^ Upper bound on the size
| Unknown -- ^ Unknown size
deriving( Eq, Show )
upperBound :: Size -> Maybe Int
upperBound (Exact n) = Just n
upperBound (Max n) = Just n
upperBound Unknown = Nothing
data Chunk v a = Chunk Int (forall m. (PrimMonad m, Vector v a) => Mutable v (PrimState m) a -> m ())
data Bundle m v a = Bundle { sElems :: Stream m a
, sChunks :: Stream m (Chunk v a)
, sVector :: Maybe (v a)
, sSize :: Size
}
-- | Convert a pure stream to a monadic stream
lift :: Monad m => Bundle Id v a -> Bundle m v a
{-# INLINE_FUSED lift #-}
lift (Bundle (Stream step s) (Stream vstep t) v sz)
= Bundle (Stream (return . unId . step) s)
(Stream (return . unId . vstep) t) v sz
-- unstream :: (PrimMonad m, MVector v a)
-- => Bundle Id u a -> m (v (PrimState m) a)
-- -- NOTE: replace INLINE_FUSED by INLINE? (also in unstreamR)
-- {-# INLINE_FUSED unstream #-}
-- unstream s = munstream (lift s)
-- munstream :: (PrimMonad m, MVector v a)
-- => Bundle m u a -> m (v (PrimState m) a)
-- {-# INLINE_FUSED munstream #-}
-- munstream s = case upperBound (sSize s) of
-- Just n -> munstreamMax s n
-- Nothing -> munstreamUnknown s
--
-- munstreamMax :: (PrimMonad m, MVector v a)
-- => Bundle m u a -> Int -> m (v (PrimState m) a)
-- {-# INLINE munstreamMax #-}
-- munstreamMax s n
-- = do
-- v <- unsafeNew n
-- let put i x = do
-- unsafeWrite v i x
-- return (i+1)
-- n' <- foldlM' put 0 s
-- return $ unsafeSlice 0 n' v
-- bfoldM' :: Monad m => (a -> b -> m a) -> a -> Bundle Id v b -> m a
-- {-# INLINE bfoldM' #-}
-- bfoldM' m z = foldlM' m z . lift
--
--
-- munstreamUnknown :: (PrimMonad m, MVector v a)
-- => Bundle m u a -> m (v (PrimState m) a)
-- {-# INLINE munstreamUnknown #-}
-- munstreamUnknown s
-- = do
-- v <- unsafeNew 1
-- (v', n) <- foldlM put (v, 1) s
-- return $ unsafeSlice 1 n v'
-- where
-- {-# INLINE_INNER put #-}
-- put (v,i) x = do
-- v' <- unsafeAppend2 v i x
-- return (v',i+2)
--
-- -- | Monadic fold
-- bfoldM :: Monad m => (a -> b -> m a) -> a -> Bundle Id v b -> m a
-- {-# INLINE bfoldM #-}
-- bfoldM m z = foldlM m z . lift
--
-- -- | Left fold with a monadic operator
-- foldlM :: Monad m => (a -> b -> m a) -> a -> Bundle m v b -> m a
-- {-# INLINE_FUSED foldlM #-}
-- foldlM m z = S.foldlM m z . sElems
--
-- -- | Left fold with a strict accumulator and a monadic operator
-- foldlM' :: Monad m => (a -> b -> m a) -> a -> Bundle m v b -> m a
-- {-# INLINE_FUSED foldlM' #-}
-- foldlM' m z = S.foldlM' m z . sElems
unsafeNew :: (PrimMonad m, MVector v a) => Int -> m (v (PrimState m) a)
{-# INLINE unsafeNew #-}
unsafeNew n = stToPrim $ basicUnsafeNew n
unsafeSlice :: MVector v a => Int -- ^ starting index
-> Int -- ^ length of the slice
-> v s a
-> v s a
{-# INLINE unsafeSlice #-}
unsafeSlice i n v = mbasicUnsafeSlice i n v
unsafeWrite :: (PrimMonad m, MVector v a) => v (PrimState m) a -> Int -> a -> m ()
{-# INLINE unsafeWrite #-}
unsafeWrite v i x = stToPrim
$ basicUnsafeWrite v i x
length :: MVector v a => v s a -> Int
{-# INLINE length #-}
length = mbasicLength
unsafeAppend1 :: (PrimMonad m, MVector v a)
=> v (PrimState m) a -> Int -> a -> m (v (PrimState m) a)
{-# INLINE_INNER unsafeAppend1 #-}
-- NOTE: The case distinction has to be on the outside because
-- GHC creates a join point for the unsafeWrite even when everything
-- is inlined. This is bad because with the join point, v isn't getting
-- unboxed.
unsafeAppend1 v i x
| i < length v = do
unsafeWrite v i x
return v
| otherwise = do
v' <- enlarge v
unsafeWrite v' i x
return v'
-- | Grow a vector logarithmically.
enlarge :: (PrimMonad m, MVector v a)
=> v (PrimState m) a -> m (v (PrimState m) a)
{-# INLINE enlarge #-}
enlarge v = stToPrim $ do
vnew <- unsafeGrow v by
basicInitialize $ mbasicUnsafeSlice (length v) by vnew
return vnew
where
by = enlarge_delta v
enlarge_delta :: MVector v a => v s a -> Int
enlarge_delta v = max (length v) 1
unsafeGrow
:: (PrimMonad m, MVector v a)
=> v (PrimState m) a
-- ^ mutable vector to copy from
-> Int
-- ^ number of elements to grow the vector by (must be non-negative, but
-- this is not checked)
-> m (v (PrimState m) a)
{-# INLINE unsafeGrow #-}
unsafeGrow v n = stToPrim
$ basicUnsafeGrow v n
newtype Id a = Id { unId :: a }
instance Functor Id where
fmap f (Id x) = Id (f x)
instance Applicative Id where
pure = Id
(<*>) = ap
instance Monad Id where
Id x >>= f = f x
data Stream m a = forall s. Stream (s -> m (Step s a)) s
data Step s a = Yield a s | Done
instance Functor (Step s) where
{-# INLINE fmap #-}
fmap f (Yield x s) = Yield (f x) s
fmap _ Done = Done
instance Monad m => Functor (Stream m) where
{-# INLINE fmap #-}
fmap = smap
smap f = smapM (return . f)
smapM :: Monad m => (a -> m b) -> Stream m a -> Stream m b
{-# INLINE_FUSED smapM #-}
smapM f (Stream step t) = Stream step' t
where
{-# INLINE_INNER step' #-}
step' s = do
r <- step s
case r of
Yield x s' -> liftM (`Yield` s') (f x)
Done -> return Done
sfilterM :: Monad m => (a -> m Bool) -> Stream m a -> Stream m a
{-# INLINE_FUSED sfilterM #-}
sfilterM f (Stream step t) = Stream step' t
where
{-# INLINE_INNER step' #-}
step' s = do
r <- step s
case r of
Yield x s' -> do
b <- f x
if b then return $ Yield x s'
else step' s'
Done -> return $ Done
sfilter f = sfilterM (return . f)
sfoldrM :: Monad m => (a -> b -> m b) -> b -> Stream m a -> m b
{-# INLINE_FUSED sfoldrM #-}
sfoldrM f z (Stream step t) = foldrM_loop SPEC t
where
foldrM_loop !_ s
= do
r <- step s
case r of
Yield x s' -> f x =<< foldrM_loop SPEC s'
Done -> return z
sfromList :: Monad m => [a] -> Stream m a
{-# INLINE sfromList #-}
sfromList zs = Stream step zs
where
step (x:xs) = return (Yield x xs)
step [] = return Done
-- | Box monad
data Box a = Box { unBox :: a }
instance Functor Box where
fmap f (Box x) = Box (f x)
instance Applicative Box where
pure = Box
Box f <*> Box x = Box (f x)
instance Monad Box where
return = pure
Box x >>= f = f x
liftBox :: Monad m => Box a -> m a
liftBox (Box a) = return a
{-# INLINE liftBox #-}
sfoldlM :: Monad m => (a -> b -> m a) -> a -> Stream m b -> m a
{-# INLINE_FUSED sfoldlM #-}
sfoldlM m w (Stream step t) = foldlM_loop SPEC w t
where
foldlM_loop !_ z s
= do
r <- step s
case r of
Yield x s' -> do { z' <- m z x; foldlM_loop SPEC z' s' }
Done -> return z
sfoldlM' :: Monad m => (a -> b -> m a) -> a -> Stream m b -> m a
{-# INLINE_FUSED sfoldlM' #-}
sfoldlM' m w (Stream step t) = foldlM'_loop SPEC w t
where
foldlM'_loop !_ z s
= z `seq`
do
r <- step s
case r of
Yield x s' -> do { z' <- m z x; foldlM'_loop SPEC z' s' }
Done -> return z
uninitialised = undefined
type role MyMVector nominal representational
-- | Mutable boxed vectors keyed on the monad they live in ('IO' or @'ST' s@).
data MyMVector s a = MVector { _offset :: {-# UNPACK #-} !Int
-- ^ Offset in underlying array
, _size :: {-# UNPACK #-} !Int
-- ^ Size of slice
, _array :: {-# UNPACK #-} !(MutableArray s a)
-- ^ Underlying array
}
instance MVector MyMVector a where
{-# INLINE mbasicLength #-}
mbasicLength (MVector _ n _) = n
{-# INLINE mbasicUnsafeSlice #-}
mbasicUnsafeSlice j m (MVector i _ arr) = MVector (i+j) m arr
{-# INLINE basicOverlaps #-}
basicOverlaps (MVector i m arr1) (MVector j n arr2)
= sameMutableArray arr1 arr2
&& (between i j (j+n) || between j i (i+m))
where
between x y z = x >= y && x < z
{-# INLINE basicUnsafeNew #-}
basicUnsafeNew n
= do
arr <- newArray n uninitialised
return (MVector 0 n arr)
{-# INLINE basicInitialize #-}
-- initialization is unnecessary for boxed vectors
basicInitialize _ = return ()
{-# INLINE basicUnsafeReplicate #-}
basicUnsafeReplicate n x
= do
arr <- newArray n x
return (MVector 0 n arr)
{-# INLINE basicUnsafeRead #-}
basicUnsafeRead (MVector i _ arr) j = readArray arr (i+j)
{-# INLINE basicUnsafeWrite #-}
basicUnsafeWrite (MVector i _ arr) j x = writeArray arr (i+j) x
{-# INLINE mbasicUnsafeCopy #-}
mbasicUnsafeCopy (MVector i n dst) (MVector j _ src)
= copyMutableArray dst i src j n
basicUnsafeMove dst@(MVector iDst n arrDst) src@(MVector iSrc _ arrSrc)
= case n of
0 -> return ()
1 -> readArray arrSrc iSrc >>= writeArray arrDst iDst
2 -> do
x <- readArray arrSrc iSrc
y <- readArray arrSrc (iSrc + 1)
writeArray arrDst iDst x
writeArray arrDst (iDst + 1) y
_
| basicOverlaps dst src
-> case compare iDst iSrc of
LT -> moveBackwards arrDst iDst iSrc n
EQ -> return ()
GT | (iDst - iSrc) * 2 < n
-> moveForwardsLargeOverlap arrDst iDst iSrc n
| otherwise
-> moveForwardsSmallOverlap arrDst iDst iSrc n
| otherwise -> mbasicUnsafeCopy dst src
{-# INLINE basicClear #-}
basicClear v = basicSet v uninitialised
{-# INLINE loopM #-}
loopM :: Monad m => Int -> (Int -> m a) -> m ()
loopM !n k = let
go i = when (i < n) (k i >> go (i+1))
in go 0
{-# INLINE moveBackwards #-}
moveBackwards :: PrimMonad m => MutableArray (PrimState m) a -> Int -> Int -> Int -> m ()
moveBackwards !arr !dstOff !srcOff !len =
loopM len $ \ i -> readArray arr (srcOff + i) >>= writeArray arr (dstOff + i)
{-# INLINE moveForwardsSmallOverlap #-}
-- Performs a move when dstOff > srcOff, optimized for when the overlap of the intervals is small.
moveForwardsSmallOverlap :: PrimMonad m => MutableArray (PrimState m) a -> Int -> Int -> Int -> m ()
moveForwardsSmallOverlap !arr !dstOff !srcOff !len = do
tmp <- newArray overlap uninitialised
loopM overlap $ \ i -> readArray arr (dstOff + i) >>= writeArray tmp i
loopM nonOverlap $ \ i -> readArray arr (srcOff + i) >>= writeArray arr (dstOff + i)
loopM overlap $ \ i -> readArray tmp i >>= writeArray arr (dstOff + nonOverlap + i)
where nonOverlap = dstOff - srcOff; overlap = len - nonOverlap
moveForwardsLargeOverlap :: PrimMonad m => MutableArray (PrimState m) a -> Int -> Int -> Int -> m ()
moveForwardsLargeOverlap !arr !dstOff !srcOff !len = do
queue <- newArray nonOverlap uninitialised
loopM nonOverlap $ \ i -> readArray arr (srcOff + i) >>= writeArray queue i
let mov !i !qTop = when (i < dstOff + len) $ do
x <- readArray arr i
y <- readArray queue qTop
writeArray arr i y
writeArray queue qTop x
mov (i+1) (if qTop + 1 >= nonOverlap then 0 else qTop + 1)
mov dstOff 0
where nonOverlap = dstOff - srcOff
data MyVector a = Vector {-# UNPACK #-} !Int
{-# UNPACK #-} !Int
{-# UNPACK #-} !(Array a)
type instance Mutable MyVector = MyMVector
instance Vector MyVector a where
{-# INLINE basicUnsafeFreeze #-}
basicUnsafeFreeze (MVector i n marr)
= Vector i n `liftM` unsafeFreezeArray marr
{-# INLINE basicUnsafeThaw #-}
basicUnsafeThaw (Vector i n arr)
= MVector i n `liftM` unsafeThawArray arr
{-# INLINE basicLength #-}
basicLength (Vector _ n _) = n
{-# INLINE basicUnsafeSlice #-}
basicUnsafeSlice j n (Vector i _ arr) = Vector (i+j) n arr
{-# INLINE basicUnsafeIndexM #-}
basicUnsafeIndexM (Vector i _ arr) j = indexArrayM arr (i+j)
{-# INLINE basicUnsafeCopy #-}
basicUnsafeCopy (MVector i n dst) (Vector j _ src)
= copyArray dst i src j n
test :: MyVector Double -> MyVector Double
test = map (+ 1) . filter (> 10)
==================== Tidy Core ====================
Result size of Tidy Core
= {terms: 2,873, types: 6,049, coercions: 1,332, joins: 17/38}
-- RHS size: {terms: 17, types: 14, coercions: 0, joins: 0/0}
$WVector :: forall a. Int %1 -> Int %1 -> Array a %1 -> MyVector a
$WVector
= \ (@a_aMu)
(dt_a1z7 :: Int)
(dt_a1z8 :: Int)
(dt_a1z9 :: Array a_aMu) ->
case dt_a1z7 of { I# dt_a1za ->
case dt_a1z8 of { I# dt_a1zb ->
case dt_a1z9 of { Array dt_a1zc -> Vector dt_a1za dt_a1zb dt_a1zc }
}
}
-- RHS size: {terms: 18, types: 19, coercions: 0, joins: 0/0}
$WMVector
:: forall s a.
Int %1 -> Int %1 -> MutableArray s a %1 -> MyMVector s a
$WMVector
= \ (@s_aMv)
(@a_aMw)
(dt_a1yx :: Int)
(dt_a1yy :: Int)
(dt_a1yz :: MutableArray s_aMv a_aMw) ->
case dt_a1yx of { I# dt_a1yA ->
case dt_a1yy of { I# dt_a1yB ->
case dt_a1yz of { MutableArray dt_a1yC ->
MVector dt_a1yA dt_a1yB dt_a1yC
}
}
}
-- RHS size: {terms: 7, types: 62, coercions: 0, joins: 0/0}
$p1Vector
:: forall (v :: * -> *) a. Vector v a => MVector (Mutable v) a
$p1Vector
= \ (@(v_a196 :: * -> *))
(@a_a197)
(v_B1 :: Vector v_a196 a_a197) ->
case v_B1 of v_B1
{ C:Vector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 ->
v_B2
}
-- RHS size: {terms: 7, types: 62, coercions: 0, joins: 0/0}
basicUnsafeFreeze
:: forall (v :: * -> *) a s.
Vector v a =>
Mutable v s a -> ST s (v a)
basicUnsafeFreeze
= \ (@(v_a196 :: * -> *))
(@a_a197)
(v_B1 :: Vector v_a196 a_a197) ->
case v_B1 of v_B1
{ C:Vector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 ->
v_B3
}
-- RHS size: {terms: 7, types: 62, coercions: 0, joins: 0/0}
basicUnsafeThaw
:: forall (v :: * -> *) a s.
Vector v a =>
v a -> ST s (Mutable v s a)
basicUnsafeThaw
= \ (@(v_a196 :: * -> *))
(@a_a197)
(v_B1 :: Vector v_a196 a_a197) ->
case v_B1 of v_B1
{ C:Vector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 ->
v_B4
}
-- RHS size: {terms: 7, types: 62, coercions: 0, joins: 0/0}
basicLength :: forall (v :: * -> *) a. Vector v a => v a -> Int
basicLength
= \ (@(v_a196 :: * -> *))
(@a_a197)
(v_B1 :: Vector v_a196 a_a197) ->
case v_B1 of v_B1
{ C:Vector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 ->
v_B5
}
-- RHS size: {terms: 7, types: 62, coercions: 0, joins: 0/0}
basicUnsafeSlice
:: forall (v :: * -> *) a. Vector v a => Int -> Int -> v a -> v a
basicUnsafeSlice
= \ (@(v_a196 :: * -> *))
(@a_a197)
(v_B1 :: Vector v_a196 a_a197) ->
case v_B1 of v_B1
{ C:Vector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 ->
v_B6
}
-- RHS size: {terms: 7, types: 62, coercions: 0, joins: 0/0}
basicUnsafeIndexM
:: forall (v :: * -> *) a. Vector v a => v a -> Int -> Box a
basicUnsafeIndexM
= \ (@(v_a196 :: * -> *))
(@a_a197)
(v_B1 :: Vector v_a196 a_a197) ->
case v_B1 of v_B1
{ C:Vector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 ->
v_B7
}
-- RHS size: {terms: 7, types: 62, coercions: 0, joins: 0/0}
basicUnsafeCopy
:: forall (v :: * -> *) a s.
Vector v a =>
Mutable v s a -> v a -> ST s ()
basicUnsafeCopy
= \ (@(v_a196 :: * -> *))
(@a_a197)
(v_B1 :: Vector v_a196 a_a197) ->
case v_B1 of v_B1
{ C:Vector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 ->
v_B8
}
-- RHS size: {terms: 7, types: 62, coercions: 0, joins: 0/0}
elemseq
:: forall (v :: * -> *) a b. Vector v a => v a -> a -> b -> b
elemseq
= \ (@(v_a196 :: * -> *))
(@a_a197)
(v_B1 :: Vector v_a196 a_a197) ->
case v_B1 of v_B1
{ C:Vector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 ->
v_B9
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
mbasicLength
:: forall (v :: * -> * -> *) a s. MVector v a => v s a -> Int
mbasicLength
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_B2
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
mbasicUnsafeSlice
:: forall (v :: * -> * -> *) a s.
MVector v a =>
Int -> Int -> v s a -> v s a
mbasicUnsafeSlice
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_B3
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
basicOverlaps
:: forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> v s a -> Bool
basicOverlaps
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_B4
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
basicUnsafeNew
:: forall (v :: * -> * -> *) a s.
MVector v a =>
Int -> ST s (v s a)
basicUnsafeNew
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_B5
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
basicInitialize
:: forall (v :: * -> * -> *) a s. MVector v a => v s a -> ST s ()
basicInitialize
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_B6
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
basicUnsafeReplicate
:: forall (v :: * -> * -> *) a s.
MVector v a =>
Int -> a -> ST s (v s a)
basicUnsafeReplicate
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_B7
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
basicUnsafeRead
:: forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> Int -> ST s a
basicUnsafeRead
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_B8
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
basicUnsafeWrite
:: forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> Int -> a -> ST s ()
basicUnsafeWrite
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_B9
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
basicClear
:: forall (v :: * -> * -> *) a s. MVector v a => v s a -> ST s ()
basicClear
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_Ba
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
basicSet
:: forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> a -> ST s ()
basicSet
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_Bb
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
mbasicUnsafeCopy
:: forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> v s a -> ST s ()
mbasicUnsafeCopy
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_Bc
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
basicUnsafeMove
:: forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> v s a -> ST s ()
basicUnsafeMove
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_Bd
}
-- RHS size: {terms: 7, types: 119, coercions: 0, joins: 0/0}
basicUnsafeGrow
:: forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> Int -> ST s (v s a)
basicUnsafeGrow
= \ (@(v_a15l :: * -> * -> *))
(@a_a15m)
(v_B1 :: MVector v_a15l a_a15m) ->
case v_B1 of v_B1
{ C:MVector v_B2 v_B3 v_B4 v_B5 v_B6 v_B7 v_B8 v_B9 v_Ba v_Bb v_Bc
v_Bd v_Be ->
v_Be
}
-- RHS size: {terms: 6, types: 7, coercions: 0, joins: 0/0}
$fVectorMyVectora_$celemseq
:: forall a b. MyVector a -> a -> b -> b
$fVectorMyVectora_$celemseq
= \ (@a_a2W8) (@b_a2XE) _ _ (x_a19i :: b_a2XE) -> x_a19i
-- RHS size: {terms: 74, types: 87, coercions: 70, joins: 2/2}
$fMVectorMyMVectora_$cbasicSet
:: forall a s. MyMVector s a -> a -> ST s ()
$fMVectorMyMVectora_$cbasicSet
= (\ (@a_X1)
(@s_a3l5)
(eta_X2 :: MyMVector s_a3l5 a_X1)
(eta1_B1 :: a_X1)
(eta2_X3 :: State# s_a3l5) ->
case eta_X2 of { MVector ipv_s3TH ipv1_s3TI ipv2_s3TJ ->
case ipv1_s3TI of wild_X4 {
__DEFAULT ->
case writeArray#
(ipv2_s3TJ `cast` <Co:5>) ipv_s3TH eta1_B1 (eta2_X3 `cast` <Co:4>)
of s'#_a3yG
{ __DEFAULT ->
join {
exit_X5 :: Int# -> State# s_a3l5 -> (# State# s_a3l5, () #)
exit_X5 (ww_s43Q :: Int#) (w_s43N :: State# s_a3l5)
= case copyMutableArray#
(ipv2_s3TJ `cast` <Co:5>)
ipv_s3TH
(ipv2_s3TJ `cast` <Co:5>)
(+# ipv_s3TH ww_s43Q)
(-# wild_X4 ww_s43Q)
(w_s43N `cast` <Co:4>)
of s'#1_a3J9
{ __DEFAULT ->
(# s'#1_a3J9, () #) `cast` <Co:10>
} } in
joinrec {
$wdo_set_s43S :: Int# -> State# s_a3l5 -> (# State# s_a3l5, () #)
$wdo_set_s43S (ww_s43Q :: Int#) (w_s43N :: State# s_a3l5)
= case <# (*# 2# ww_s43Q) wild_X4 of {
__DEFAULT -> jump exit_X5 ww_s43Q w_s43N;
1# ->
case copyMutableArray#
(ipv2_s3TJ `cast` <Co:5>)
ipv_s3TH
(ipv2_s3TJ `cast` <Co:5>)
(+# ipv_s3TH ww_s43Q)
ww_s43Q
(w_s43N `cast` <Co:4>)
of s'#1_a3J9
{ __DEFAULT ->
jump $wdo_set_s43S (*# 2# ww_s43Q) (s'#1_a3J9 `cast` <Co:3>)
}
}; } in
jump $wdo_set_s43S 1# (s'#_a3yG `cast` <Co:3>)
};
0# -> (# eta2_X3, () #)
}
})
`cast` <Co:17>
-- RHS size: {terms: 58, types: 34, coercions: 0, joins: 0/0}
$fMVectorMyMVectora_$cbasicOverlaps
:: forall a s. MyMVector s a -> MyMVector s a -> Bool
$fMVectorMyMVectora_$cbasicOverlaps
= \ (@a_a2XM)
(@s_a2Y9)
(eta_B0 :: MyMVector s_a2Y9 a_a2XM)
(eta1_B1 :: MyMVector s_a2Y9 a_a2XM) ->
case eta_B0 of { MVector dt_d3Lv dt1_d3Lw dt2_d3Lx ->
case eta1_B1 of { MVector dt3_d3Ly dt4_d3Lz dt5_d3LA ->
case sameMutableArray# dt2_d3Lx dt5_d3LA of {
__DEFAULT -> False;
1# ->
case >=# dt_d3Lv dt3_d3Ly of {
__DEFAULT ->
case >=# dt3_d3Ly dt_d3Lv of {
__DEFAULT -> False;
1# -> tagToEnum# (<# dt3_d3Ly (+# dt_d3Lv dt1_d3Lw))
};
1# ->
case <# dt_d3Lv (+# dt3_d3Ly dt4_d3Lz) of {
__DEFAULT ->
case >=# dt3_d3Ly dt_d3Lv of {
__DEFAULT -> False;
1# -> tagToEnum# (<# dt3_d3Ly (+# dt_d3Lv dt1_d3Lw))
};
1# -> True
}
}
}
}
}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
lvl_r3BO :: Addr#
lvl_r3BO = "undefined"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl1_r48c :: [Char]
lvl1_r48c = unpackCString# lvl_r3BO
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule4 :: Addr#
$trModule4 = "main"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl2_r48d :: [Char]
lvl2_r48d = unpackCString# $trModule4
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule2 :: Addr#
$trModule2 = "All"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl3_r48e :: [Char]
lvl3_r48e = unpackCString# $trModule2
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
lvl4_r48f :: Addr#
lvl4_r48f = "All.hs"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl5_r48g :: [Char]
lvl5_r48g = unpackCString# lvl4_r48f
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl6_r48h :: Int
lvl6_r48h = I# 552#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl7_r48i :: Int
lvl7_r48i = I# 17#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl8_r48j :: Int
lvl8_r48j = I# 26#
-- RHS size: {terms: 8, types: 0, coercions: 0, joins: 0/0}
lvl9_r48k :: SrcLoc
lvl9_r48k
= SrcLoc
lvl2_r48d
lvl3_r48e
lvl5_r48g
lvl6_r48h
lvl7_r48i
lvl6_r48h
lvl8_r48j
-- RHS size: {terms: 4, types: 0, coercions: 0, joins: 0/0}
lvl10_r48l :: CallStack
lvl10_r48l = PushCallStack lvl1_r48c lvl9_r48k EmptyCallStack
-- RHS size: {terms: 3, types: 4, coercions: 4, joins: 0/0}
uninitialised :: forall {a}. a
uninitialised = \ (@a_a2k6) -> undefined (lvl10_r48l `cast` <Co:4>)
-- RHS size: {terms: 36, types: 67, coercions: 35, joins: 0/1}
$fMVectorMyMVectora_$cbasicUnsafeGrow
:: forall a s. MyMVector s a -> Int -> ST s (MyMVector s a)
$fMVectorMyMVectora_$cbasicUnsafeGrow
= (\ (@a_X1)
(@s_a3na)
(eta_X2 :: MyMVector s_a3na a_X1)
(eta1_B1 :: Int)
(eta2_X3 :: State# s_a3na) ->
case eta_X2 of { MVector dt_d3Lp dt1_d3Lq dt2_d3Lr ->
case eta1_B1 of { I# y_a3Mz ->
let {
n#_a3yV :: Int#
n#_a3yV = +# dt1_d3Lq y_a3Mz } in
case newArray# n#_a3yV uninitialised (eta2_X3 `cast` <Co:4>) of
{ (# ipv_a3yZ, ipv1_a3z0 #) ->
case copyMutableArray#
(dt2_d3Lr `cast` <Co:5>) dt_d3Lp ipv1_a3z0 0# dt1_d3Lq ipv_a3yZ
of s'#_a3J9
{ __DEFAULT ->
(# s'#_a3J9 `cast` <Co:3>,
MVector 0# n#_a3yV (ipv1_a3z0 `cast` <Co:4>) #)
}
}
}
})
`cast` <Co:19>
-- RHS size: {terms: 6, types: 9, coercions: 0, joins: 0/0}
$fMVectorMyMVectora_$cbasicClear
:: forall a s. MyMVector s a -> ST s ()
$fMVectorMyMVectora_$cbasicClear
= \ (@a_X1) (@s_a3kU) (eta_X2 :: MyMVector s_a3kU a_X1) ->
$fMVectorMyMVectora_$cbasicSet eta_X2 uninitialised
-- RHS size: {terms: 481, types: 593, coercions: 416, joins: 10/14}
$w$cbasicUnsafeMove
:: forall {a} {s}.
Int#
-> Int#
-> MutableArray# s a
-> Int#
-> Int#
-> MutableArray# s a
-> State# s
-> (# State# s, () #)
$w$cbasicUnsafeMove
= \ (@a_s44N)
(@s_s44O)
(ww_s44U :: Int#)
(ww1_s44V :: Int#)
(ww2_s44W :: MutableArray# s_s44O a_s44N)
(ww3_s450 :: Int#)
(ww4_s451 :: Int#)
(ww5_s452 :: MutableArray# s_s44O a_s44N)
(w_s44R :: State# s_s44O) ->
case ww1_s44V of ds_X4 {
__DEFAULT ->
case sameMutableArray# ww2_s44W ww5_s452 of {
__DEFAULT ->
case copyMutableArray#
(ww5_s452 `cast` <Co:5>)
ww3_s450
(ww2_s44W `cast` <Co:5>)
ww_s44U
ds_X4
(w_s44R `cast` <Co:4>)
of s'#_a3J9
{ __DEFAULT ->
(# s'#_a3J9, () #) `cast` <Co:10>
};
1# ->
join {
$j_s40s :: (# State# s_s44O, () #)
$j_s40s
= case <# ww_s44U ww3_s450 of {
__DEFAULT ->
case ==# ww_s44U ww3_s450 of {
__DEFAULT ->
case <# (*# (-# ww_s44U ww3_s450) 2#) ds_X4 of {
__DEFAULT ->
let {
nonOverlap_s3VT :: Int#
nonOverlap_s3VT = -# ww_s44U ww3_s450 } in
let {
overlap_s3VR :: Int#
overlap_s3VR = -# ds_X4 nonOverlap_s3VT } in
case newArray# overlap_s3VR uninitialised (w_s44R `cast` <Co:4>) of
{ (# ipv_a3yZ, ipv1_a3z0 #) ->
join {
$w$j_s44c :: State# s_s44O -> (# State# s_s44O, () #)
$w$j_s44c (w1_s44a :: State# s_s44O)
= join {
$w$j1_s442 :: State# s_s44O -> (# State# s_s44O, () #)
$w$j1_s442 (w2_s440 :: State# s_s44O)
= joinrec {
$wgo_s43Z
:: Int# -> State# s_s44O -> (# State# s_s44O, () #)
$wgo_s43Z (ww6_s43X :: Int#)
(w3_s43U :: State# s_s44O)
= case <# ww6_s43X overlap_s3VR of {
__DEFAULT -> (# w3_s43U, () #);
1# ->
case (readArray#
ipv1_a3z0
ww6_s43X
(w3_s43U `cast` <Co:4>))
`cast` <Co:10>
of
{ (# ipv2_Xl, ipv3_Xm #) ->
case writeArray#
(ww2_s44W `cast` <Co:5>)
(+#
(+# ww_s44U nonOverlap_s3VT)
ww6_s43X)
ipv3_Xm
(ipv2_Xl `cast` <Co:4>)
of s'#_a3yG
{ __DEFAULT ->
jump $wgo_s43Z
(+# ww6_s43X 1#) (s'#_a3yG `cast` <Co:3>)
}
}
}; } in
jump $wgo_s43Z 0# w2_s440 } in
joinrec {
$wgo_s449
:: Int# -> State# s_s44O -> (# State# s_s44O, () #)
$wgo_s449 (ww6_s447 :: Int#) (w2_s444 :: State# s_s44O)
= case <# ww6_s447 nonOverlap_s3VT of {
__DEFAULT -> jump $w$j1_s442 w2_s444;
1# ->
case (readArray#
(ww2_s44W `cast` <Co:5>)
(+# ww3_s450 ww6_s447)
(w2_s444 `cast` <Co:4>))
`cast` <Co:10>
of
{ (# ipv2_Xf, ipv3_Xg #) ->
case writeArray#
(ww2_s44W `cast` <Co:5>)
(+# ww_s44U ww6_s447)
ipv3_Xg
(ipv2_Xf `cast` <Co:4>)
of s'#_a3yG
{ __DEFAULT ->
jump $wgo_s449
(+# ww6_s447 1#) (s'#_a3yG `cast` <Co:3>)
}
}
}; } in
jump $wgo_s449 0# w1_s44a } in
joinrec {
$wgo_s44j :: Int# -> State# s_s44O -> (# State# s_s44O, () #)
$wgo_s44j (ww6_s44h :: Int#) (w1_s44e :: State# s_s44O)
= case <# ww6_s44h overlap_s3VR of {
__DEFAULT -> jump $w$j_s44c w1_s44e;
1# ->
case (readArray#
(ww2_s44W `cast` <Co:5>)
(+# ww_s44U ww6_s44h)
(w1_s44e `cast` <Co:4>))
`cast` <Co:10>
of
{ (# ipv2_Xc, ipv3_Xd #) ->
case writeArray#
ipv1_a3z0 ww6_s44h ipv3_Xd (ipv2_Xc `cast` <Co:4>)
of s'#_a3yG
{ __DEFAULT ->
jump $wgo_s44j (+# ww6_s44h 1#) (s'#_a3yG `cast` <Co:3>)
}
}
}; } in
jump $wgo_s44j 0# (ipv_a3yZ `cast` <Co:3>)
};
1# ->
let {
nonOverlap_s3W3 :: Int#
nonOverlap_s3W3 = -# ww_s44U ww3_s450 } in
case newArray# nonOverlap_s3W3 uninitialised (w_s44R `cast` <Co:4>)
of
{ (# ipv_a3yZ, ipv1_a3z0 #) ->
join {
$w$j_s44y :: State# s_s44O -> (# State# s_s44O, () #)
$w$j_s44y (w1_s44w :: State# s_s44O)
= let {
lvl11_s40n :: Int#
lvl11_s40n = +# ww_s44U ds_X4 } in
joinrec {
$wmov_s44v
:: Int#
-> Int# -> State# s_s44O -> (# State# s_s44O, () #)
$wmov_s44v (ww6_s44p :: Int#)
(ww7_s44t :: Int#)
(w2_s44m :: State# s_s44O)
= case <# ww6_s44p lvl11_s40n of {
__DEFAULT -> (# w2_s44m, () #);
1# ->
case (readArray#
(ww2_s44W `cast` <Co:5>)
ww6_s44p
(w2_s44m `cast` <Co:4>))
`cast` <Co:9>
of
{ (# ipv2_Xi, ipv3_Xj #) ->
case (readArray#
ipv1_a3z0 ww7_s44t (ipv2_Xi `cast` <Co:4>))
`cast` <Co:9>
of
{ (# ipv4_Xl, ipv5_Xm #) ->
case writeArray#
(ww2_s44W `cast` <Co:5>)
ww6_s44p
ipv5_Xm
(ipv4_Xl `cast` <Co:4>)
of s'#_a3yG
{ __DEFAULT ->
case writeArray# ipv1_a3z0 ww7_s44t ipv3_Xj s'#_a3yG
of s'#1_Xs
{ __DEFAULT ->
case >=# (+# ww7_s44t 1#) nonOverlap_s3W3 of {
__DEFAULT ->
jump $wmov_s44v
(+# ww6_s44p 1#)
(+# ww7_s44t 1#)
(s'#1_Xs `cast` <Co:3>);
1# ->
jump $wmov_s44v
(+# ww6_s44p 1#) 0# (s'#1_Xs `cast` <Co:3>)
}
}
}
}
}
}; } in
jump $wmov_s44v ww_s44U 0# w1_s44w } in
joinrec {
$wgo_s44F :: Int# -> State# s_s44O -> (# State# s_s44O, () #)
$wgo_s44F (ww6_s44D :: Int#) (w1_s44A :: State# s_s44O)
= case <# ww6_s44D nonOverlap_s3W3 of {
__DEFAULT -> jump $w$j_s44y w1_s44A;
1# ->
case (readArray#
(ww2_s44W `cast` <Co:5>)
(+# ww3_s450 ww6_s44D)
(w1_s44A `cast` <Co:4>))
`cast` <Co:9>
of
{ (# ipv2_Xf, ipv3_Xg #) ->
case writeArray#
ipv1_a3z0 ww6_s44D ipv3_Xg (ipv2_Xf `cast` <Co:4>)
of s'#_a3yG
{ __DEFAULT ->
jump $wgo_s44F (+# ww6_s44D 1#) (s'#_a3yG `cast` <Co:3>)
}
}
}; } in
jump $wgo_s44F 0# (ipv_a3yZ `cast` <Co:3>)
}
};
1# -> (# w_s44R, () #)
};
1# ->
joinrec {
$wgo_s44M :: Int# -> State# s_s44O -> (# State# s_s44O, () #)
$wgo_s44M (ww6_s44K :: Int#) (w1_s44H :: State# s_s44O)
= case <# ww6_s44K ds_X4 of {
__DEFAULT -> (# w1_s44H, () #);
1# ->
case (readArray#
(ww2_s44W `cast` <Co:5>)
(+# ww3_s450 ww6_s44K)
(w1_s44H `cast` <Co:4>))
`cast` <Co:10>
of
{ (# ipv_a3MO, ipv1_a3MP #) ->
case writeArray#
(ww2_s44W `cast` <Co:5>)
(+# ww_s44U ww6_s44K)
ipv1_a3MP
(ipv_a3MO `cast` <Co:4>)
of s'#_a3yG
{ __DEFAULT ->
jump $wgo_s44M (+# ww6_s44K 1#) (s'#_a3yG `cast` <Co:3>)
}
}
}; } in
jump $wgo_s44M 0# w_s44R
} } in
case >=# ww_s44U ww3_s450 of {
__DEFAULT ->
case >=# ww3_s450 ww_s44U of {
__DEFAULT ->
case copyMutableArray#
(ww5_s452 `cast` <Co:5>)
ww3_s450
(ww2_s44W `cast` <Co:5>)
ww_s44U
ds_X4
(w_s44R `cast` <Co:4>)
of s'#_a3J9
{ __DEFAULT ->
(# s'#_a3J9, () #) `cast` <Co:10>
};
1# ->
case <# ww3_s450 (+# ww_s44U ds_X4) of {
__DEFAULT ->
case copyMutableArray#
(ww5_s452 `cast` <Co:5>)
ww3_s450
(ww2_s44W `cast` <Co:5>)
ww_s44U
ds_X4
(w_s44R `cast` <Co:4>)
of s'#_a3J9
{ __DEFAULT ->
(# s'#_a3J9, () #) `cast` <Co:10>
};
1# -> jump $j_s40s
}
};
1# ->
case <# ww_s44U (+# ww3_s450 ww4_s451) of {
__DEFAULT ->
case >=# ww3_s450 ww_s44U of {
__DEFAULT ->
case copyMutableArray#
(ww5_s452 `cast` <Co:5>)
ww3_s450
(ww2_s44W `cast` <Co:5>)
ww_s44U
ds_X4
(w_s44R `cast` <Co:4>)
of s'#_a3J9
{ __DEFAULT ->
(# s'#_a3J9, () #) `cast` <Co:10>
};
1# ->
case <# ww3_s450 (+# ww_s44U ds_X4) of {
__DEFAULT ->
case copyMutableArray#
(ww5_s452 `cast` <Co:5>)
ww3_s450
(ww2_s44W `cast` <Co:5>)
ww_s44U
ds_X4
(w_s44R `cast` <Co:4>)
of s'#_a3J9
{ __DEFAULT ->
(# s'#_a3J9, () #) `cast` <Co:10>
};
1# -> jump $j_s40s
}
};
1# -> jump $j_s40s
}
}
};
0# -> (# w_s44R, () #);
1# ->
case (readArray#
(ww5_s452 `cast` <Co:5>) ww3_s450 (w_s44R `cast` <Co:4>))
`cast` <Co:9>
of
{ (# ipv_a3MO, ipv1_a3MP #) ->
case writeArray#
(ww2_s44W `cast` <Co:5>) ww_s44U ipv1_a3MP (ipv_a3MO `cast` <Co:4>)
of s'#_a3yG
{ __DEFAULT ->
(# s'#_a3yG, () #) `cast` <Co:10>
}
};
2# ->
case (readArray#
(ww5_s452 `cast` <Co:5>) ww3_s450 (w_s44R `cast` <Co:4>))
`cast` <Co:9>
of
{ (# ipv_a3MO, ipv1_a3MP #) ->
case (readArray#
(ww5_s452 `cast` <Co:5>) (+# ww3_s450 1#) (ipv_a3MO `cast` <Co:4>))
`cast` <Co:9>
of
{ (# ipv2_X8, ipv3_X9 #) ->
case writeArray#
(ww2_s44W `cast` <Co:5>) ww_s44U ipv1_a3MP (ipv2_X8 `cast` <Co:4>)
of s'#_a3yG
{ __DEFAULT ->
case writeArray#
(ww2_s44W `cast` <Co:5>) (+# ww_s44U 1#) ipv3_X9 s'#_a3yG
of s'#1_Xg
{ __DEFAULT ->
(# s'#1_Xg, () #) `cast` <Co:10>
}
}
}
}
}
-- RHS size: {terms: 19, types: 29, coercions: 0, joins: 0/0}
$fMVectorMyMVectora1
:: forall {a} {s}.
MyMVector (s |> <*>_N) (a |> <*>_N)
-> MyMVector (s |> <*>_N) (a |> <*>_N) -> STRep (s |> <*>_N) ()
$fMVectorMyMVectora1
= \ (@a_s44N)
(@s_s44O)
(w_s44P :: MyMVector s_s44O a_s44N)
(w1_s44Q :: MyMVector s_s44O a_s44N)
(w2_s44R :: State# s_s44O) ->
case w_s44P of { MVector ww1_s44U ww2_s44V ww3_s44W ->
case w1_s44Q of { MVector ww5_s450 ww6_s451 ww7_s452 ->
$w$cbasicUnsafeMove
ww1_s44U ww2_s44V ww3_s44W ww5_s450 ww6_s451 ww7_s452 w2_s44R
}
}
-- RHS size: {terms: 19, types: 47, coercions: 25, joins: 0/0}
$fMVectorMyMVectora_$cbasicUnsafeNew
:: forall a s. Int -> ST s (MyMVector s a)
$fMVectorMyMVectora_$cbasicUnsafeNew
= (\ (@a_a2XM)
(@s_a3jE)
(eta_B0 :: Int)
(s1_a3MM :: State# s_a3jE) ->
case eta_B0 of { I# n#_a3yV ->
case newArray# n#_a3yV uninitialised (s1_a3MM `cast` <Co:4>) of
{ (# ipv_a3yZ, ipv1_a3z0 #) ->
(# ipv_a3yZ `cast` <Co:3>,
MVector 0# n#_a3yV (ipv1_a3z0 `cast` <Co:4>) #)
}
})
`cast` <Co:14>
-- RHS size: {terms: 18, types: 47, coercions: 38, joins: 0/0}
$fVectorMyVectora_$cbasicUnsafeFreeze
:: forall a s. Mutable MyVector s a -> ST s (MyVector a)
$fVectorMyVectora_$cbasicUnsafeFreeze
= (\ (@a_a2W8)
(@s_a2Wh)
(eta_B0 :: Mutable MyVector s_a2Wh a_a2W8)
(eta1_X1 :: State# s_a2Wh) ->
case eta_B0 `cast` <Co:4> of { MVector dt_d3L4 dt1_d3L5 dt2_d3L6 ->
case unsafeFreezeArray#
(dt2_d3L6 `cast` <Co:5>) (eta1_X1 `cast` <Co:4>)
of
{ (# ipv_a3Go, ipv1_a3Gp #) ->
(# ipv_a3Go `cast` <Co:3>, Vector dt_d3L4 dt1_d3L5 ipv1_a3Gp #)
}
})
`cast` <Co:22>
-- RHS size: {terms: 18, types: 51, coercions: 46, joins: 0/0}
$fVectorMyVectora_$cbasicUnsafeThaw
:: forall a s. MyVector a -> ST s (Mutable MyVector s a)
$fVectorMyVectora_$cbasicUnsafeThaw
= (\ (@a_a2W8)
(@s_a2WE)
(eta_B0 :: MyVector a_a2W8)
(eta1_X1 :: State# s_a2WE) ->
case eta_B0 of { Vector dt_d3L7 dt1_d3L8 dt2_d3L9 ->
case unsafeThawArray# dt2_d3L9 (eta1_X1 `cast` <Co:4>) of
{ (# ipv_a3GG, ipv1_a3GH #) ->
(# ipv_a3GG `cast` <Co:3>,
MVector dt_d3L7 dt1_d3L8 (ipv1_a3GH `cast` <Co:4>) #)
`cast` <Co:13>
}
})
`cast` <Co:22>
-- RHS size: {terms: 7, types: 10, coercions: 0, joins: 0/0}
$fVectorMyVectora_$cbasicLength :: forall a. MyVector a -> Int
$fVectorMyVectora_$cbasicLength
= \ (@a_a2W8) (ds_d3GJ :: MyVector a_a2W8) ->
case ds_d3GJ of { Vector dt_d3La dt1_d3Lb dt2_d3Lc -> I# dt1_d3Lb }
-- RHS size: {terms: 19, types: 17, coercions: 0, joins: 0/0}
$fVectorMyVectora_$cbasicUnsafeSlice
:: forall a. Int -> Int -> MyVector a -> MyVector a
$fVectorMyVectora_$cbasicUnsafeSlice
= \ (@a_a2W8)
(eta_B0 :: Int)
(eta1_B1 :: Int)
(eta2_B2 :: MyVector a_a2W8) ->
case eta2_B2 of { Vector dt_d3Ld dt1_d3Le dt2_d3Lf ->
case eta_B0 of { I# y_a3Mz ->
case eta1_B1 of { I# dt4_a1zb ->
Vector (+# dt_d3Ld y_a3Mz) dt4_a1zb dt2_d3Lf
}
}
}
-- RHS size: {terms: 18, types: 19, coercions: 0, joins: 0/0}
$fVectorMyVectora_$cbasicUnsafeIndexM
:: forall a. MyVector a -> Int -> Box a
$fVectorMyVectora_$cbasicUnsafeIndexM
= \ (@a_a2W8) (eta_B0 :: MyVector a_a2W8) (eta1_B1 :: Int) ->
case eta_B0 of { Vector dt_d3Lg dt1_d3Lh dt2_d3Li ->
case eta1_B1 of { I# y_a3Mz ->
case indexArray# dt2_d3Li (+# dt_d3Lg y_a3Mz) of
{ (# ipv_a3Hb #) ->
Box ipv_a3Hb
}
}
}
-- RHS size: {terms: 23, types: 42, coercions: 48, joins: 0/0}
$fVectorMyVectora_$cbasicUnsafeCopy
:: forall a s. Mutable MyVector s a -> MyVector a -> ST s ()
$fVectorMyVectora_$cbasicUnsafeCopy
= (\ (@a_a2W8)
(@s_a2Xp)
(eta_B0 :: Mutable MyVector s_a2Xp a_a2W8)
(eta1_B1 :: MyVector a_a2W8)
(eta2_X2 :: State# s_a2Xp) ->
case eta_B0 `cast` <Co:4> of { MVector dt_d3Lj dt1_d3Lk dt2_d3Ll ->
case eta1_B1 of { Vector dt3_d3Lm dt4_d3Ln dt5_d3Lo ->
case copyArray#
dt5_d3Lo
dt3_d3Lm
(dt2_d3Ll `cast` <Co:5>)
dt_d3Lj
dt1_d3Lk
(eta2_X2 `cast` <Co:4>)
of s'#_a3HI
{ __DEFAULT ->
(# s'#_a3HI, () #) `cast` <Co:10>
}
}
})
`cast` <Co:25>
-- RHS size: {terms: 8, types: 14, coercions: 0, joins: 0/0}
$fMVectorMyMVectora_$cmbasicLength
:: forall a s. MyMVector s a -> Int
$fMVectorMyMVectora_$cmbasicLength
= \ (@a_a2XM) (@s_a2XR) (ds_d3HL :: MyMVector s_a2XR a_a2XM) ->
case ds_d3HL of { MVector dt_d3Lp dt1_d3Lq dt2_d3Lr ->
I# dt1_d3Lq
}
-- RHS size: {terms: 20, types: 22, coercions: 0, joins: 0/0}
$fMVectorMyMVectora_$cmbasicUnsafeSlice
:: forall a s. Int -> Int -> MyMVector s a -> MyMVector s a
$fMVectorMyMVectora_$cmbasicUnsafeSlice
= \ (@a_a2XM)
(@s_a2XW)
(eta_B0 :: Int)
(eta1_B1 :: Int)
(eta2_B2 :: MyMVector s_a2XW a_a2XM) ->
case eta2_B2 of { MVector dt_d3Ls dt1_d3Lt dt2_d3Lu ->
case eta_B0 of { I# y_a3Mz ->
case eta1_B1 of { I# dt4_a1yB ->
MVector (+# dt_d3Ls y_a3Mz) dt4_a1yB dt2_d3Lu
}
}
}
-- RHS size: {terms: 7, types: 15, coercions: 14, joins: 0/0}
$fMVectorMyMVectora_$cbasicInitialize
:: forall a s. MyMVector s a -> ST s ()
$fMVectorMyMVectora_$cbasicInitialize
= (\ (@a_a2XM) (@s_a3k1) _ (s1_a3MY :: State# s_a3k1) ->
(# s1_a3MY, () #))
`cast` <Co:14>
-- RHS size: {terms: 20, types: 47, coercions: 28, joins: 0/0}
$fMVectorMyMVectora_$cbasicUnsafeReplicate
:: forall a s. Int -> a -> ST s (MyMVector s a)
$fMVectorMyMVectora_$cbasicUnsafeReplicate
= (\ (@a_a2XM)
(@s_a3ka)
(eta_B0 :: Int)
(eta1_B1 :: a_a2XM)
(s1_a3MM :: State# s_a3ka) ->
case eta_B0 of { I# n#_a3yV ->
case newArray# n#_a3yV eta1_B1 (s1_a3MM `cast` <Co:4>) of
{ (# ipv_a3yZ, ipv1_a3z0 #) ->
(# ipv_a3yZ `cast` <Co:3>,
MVector 0# n#_a3yV (ipv1_a3z0 `cast` <Co:4>) #)
}
})
`cast` <Co:17>
-- RHS size: {terms: 17, types: 23, coercions: 42, joins: 0/0}
$fMVectorMyMVectora_$cbasicUnsafeRead
:: forall a s. MyMVector s a -> Int -> ST s a
$fMVectorMyMVectora_$cbasicUnsafeRead
= (\ (@a_a2XM)
(@s_a3kw)
(eta_B0 :: MyMVector s_a3kw a_a2XM)
(eta1_B1 :: Int)
(eta2_X2 :: State# s_a3kw) ->
case eta_B0 of { MVector dt_d3LB dt1_d3LC dt2_d3LD ->
case eta1_B1 of { I# y_a3Mz ->
(readArray#
(dt2_d3LD `cast` <Co:5>)
(+# dt_d3LB y_a3Mz)
(eta2_X2 `cast` <Co:4>))
`cast` <Co:10>
}
})
`cast` <Co:23>
-- RHS size: {terms: 24, types: 37, coercions: 45, joins: 0/0}
$fMVectorMyMVectora_$cbasicUnsafeWrite
:: forall a s. MyMVector s a -> Int -> a -> ST s ()
$fMVectorMyMVectora_$cbasicUnsafeWrite
= (\ (@a_a2XM)
(@s_a3kI)
(eta_B0 :: MyMVector s_a3kI a_a2XM)
(eta1_B1 :: Int)
(eta2_B2 :: a_a2XM)
(eta3_X3 :: State# s_a3kI) ->
case eta_B0 of { MVector dt_d3LE dt1_d3LF dt2_d3LG ->
case eta1_B1 of { I# y_a3Mz ->
case writeArray#
(dt2_d3LG `cast` <Co:5>)
(+# dt_d3LE y_a3Mz)
eta2_B2
(eta3_X3 `cast` <Co:4>)
of s'#_a3yG
{ __DEFAULT ->
(# s'#_a3yG, () #) `cast` <Co:10>
}
}
})
`cast` <Co:26>
-- RHS size: {terms: 23, types: 44, coercions: 50, joins: 0/0}
$fMVectorMyMVectora_$cmbasicUnsafeCopy
:: forall a s. MyMVector s a -> MyMVector s a -> ST s ()
$fMVectorMyMVectora_$cmbasicUnsafeCopy
= (\ (@a_a2XM)
(@s_a3lf)
(eta_B0 :: MyMVector s_a3lf a_a2XM)
(eta1_B1 :: MyMVector s_a3lf a_a2XM)
(eta2_X2 :: State# s_a3lf) ->
case eta_B0 of { MVector dt_d3LH dt1_d3LI dt2_d3LJ ->
case eta1_B1 of { MVector dt3_d3LK dt4_d3LL dt5_d3LM ->
case copyMutableArray#
(dt5_d3LM `cast` <Co:5>)
dt3_d3LK
(dt2_d3LJ `cast` <Co:5>)
dt_d3LH
dt1_d3LI
(eta2_X2 `cast` <Co:4>)
of s'#_a3J9
{ __DEFAULT ->
(# s'#_a3J9, () #) `cast` <Co:10>
}
}
})
`cast` <Co:26>
-- RHS size: {terms: 15, types: 17, coercions: 16, joins: 0/0}
$fMVectorMyMVectora :: forall a. MVector MyMVector a
$fMVectorMyMVectora
= \ (@a_X1) ->
C:MVector
$fMVectorMyMVectora_$cmbasicLength
$fMVectorMyMVectora_$cmbasicUnsafeSlice
$fMVectorMyMVectora_$cbasicOverlaps
$fMVectorMyMVectora_$cbasicUnsafeNew
$fMVectorMyMVectora_$cbasicInitialize
$fMVectorMyMVectora_$cbasicUnsafeReplicate
$fMVectorMyMVectora_$cbasicUnsafeRead
$fMVectorMyMVectora_$cbasicUnsafeWrite
$fMVectorMyMVectora_$cbasicClear
$fMVectorMyMVectora_$cbasicSet
$fMVectorMyMVectora_$cmbasicUnsafeCopy
($fMVectorMyMVectora1 `cast` <Co:16>)
$fMVectorMyMVectora_$cbasicUnsafeGrow
-- RHS size: {terms: 10, types: 12, coercions: 4, joins: 0/0}
$fVectorMyVectora :: forall a. Vector MyVector a
$fVectorMyVectora
= \ (@a_a2W8) ->
C:Vector
($fMVectorMyMVectora `cast` <Co:4>)
$fVectorMyVectora_$cbasicUnsafeFreeze
$fVectorMyVectora_$cbasicUnsafeThaw
$fVectorMyVectora_$cbasicLength
$fVectorMyVectora_$cbasicUnsafeSlice
$fVectorMyVectora_$cbasicUnsafeIndexM
$fVectorMyVectora_$cbasicUnsafeCopy
$fVectorMyVectora_$celemseq
-- RHS size: {terms: 5, types: 6, coercions: 0, joins: 0/0}
$fMonadId_$c>> :: forall a b. Id a -> Id b -> Id b
$fMonadId_$c>>
= \ (@a_a3qz) (@b_a3qA) _ (eta1_B1 :: Id b_a3qA) -> eta1_B1
-- RHS size: {terms: 5, types: 6, coercions: 0, joins: 0/0}
$fApplicativeId_$c*> :: forall a b. Id a -> Id b -> Id b
$fApplicativeId_$c*>
= \ (@a_a3rz) (@b_a3rA) _ (eta1_a3JV :: Id b_a3rA) -> eta1_a3JV
-- RHS size: {terms: 5, types: 6, coercions: 0, joins: 0/0}
$fApplicativeId_$c<* :: forall a b. Id a -> Id b -> Id a
$fApplicativeId_$c<*
= \ (@a_a3rK) (@b_a3rL) (eta1_a3JP :: Id a_a3rK) _ -> eta1_a3JP
-- RHS size: {terms: 11, types: 15, coercions: 11, joins: 0/1}
$fApplicativeId_$cliftA2
:: forall a b c. (a -> b -> c) -> Id a -> Id b -> Id c
$fApplicativeId_$cliftA2
= \ (@a_a3rm)
(@b_a3rn)
(@c_a3ro)
(eta_a3JO :: a_a3rm -> b_a3rn -> c_a3ro)
(eta1_a3JP :: Id a_a3rm) ->
let {
m1_s3Y8 :: b_a3rn -> c_a3ro
m1_s3Y8 = eta_a3JO (eta1_a3JP `cast` <Co:2>) } in
(\ (m2_X2 :: Id b_a3rn) -> m1_s3Y8 (m2_X2 `cast` <Co:2>))
`cast` <Co:7>
-- RHS size: {terms: 6, types: 9, coercions: 5, joins: 0/0}
$fApplicativeId1 :: forall {a} {b}. Id (a -> b) -> Id a -> b
$fApplicativeId1
= \ (@a_a3r8)
(@b_a3r9)
(m1_a3Ky :: Id (a_a3r8 -> b_a3r9))
(m2_a3Kz :: Id a_a3r8) ->
(m1_a3Ky `cast` <Co:3>) (m2_a3Kz `cast` <Co:2>)
-- RHS size: {terms: 6, types: 7, coercions: 2, joins: 0/0}
$fMonadId_$c>>= :: forall a b. Id a -> (a -> Id b) -> Id b
$fMonadId_$c>>=
= \ (@a_a3qt)
(@b_a3qu)
(ds_d3Kp :: Id a_a3qt)
(f_a1ay :: a_a3qt -> Id b_a3qu) ->
f_a1ay (ds_d3Kp `cast` <Co:2>)
-- RHS size: {terms: 3, types: 3, coercions: 0, joins: 0/0}
$fApplicativeId2 :: forall {a}. a -> a
$fApplicativeId2 = \ (@a_a3r1) (ds_d3Kt :: a_a3r1) -> ds_d3Kt
-- RHS size: {terms: 5, types: 6, coercions: 0, joins: 0/0}
$fFunctorId1 :: forall {a} {b}. a -> Id b -> a
$fFunctorId1
= \ (@a_a3s5) (@b_a3s6) (eta_a3K8 :: a_a3s5) _ -> eta_a3K8
-- RHS size: {terms: 6, types: 8, coercions: 2, joins: 0/0}
$fFunctorId2 :: forall {a} {b}. (a -> b) -> Id a -> b
$fFunctorId2
= \ (@a_a3rX)
(@b_a3rY)
(f_a1az :: a_a3rX -> b_a3rY)
(ds_d3KC :: Id a_a3rX) ->
f_a1az (ds_d3KC `cast` <Co:2>)
-- RHS size: {terms: 3, types: 1, coercions: 32, joins: 0/0}
$fFunctorId :: Functor Id
$fFunctorId
= C:Functor
($fFunctorId2 `cast` <Co:17>) ($fFunctorId1 `cast` <Co:15>)
-- RHS size: {terms: 7, types: 1, coercions: 27, joins: 0/0}
$fApplicativeId :: Applicative Id
$fApplicativeId
= C:Applicative
$fFunctorId
($fApplicativeId2 `cast` <Co:9>)
($fApplicativeId1 `cast` <Co:18>)
$fApplicativeId_$cliftA2
$fApplicativeId_$c*>
$fApplicativeId_$c<*
-- RHS size: {terms: 5, types: 1, coercions: 9, joins: 0/0}
$fMonadId :: Monad Id
$fMonadId
= C:Monad
$fApplicativeId
$fMonadId_$c>>=
$fMonadId_$c>>
($fApplicativeId2 `cast` <Co:9>)
-- RHS size: {terms: 14, types: 19, coercions: 0, joins: 0/0}
$fFunctorStep_$cfmap
:: forall s a b. (a -> b) -> Step s a -> Step s b
$fFunctorStep_$cfmap
= \ (@s_a3pV)
(@a_a3q0)
(@b_a3q1)
(f_a1au :: a_a3q0 -> b_a3q1)
(ds_d3Km :: Step s_a3pV a_a3q0) ->
case ds_d3Km of {
Yield x_a1av s1_a1aw -> Yield (f_a1au x_a1av) s1_a1aw;
Done -> Done
}
-- RHS size: {terms: 13, types: 17, coercions: 0, joins: 0/0}
$fFunctorStep_$c<$ :: forall s a b. a -> Step s b -> Step s a
$fFunctorStep_$c<$
= \ (@s_a3pV)
(@a_a3qc)
(@b_a3qd)
(eta_X1 :: a_a3qc)
(eta1_B0 :: Step s_a3pV b_a3qd) ->
case eta1_B0 of {
Yield x_a1av s1_a1aw -> Yield eta_X1 s1_a1aw;
Done -> Done
}
-- RHS size: {terms: 4, types: 5, coercions: 0, joins: 0/0}
$fFunctorStep :: forall s. Functor (Step s)
$fFunctorStep
= \ (@s_a3pV) -> C:Functor $fFunctorStep_$cfmap $fFunctorStep_$c<$
-- RHS size: {terms: 10, types: 12, coercions: 0, joins: 0/0}
$fFunctorBox_$cfmap :: forall a b. (a -> b) -> Box a -> Box b
$fFunctorBox_$cfmap
= \ (@a_a3p9)
(@b_a3pa)
(f_a1aq :: a_a3p9 -> b_a3pa)
(ds_d3K2 :: Box a_a3p9) ->
case ds_d3K2 of { Box x_a1ar -> Box (f_a1aq x_a1ar) }
-- RHS size: {terms: 9, types: 10, coercions: 0, joins: 0/0}
$fFunctorBox_$c<$ :: forall a b. a -> Box b -> Box a
$fFunctorBox_$c<$
= \ (@a_a3pm)
(@b_a3pn)
(eta_X1 :: a_a3pm)
(ds_d3K2 :: Box b_a3pn) ->
case ds_d3K2 of { Box x_a1ar -> Box eta_X1 }
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$fFunctorBox :: Functor Box
$fFunctorBox = C:Functor $fFunctorBox_$cfmap $fFunctorBox_$c<$
-- RHS size: {terms: 13, types: 18, coercions: 0, joins: 0/0}
$fApplicativeBox_$c<*>
:: forall a b. Box (a -> b) -> Box a -> Box b
$fApplicativeBox_$c<*>
= \ (@a_a3o9)
(@b_a3oa)
(ds_d3JG :: Box (a_a3o9 -> b_a3oa))
(ds1_d3JH :: Box a_a3o9) ->
case ds_d3JG of { Box f_a1ao ->
case ds1_d3JH of { Box x_a1ap -> Box (f_a1ao x_a1ap) }
}
-- RHS size: {terms: 4, types: 4, coercions: 0, joins: 0/0}
$fApplicativeBox_$cpure :: forall a. a -> Box a
$fApplicativeBox_$cpure
= \ (@a_a3o0) (ds_d3JF :: a_a3o0) -> Box ds_d3JF
-- RHS size: {terms: 8, types: 9, coercions: 0, joins: 0/0}
$fApplicativeBox_$c*> :: forall a b. Box a -> Box b -> Box b
$fApplicativeBox_$c*>
= \ (@a_a3oG)
(@b_a3oH)
(eta_a3JU :: Box a_a3oG)
(eta1_a3JV :: Box b_a3oH) ->
case eta_a3JU of { Box x_a1ar -> eta1_a3JV }
-- RHS size: {terms: 22, types: 30, coercions: 0, joins: 0/1}
$fApplicativeBox_$cliftA2
:: forall a b c. (a -> b -> c) -> Box a -> Box b -> Box c
$fApplicativeBox_$cliftA2
= \ (@a_a3oo)
(@b_a3op)
(@c_a3oq)
(eta_a3JO :: a_a3oo -> b_a3op -> c_a3oq)
(eta1_a3JP :: Box a_a3oo) ->
let {
ds_s3Y6 :: Box (b_a3op -> c_a3oq)
ds_s3Y6
= case eta1_a3JP of { Box x_a1ar -> Box (eta_a3JO x_a1ar) } } in
\ (ds1_d3JH :: Box b_a3op) ->
case ds_s3Y6 of { Box f_a1ao ->
case ds1_d3JH of { Box x_a1ap -> Box (f_a1ao x_a1ap) }
}
-- RHS size: {terms: 11, types: 12, coercions: 0, joins: 0/0}
$fApplicativeBox_$c<* :: forall a b. Box a -> Box b -> Box a
$fApplicativeBox_$c<*
= \ (@a_a3oW)
(@b_a3oX)
(eta1_a3JP :: Box a_a3oW)
(ds_d3JH :: Box b_a3oX) ->
case eta1_a3JP of wild_X1 { Box x_a1ar ->
case ds_d3JH of { Box x1_a1ap -> wild_X1 }
}
-- RHS size: {terms: 7, types: 1, coercions: 0, joins: 0/0}
$fApplicativeBox :: Applicative Box
$fApplicativeBox
= C:Applicative
$fFunctorBox
$fApplicativeBox_$cpure
$fApplicativeBox_$c<*>
$fApplicativeBox_$cliftA2
$fApplicativeBox_$c*>
$fApplicativeBox_$c<*
-- RHS size: {terms: 9, types: 10, coercions: 0, joins: 0/0}
$fMonadBox_$c>>= :: forall a b. Box a -> (a -> Box b) -> Box b
$fMonadBox_$c>>=
= \ (@a_a3nq)
(@b_a3nr)
(ds_d3Jx :: Box a_a3nq)
(f_a1an :: a_a3nq -> Box b_a3nr) ->
case ds_d3Jx of { Box x_a1am -> f_a1an x_a1am }
-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
$fMonadBox :: Monad Box
$fMonadBox
= C:Monad
$fApplicativeBox
$fMonadBox_$c>>=
$fApplicativeBox_$c*>
$fApplicativeBox_$cpure
-- RHS size: {terms: 41, types: 16, coercions: 0, joins: 0/0}
$fEqSize_$c== :: Size -> Size -> Bool
$fEqSize_$c==
= \ (ds_d3FI :: Size) (ds1_d3FJ :: Size) ->
case ds_d3FI of {
Exact a1_a1zA ->
case ds1_d3FJ of wild1_X2 {
__DEFAULT -> case dataToTag# wild1_X2 of { __DEFAULT -> False };
Exact b1_a1zB -> eqInt a1_a1zA b1_a1zB
};
Max a1_a1zC ->
case ds1_d3FJ of wild1_X2 {
__DEFAULT -> case dataToTag# wild1_X2 of { __DEFAULT -> False };
Max b1_a1zD -> eqInt a1_a1zC b1_a1zD
};
Unknown ->
case ds1_d3FJ of lwild_s40A {
__DEFAULT -> case dataToTag# lwild_s40A of { __DEFAULT -> False };
Unknown -> True
}
}
-- RHS size: {terms: 63, types: 26, coercions: 0, joins: 0/0}
$fEqSize_$c/= :: Size -> Size -> Bool
$fEqSize_$c/=
= \ (eta_B0 :: Size) (eta1_B1 :: Size) ->
case eta_B0 of {
Exact a1_a1zA ->
case eta1_B1 of wild1_X2 {
__DEFAULT -> case dataToTag# wild1_X2 of { __DEFAULT -> True };
Exact b1_a1zB ->
case a1_a1zA of { I# x_a3Nc ->
case b1_a1zB of { I# y_a3Nf ->
case ==# x_a3Nc y_a3Nf of {
__DEFAULT -> True;
1# -> False
}
}
}
};
Max a1_a1zC ->
case eta1_B1 of wild1_X2 {
__DEFAULT -> case dataToTag# wild1_X2 of { __DEFAULT -> True };
Max b1_a1zD ->
case a1_a1zC of { I# x_a3Nc ->
case b1_a1zD of { I# y_a3Nf ->
case ==# x_a3Nc y_a3Nf of {
__DEFAULT -> True;
1# -> False
}
}
}
};
Unknown ->
case eta1_B1 of lwild_s40A {
__DEFAULT -> case dataToTag# lwild_s40A of { __DEFAULT -> True };
Unknown -> False
}
}
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$fEqSize :: Eq Size
$fEqSize = C:Eq $fEqSize_$c== $fEqSize_$c/=
-- RHS size: {terms: 8, types: 12, coercions: 0, joins: 0/0}
$dmelemseq
:: forall (v :: * -> *) a b. Vector v a => v a -> a -> b -> b
$dmelemseq
= \ (@(v_a196 :: * -> *))
(@a_a197)
_
(@b_a2Va)
_
_
(x_a19i :: b_a2Va) ->
x_a19i
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$fShowSize2 :: Int
$fShowSize2 = I# 0#
-- RHS size: {terms: 40, types: 69, coercions: 52, joins: 0/1}
$dmbasicUnsafeGrow
:: forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> Int -> ST s (v s a)
$dmbasicUnsafeGrow
= (\ (@(v_a15l :: * -> * -> *))
(@a_a15m)
($dMVector_a2Qo :: MVector v_a15l a_a15m)
(@s_a2TG)
(v1_a18Z :: v_a15l s_a2TG a_a15m)
(by_a190 :: Int)
(eta_B0 :: State# s_a2TG) ->
let {
n_s3Y4 :: Int
n_s3Y4 = mbasicLength $dMVector_a2Qo v1_a18Z } in
case ((basicUnsafeNew
$dMVector_a2Qo
(case n_s3Y4 of { I# x_a3Mw ->
case by_a190 of { I# y_a3Mz -> I# (+# x_a3Mw y_a3Mz) }
}))
`cast` <Co:5>)
eta_B0
of
{ (# ipv_a3MO, ipv1_a3MP #) ->
case ((mbasicUnsafeCopy
$dMVector_a2Qo
(mbasicUnsafeSlice $dMVector_a2Qo $fShowSize2 n_s3Y4 ipv1_a3MP)
v1_a18Z)
`cast` <Co:3>)
ipv_a3MO
of
{ (# ipv2_a3Np, ipv3_a3Nq #) ->
(# ipv2_a3Np, ipv1_a3MP #)
}
})
`cast` <Co:44>
-- RHS size: {terms: 45, types: 70, coercions: 58, joins: 0/0}
$dmbasicUnsafeMove
:: forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> v s a -> ST s ()
$dmbasicUnsafeMove
= (\ (@(v_a15l :: * -> * -> *))
(@a_a15m)
($dMVector_a2Qo :: MVector v_a15l a_a15m)
(@s_a2T5)
(dst_a18W :: v_a15l s_a2T5 a_a15m)
(src_a18X :: v_a15l s_a2T5 a_a15m)
(eta_B0 :: State# s_a2T5) ->
case dst_a18W of dst1_X0 { __DEFAULT ->
case src_a18X of src1_X1 { __DEFAULT ->
case basicOverlaps $dMVector_a2Qo dst1_X0 src1_X1 of {
False ->
((mbasicUnsafeCopy $dMVector_a2Qo dst1_X0 src1_X1) `cast` <Co:3>)
eta_B0;
True ->
case ((basicUnsafeNew
$dMVector_a2Qo (mbasicLength $dMVector_a2Qo src1_X1))
`cast` <Co:5>)
eta_B0
of
{ (# ipv_a3MO, ipv1_a3MP #) ->
case ((mbasicUnsafeCopy $dMVector_a2Qo ipv1_a3MP src1_X1)
`cast` <Co:3>)
ipv_a3MO
of
{ (# ipv2_a3Np, ipv3_a3Nq #) ->
((mbasicUnsafeCopy $dMVector_a2Qo dst1_X0 ipv1_a3MP) `cast` <Co:3>)
ipv2_a3Np
}
}
}
}
})
`cast` <Co:44>
-- RHS size: {terms: 9, types: 23, coercions: 25, joins: 0/0}
$dmbasicClear
:: forall (v :: * -> * -> *) a s. MVector v a => v s a -> ST s ()
$dmbasicClear
= (\ (@(v_a15l :: * -> * -> *))
(@a_a15m)
_
(@s_a2QP)
_
(s1_a3MY :: State# s_a2QP) ->
(# s1_a3MY, () #))
`cast` <Co:25>
-- RHS size: {terms: 23, types: 56, coercions: 36, joins: 0/0}
$dmbasicUnsafeReplicate
:: forall (v :: * -> * -> *) a s.
MVector v a =>
Int -> a -> ST s (v s a)
$dmbasicUnsafeReplicate
= (\ (@(v_a15l :: * -> * -> *))
(@a_a15m)
($dMVector_a2Qo :: MVector v_a15l a_a15m)
(@s_a2Qr)
(n_a16t :: Int)
(x_a16u :: a_a15m)
(s1_a3MM :: State# s_a2Qr) ->
case ((basicUnsafeNew $dMVector_a2Qo n_a16t) `cast` <Co:5>) s1_a3MM
of
{ (# ipv_a3MO, ipv1_a3MP #) ->
case ((basicSet $dMVector_a2Qo ipv1_a3MP x_a16u) `cast` <Co:3>)
ipv_a3MO
of
{ (# ipv2_a3Np, ipv3_a3Nq #) ->
(# ipv2_a3Np, ipv1_a3MP #)
}
})
`cast` <Co:28>
-- RHS size: {terms: 3, types: 3, coercions: 0, joins: 0/0}
unId1 :: forall {a}. Id a -> Id a
unId1 = \ (@a_a1sy) (ds_d3EG :: Id a_a1sy) -> ds_d3EG
-- RHS size: {terms: 1, types: 0, coercions: 8, joins: 0/0}
unId :: forall a. Id a -> a
unId = unId1 `cast` <Co:8>
-- RHS size: {terms: 6, types: 6, coercions: 0, joins: 0/0}
unBox :: forall a. Box a -> a
unBox
= \ (@a_a1tZ) (ds_d3EE :: Box a_a1tZ) ->
case ds_d3EE of { Box ds1_d3EF -> ds1_d3EF }
-- RHS size: {terms: 8, types: 25, coercions: 0, joins: 0/0}
sSize :: forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize
= \ (@(m_a1y8 :: * -> *))
(@(v_a1y9 :: * -> *))
(@a_a1ya)
(ds_d3Ez :: Bundle m_a1y8 v_a1y9 a_a1ya) ->
case ds_d3Ez of { Bundle ds1_d3EA ds2_d3EB ds3_d3EC ds4_d3ED ->
ds4_d3ED
}
-- RHS size: {terms: 8, types: 25, coercions: 0, joins: 0/0}
sVector
:: forall (m :: * -> *) (v :: * -> *) a.
Bundle m v a -> Maybe (v a)
sVector
= \ (@(m_a1y4 :: * -> *))
(@(v_a1y5 :: * -> *))
(@a_a1y6)
(ds_d3Eu :: Bundle m_a1y4 v_a1y5 a_a1y6) ->
case ds_d3Eu of { Bundle ds1_d3Ev ds2_d3Ew ds3_d3Ex ds4_d3Ey ->
ds3_d3Ex
}
-- RHS size: {terms: 8, types: 25, coercions: 0, joins: 0/0}
sChunks
:: forall (m :: * -> *) (v :: * -> *) a.
Bundle m v a -> Stream m (Chunk v a)
sChunks
= \ (@(m_a1y0 :: * -> *))
(@(v_a1y1 :: * -> *))
(@a_a1y2)
(ds_d3Ep :: Bundle m_a1y0 v_a1y1 a_a1y2) ->
case ds_d3Ep of { Bundle ds1_d3Eq ds2_d3Er ds3_d3Es ds4_d3Et ->
ds2_d3Er
}
-- RHS size: {terms: 8, types: 25, coercions: 0, joins: 0/0}
sElems
:: forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems
= \ (@(m_a1xW :: * -> *))
(@(v_a1xX :: * -> *))
(@a_a1xY)
(ds_d3Ek :: Bundle m_a1xW v_a1xX a_a1xY) ->
case ds_d3Ek of { Bundle ds1_d3El ds2_d3Em ds3_d3En ds4_d3Eo ->
ds1_d3El
}
-- RHS size: {terms: 8, types: 15, coercions: 0, joins: 0/0}
_array :: forall s a. MyMVector s a -> MutableArray s a
_array
= \ (@s_a1yK) (@a_a1yL) (ds_d3Eg :: MyMVector s_a1yK a_a1yL) ->
case ds_d3Eg of { MVector dt_d3KZ dt1_d3L0 dt2_d3L1 ->
MutableArray dt2_d3L1
}
-- RHS size: {terms: 8, types: 13, coercions: 0, joins: 0/0}
_size :: forall s a. MyMVector s a -> Int
_size
= \ (@s_a1yH) (@a_a1yI) (ds_d3Ec :: MyMVector s_a1yH a_a1yI) ->
case ds_d3Ec of { MVector dt_d3KW dt1_d3KX dt2_d3KY ->
I# dt1_d3KX
}
-- RHS size: {terms: 8, types: 13, coercions: 0, joins: 0/0}
_offset :: forall s a. MyMVector s a -> Int
_offset
= \ (@s_a1yE) (@a_a1yF) (ds_d3E8 :: MyMVector s_a1yE a_a1yF) ->
case ds_d3E8 of { MVector dt_d3KT dt1_d3KU dt2_d3KV -> I# dt_d3KT }
-- RHS size: {terms: 43, types: 75, coercions: 0, joins: 0/4}
$wsmap
:: forall {m :: * -> *} {a} {b}.
Monad m =>
(a -> b) -> forall {s}. (s -> m (Step s a)) -> s -> Stream m b
$wsmap
= \ (@(m_s457 :: * -> *))
(@a_s458)
(@b_s459)
(w_s45a :: Monad m_s457)
(w1_s45b :: a_s458 -> b_s459)
(@s_s45f)
(ww_s45g :: s_s45f -> m_s457 (Step s_s45f a_s458))
(ww1_s45h :: s_s45f) ->
let {
f_s3XU :: b_s459 -> m_s457 b_s459
f_s3XU = return w_s45a } in
let {
lvl11_s46R :: m_s457 (Step s_s45f b_s459)
lvl11_s46R = return w_s45a Done } in
let {
lvl12_s46S :: Step s_s45f a_s458 -> m_s457 (Step s_s45f b_s459)
lvl12_s46S
= \ (r_a1dy :: Step s_s45f a_s458) ->
case r_a1dy of {
Yield x_a1dz s'_a1dA ->
>>=
w_s45a
(f_s3XU (w1_s45b x_a1dz))
(\ (x1_a3Aq :: b_s459) -> return w_s45a (Yield x1_a3Aq s'_a1dA));
Done -> lvl11_s46R
} } in
let {
step'_a1dw :: s_s45f -> m_s457 (Step s_s45f b_s459)
step'_a1dw
= \ (s1_a1dx :: s_s45f) ->
>>= w_s45a (ww_s45g s1_a1dx) lvl12_s46S } in
Stream step'_a1dw ww1_s45h
-- RHS size: {terms: 14, types: 27, coercions: 0, joins: 0/0}
smap
:: forall {m :: * -> *} {a} {b}.
Monad m =>
(a -> b) -> Stream m a -> Stream m b
smap
= \ (@(m_s457 :: * -> *))
(@a_s458)
(@b_s459)
(w_s45a :: Monad m_s457)
(w1_s45b :: a_s458 -> b_s459)
(w2_s45c :: Stream m_s457 a_s458) ->
case w2_s45c of { Stream @s_s45f ww1_s45g ww2_s45h ->
$wsmap w_s45a w1_s45b ww1_s45g ww2_s45h
}
-- RHS size: {terms: 42, types: 73, coercions: 0, joins: 0/4}
$w$c<$
:: forall {m :: * -> *} {a} {b}.
Monad m =>
a -> forall {s}. (s -> m (Step s b)) -> s -> Stream m a
$w$c<$
= \ (@(m_s45k :: * -> *))
(w_s45l :: Monad m_s45k)
(@a_s45m)
(@b_s45n)
(w1_s45o :: a_s45m)
(@s_s45s)
(ww_s45t :: s_s45s -> m_s45k (Step s_s45s b_s45n))
(ww1_s45u :: s_s45s) ->
let {
lvl11_s3YJ :: m_s45k a_s45m
lvl11_s3YJ = return w_s45l w1_s45o } in
let {
lvl12_s46T :: m_s45k (Step s_s45s a_s45m)
lvl12_s46T = return w_s45l Done } in
let {
lvl13_s46U :: Step s_s45s b_s45n -> m_s45k (Step s_s45s a_s45m)
lvl13_s46U
= \ (r_a1dy :: Step s_s45s b_s45n) ->
case r_a1dy of {
Yield x_a1dz s'_a1dA ->
>>=
w_s45l
lvl11_s3YJ
(\ (x1_a3Aq :: a_s45m) -> return w_s45l (Yield x1_a3Aq s'_a1dA));
Done -> lvl12_s46T
} } in
let {
step'_a1dw :: s_s45s -> m_s45k (Step s_s45s a_s45m)
step'_a1dw
= \ (s1_a1dx :: s_s45s) ->
>>= w_s45l (ww_s45t s1_a1dx) lvl13_s46U } in
Stream step'_a1dw ww1_s45u
-- RHS size: {terms: 14, types: 26, coercions: 0, joins: 0/0}
$fFunctorStream_$c<$
:: forall (m :: * -> *) a b.
Monad m =>
a -> Stream m b -> Stream m a
$fFunctorStream_$c<$
= \ (@(m_s45k :: * -> *))
(w_s45l :: Monad m_s45k)
(@a_s45m)
(@b_s45n)
(w1_s45o :: a_s45m)
(w2_s45p :: Stream m_s45k b_s45n) ->
case w2_s45p of { Stream @s_s45s ww1_s45t ww2_s45u ->
$w$c<$ w_s45l w1_s45o ww1_s45t ww2_s45u
}
-- RHS size: {terms: 13, types: 19, coercions: 0, joins: 0/0}
$fFunctorStream
:: forall (m :: * -> *). Monad m => Functor (Stream m)
$fFunctorStream
= \ (@(m_a3pv :: * -> *)) ($dMonad_a3pw :: Monad m_a3pv) ->
C:Functor
(\ (@a_a3pB)
(@b_a3pC)
(eta_B0 :: a_a3pB -> b_a3pC)
(eta1_B1 :: Stream m_a3pv a_a3pB) ->
smap $dMonad_a3pw eta_B0 eta1_B1)
($fFunctorStream_$c<$ $dMonad_a3pw)
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule3 :: TrName
$trModule3 = TrNameS $trModule4
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule1 :: TrName
$trModule1 = TrNameS $trModule2
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$trModule :: Module
$trModule = Module $trModule3 $trModule1
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep_r48m :: KindRep
$krep_r48m = KindRepTyConApp $tcConstraint []
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep1_r48n :: KindRep
$krep1_r48n = KindRepTyConApp $tcInt []
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep2_r48o :: KindRep
$krep2_r48o = KindRepFun krep$* $krep_r48m
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tcVector1 :: KindRep
$tcVector1 = KindRepFun krep$*Arr* $krep2_r48o
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tcChunk1 :: KindRep
$tcChunk1 = KindRepFun krep$*Arr* krep$*Arr*
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tcBundle1 :: KindRep
$tcBundle1 = KindRepFun krep$*Arr* $tcChunk1
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tcMVector1 :: KindRep
$tcMVector1 = KindRepFun krep$*->*->* $krep2_r48o
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$krep3_r48p :: KindRep
$krep3_r48p = KindRepVar 2#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$krep4_r48q :: KindRep
$krep4_r48q = KindRepVar 1#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$krep5_r48r :: KindRep
$krep5_r48r = KindRepVar 0#
-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
$krep6_r48s :: [KindRep]
$krep6_r48s = : $krep4_r48q []
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep7_r48t :: [KindRep]
$krep7_r48t = : $krep5_r48r $krep6_r48s
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep8_r48u :: KindRep
$krep8_r48u = KindRepTyConApp $tcMutableArray $krep7_r48t
-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
$krep9_r48v :: [KindRep]
$krep9_r48v = : $krep5_r48r []
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep10_r48w :: KindRep
$krep10_r48w = KindRepTyConApp $tcArray $krep9_r48v
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep11_r48x :: KindRep
$krep11_r48x = KindRepApp $krep4_r48q $krep3_r48p
-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
$krep12_r48y :: [KindRep]
$krep12_r48y = : $krep11_r48x []
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep13_r48z :: KindRep
$krep13_r48z = KindRepTyConApp $tcMaybe $krep12_r48y
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcNew2 :: Addr#
$tcNew2 = "New"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcNew1 :: TrName
$tcNew1 = TrNameS $tcNew2
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcNew :: TyCon
$tcNew
= TyCon
8185574813284806711##
17155420221501620820##
$trModule
$tcNew1
0#
$tcChunk1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcMVector3 :: Addr#
$tcMVector3 = "MVector"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcMVector2 :: TrName
$tcMVector2 = TrNameS $tcMVector3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcMVector :: TyCon
$tcMVector
= TyCon
2778033529734471430##
18202909676938676173##
$trModule
$tcMVector2
0#
$tcMVector1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcSize2 :: Addr#
$tcSize2 = "Size"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcSize1 :: TrName
$tcSize1 = TrNameS $tcSize2
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcSize :: TyCon
$tcSize
= TyCon
14009714932557301754##
14714460228013384533##
$trModule
$tcSize1
0#
krep$*
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$tc'Unknown1 :: KindRep
$tc'Unknown1 = KindRepTyConApp $tcSize []
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Unknown3 :: Addr#
$tc'Unknown3 = "'Unknown"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'Unknown2 :: TrName
$tc'Unknown2 = TrNameS $tc'Unknown3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tc'Unknown :: TyCon
$tc'Unknown
= TyCon
1593312817805567268##
2758355107959392490##
$trModule
$tc'Unknown2
0#
$tc'Unknown1
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tc'Exact1 :: KindRep
$tc'Exact1 = KindRepFun $krep1_r48n $tc'Unknown1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Exact3 :: Addr#
$tc'Exact3 = "'Exact"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'Exact2 :: TrName
$tc'Exact2 = TrNameS $tc'Exact3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tc'Exact :: TyCon
$tc'Exact
= TyCon
3893660780191588637##
9118247203783848425##
$trModule
$tc'Exact2
0#
$tc'Exact1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Max2 :: Addr#
$tc'Max2 = "'Max"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'Max1 :: TrName
$tc'Max1 = TrNameS $tc'Max2
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tc'Max :: TyCon
$tc'Max
= TyCon
555751940808526204##
15812823588482030007##
$trModule
$tc'Max1
0#
$tc'Exact1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcId2 :: Addr#
$tcId2 = "Id"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcId1 :: TrName
$tcId1 = TrNameS $tcId2
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcId :: TyCon
$tcId
= TyCon
6271990769149180759##
9363850085020919984##
$trModule
$tcId1
0#
krep$*Arr*
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep14_r48A :: KindRep
$krep14_r48A = KindRepTyConApp $tcId $krep9_r48v
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tc'Id1 :: KindRep
$tc'Id1 = KindRepFun $krep5_r48r $krep14_r48A
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Id3 :: Addr#
$tc'Id3 = "'Id"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'Id2 :: TrName
$tc'Id2 = TrNameS $tc'Id3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tc'Id :: TyCon
$tc'Id
= TyCon
11371317071600739885##
8499849324293252856##
$trModule
$tc'Id2
1#
$tc'Id1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcStep2 :: Addr#
$tcStep2 = "Step"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcStep1 :: TrName
$tcStep1 = TrNameS $tcStep2
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcStep :: TyCon
$tcStep
= TyCon
12115177078819875606##
5555048306010174274##
$trModule
$tcStep1
0#
krep$*->*->*
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tc'Done1 :: KindRep
$tc'Done1 = KindRepTyConApp $tcStep $krep7_r48t
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Done3 :: Addr#
$tc'Done3 = "'Done"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'Done2 :: TrName
$tc'Done2 = TrNameS $tc'Done3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tc'Done :: TyCon
$tc'Done
= TyCon
13442615257367064447##
4675260971626526494##
$trModule
$tc'Done2
2#
$tc'Done1
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep15_r48B :: KindRep
$krep15_r48B = KindRepFun $krep5_r48r $tc'Done1
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tc'Yield1 :: KindRep
$tc'Yield1 = KindRepFun $krep4_r48q $krep15_r48B
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Yield3 :: Addr#
$tc'Yield3 = "'Yield"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'Yield2 :: TrName
$tc'Yield2 = TrNameS $tc'Yield3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tc'Yield :: TyCon
$tc'Yield
= TyCon
17738598654047170316##
15037878379306130##
$trModule
$tc'Yield2
2#
$tc'Yield1
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep16_r48C :: [KindRep]
$krep16_r48C = : $krep3_r48p $krep6_r48s
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep17_r48D :: KindRep
$krep17_r48D = KindRepTyConApp $tcStep $krep16_r48C
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep18_r48E :: KindRep
$krep18_r48E = KindRepApp $krep5_r48r $krep17_r48D
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep19_r48F :: KindRep
$krep19_r48F = KindRepFun $krep3_r48p $krep18_r48E
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcStream2 :: Addr#
$tcStream2 = "Stream"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcStream1 :: TrName
$tcStream1 = TrNameS $tcStream2
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcStream :: TyCon
$tcStream
= TyCon
10408365861715908020##
13593783841001694256##
$trModule
$tcStream1
0#
$tcChunk1
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep20_r48G :: KindRep
$krep20_r48G = KindRepTyConApp $tcStream $krep7_r48t
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep21_r48H :: KindRep
$krep21_r48H = KindRepFun $krep3_r48p $krep20_r48G
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tc'Stream1 :: KindRep
$tc'Stream1 = KindRepFun $krep19_r48F $krep21_r48H
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Stream3 :: Addr#
$tc'Stream3 = "'Stream"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'Stream2 :: TrName
$tc'Stream2 = TrNameS $tc'Stream3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tc'Stream :: TyCon
$tc'Stream
= TyCon
8074003299229303632##
10188949061910605060##
$trModule
$tc'Stream2
3#
$tc'Stream1
-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
$krep22_r48I :: [KindRep]
$krep22_r48I = : $krep3_r48p []
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep23_r48J :: [KindRep]
$krep23_r48J = : $krep5_r48r $krep22_r48I
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep24_r48K :: KindRep
$krep24_r48K = KindRepTyConApp $tcStream $krep23_r48J
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcBox2 :: Addr#
$tcBox2 = "Box"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcBox1 :: TrName
$tcBox1 = TrNameS $tcBox2
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcBox :: TyCon
$tcBox
= TyCon
10963225817080722226##
1376029771758752279##
$trModule
$tcBox1
0#
krep$*Arr*
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep25_r48L :: KindRep
$krep25_r48L = KindRepTyConApp $tcBox $krep9_r48v
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tc'Box1 :: KindRep
$tc'Box1 = KindRepFun $krep5_r48r $krep25_r48L
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Box3 :: Addr#
$tc'Box3 = "'Box"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'Box2 :: TrName
$tc'Box2 = TrNameS $tc'Box3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tc'Box :: TyCon
$tc'Box
= TyCon
10504436770041602416##
8992184192353633716##
$trModule
$tc'Box2
1#
$tc'Box1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcVector3 :: Addr#
$tcVector3 = "Vector"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcVector2 :: TrName
$tcVector2 = TrNameS $tcVector3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcVector :: TyCon
$tcVector
= TyCon
16069258769697458429##
3305596483826368317##
$trModule
$tcVector2
0#
$tcVector1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcChunk3 :: Addr#
$tcChunk3 = "Chunk"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcChunk2 :: TrName
$tcChunk2 = TrNameS $tcChunk3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcChunk :: TyCon
$tcChunk
= TyCon
10696399336857598775##
14149383788838896663##
$trModule
$tcChunk2
0#
$tcChunk1
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep26_r48M :: [KindRep]
$krep26_r48M = : $krep4_r48q $krep22_r48I
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep27_r48N :: KindRep
$krep27_r48N = KindRepTyConApp $tcChunk $krep26_r48M
-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
$krep28_r48O :: [KindRep]
$krep28_r48O = : $krep27_r48N []
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep29_r48P :: [KindRep]
$krep29_r48P = : $krep5_r48r $krep28_r48O
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep30_r48Q :: KindRep
$krep30_r48Q = KindRepTyConApp $tcStream $krep29_r48P
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcBundle3 :: Addr#
$tcBundle3 = "Bundle"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcBundle2 :: TrName
$tcBundle2 = TrNameS $tcBundle3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcBundle :: TyCon
$tcBundle
= TyCon
4915171185865940195##
12999207414665515001##
$trModule
$tcBundle2
0#
$tcBundle1
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep31_r48R :: [KindRep]
$krep31_r48R = : $krep5_r48r $krep26_r48M
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep32_r48S :: KindRep
$krep32_r48S = KindRepTyConApp $tcBundle $krep31_r48R
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep33_r48T :: KindRep
$krep33_r48T = KindRepFun $tc'Unknown1 $krep32_r48S
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep34_r48U :: KindRep
$krep34_r48U = KindRepFun $krep13_r48z $krep33_r48T
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep35_r48V :: KindRep
$krep35_r48V = KindRepFun $krep30_r48Q $krep34_r48U
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tc'Bundle1 :: KindRep
$tc'Bundle1 = KindRepFun $krep24_r48K $krep35_r48V
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Bundle3 :: Addr#
$tc'Bundle3 = "'Bundle"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'Bundle2 :: TrName
$tc'Bundle2 = TrNameS $tc'Bundle3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tc'Bundle :: TyCon
$tc'Bundle
= TyCon
3080803290859841432##
14130023048744580575##
$trModule
$tc'Bundle2
3#
$tc'Bundle1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcMyMVector2 :: Addr#
$tcMyMVector2 = "MyMVector"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcMyMVector1 :: TrName
$tcMyMVector1 = TrNameS $tcMyMVector2
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcMyMVector :: TyCon
$tcMyMVector
= TyCon
13053678303155979044##
14085301338050612786##
$trModule
$tcMyMVector1
0#
krep$*->*->*
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep36_r48W :: KindRep
$krep36_r48W = KindRepTyConApp $tcMyMVector $krep7_r48t
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep37_r48X :: KindRep
$krep37_r48X = KindRepFun $krep8_r48u $krep36_r48W
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep38_r48Y :: KindRep
$krep38_r48Y = KindRepFun $krep1_r48n $krep37_r48X
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tc'MVector1 :: KindRep
$tc'MVector1 = KindRepFun $krep1_r48n $krep38_r48Y
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'MVector3 :: Addr#
$tc'MVector3 = "'MVector"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'MVector2 :: TrName
$tc'MVector2 = TrNameS $tc'MVector3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tc'MVector :: TyCon
$tc'MVector
= TyCon
12787581175076311579##
6938584614972224956##
$trModule
$tc'MVector2
2#
$tc'MVector1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcMyVector2 :: Addr#
$tcMyVector2 = "MyVector"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcMyVector1 :: TrName
$tcMyVector1 = TrNameS $tcMyVector2
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tcMyVector :: TyCon
$tcMyVector
= TyCon
12119183312959135153##
11595390754389628736##
$trModule
$tcMyVector1
0#
krep$*Arr*
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep39_r48Z :: KindRep
$krep39_r48Z = KindRepTyConApp $tcMyVector $krep9_r48v
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep40_r490 :: KindRep
$krep40_r490 = KindRepFun $krep10_r48w $krep39_r48Z
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep41_r491 :: KindRep
$krep41_r491 = KindRepFun $krep1_r48n $krep40_r490
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$tc'Vector1 :: KindRep
$tc'Vector1 = KindRepFun $krep1_r48n $krep41_r491
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Vector3 :: Addr#
$tc'Vector3 = "'Vector"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'Vector2 :: TrName
$tc'Vector2 = TrNameS $tc'Vector3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
$tc'Vector :: TyCon
$tc'Vector
= TyCon
5095337414827050997##
1495189329793790892##
$trModule
$tc'Vector2
1#
$tc'Vector1
-- RHS size: {terms: 94, types: 108, coercions: 50, joins: 2/3}
$dmbasicSet
:: forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> a -> ST s ()
$dmbasicSet
= (\ (@(v_a15l :: * -> * -> *))
(@a_a15m)
($dMVector_a2Qo :: MVector v_a15l a_a15m)
(@s_a2QX)
(v1_a16w :: v_a15l s_a2QX a_a15m)
(x_a16x :: a_a15m)
(eta_B0 :: State# s_a2QX) ->
case v1_a16w of v2_X0 { __DEFAULT ->
case mbasicLength $dMVector_a2Qo v2_X0 of { I# ipv_s3Rm ->
case ipv_s3Rm of wild_X1 {
__DEFAULT ->
case ((basicUnsafeWrite $dMVector_a2Qo v2_X0 $fShowSize2 x_a16x)
`cast` <Co:3>)
eta_B0
of
{ (# ipv1_a3Np, ipv2_a3Nq #) ->
join {
exit_X2 :: Int# -> State# s_a2QX -> Int -> (# State# s_a2QX, () #)
exit_X2 (ww_s45B :: Int#)
(w_s45y :: State# s_a2QX)
(wild1_a3Rt :: Int)
= ((mbasicUnsafeCopy
$dMVector_a2Qo
(mbasicUnsafeSlice
$dMVector_a2Qo wild1_a3Rt (I# (-# wild_X1 ww_s45B)) v2_X0)
(mbasicUnsafeSlice
$dMVector_a2Qo $fShowSize2 (I# (-# wild_X1 ww_s45B)) v2_X0))
`cast` <Co:3>)
w_s45y } in
joinrec {
$wdo_set_s45D :: Int# -> State# s_a2QX -> (# State# s_a2QX, () #)
$wdo_set_s45D (ww_s45B :: Int#) (w_s45y :: State# s_a2QX)
= let {
wild1_a3Rt :: Int
wild1_a3Rt = I# ww_s45B } in
case <# (*# 2# ww_s45B) wild_X1 of {
__DEFAULT -> jump exit_X2 ww_s45B w_s45y wild1_a3Rt;
1# ->
case ((mbasicUnsafeCopy
$dMVector_a2Qo
(mbasicUnsafeSlice $dMVector_a2Qo wild1_a3Rt wild1_a3Rt v2_X0)
(mbasicUnsafeSlice $dMVector_a2Qo $fShowSize2 wild1_a3Rt v2_X0))
`cast` <Co:3>)
w_s45y
of
{ (# ipv3_X4, ipv4_X5 #) ->
jump $wdo_set_s45D (*# 2# ww_s45B) ipv3_X4
}
}; } in
jump $wdo_set_s45D 1# ipv1_a3Np
};
0# -> (# eta_B0, () #)
}
}
})
`cast` <Co:41>
-- RHS size: {terms: 56, types: 81, coercions: 50, joins: 1/2}
$dmmbasicUnsafeCopy
:: forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> v s a -> ST s ()
$dmmbasicUnsafeCopy
= (\ (@(v_a15l :: * -> * -> *))
(@a_a15m)
($dMVector_a2Qo :: MVector v_a15l a_a15m)
(@s_a2Sh)
(dst_a18Q :: v_a15l s_a2Sh a_a15m)
(src_a18R :: v_a15l s_a2Sh a_a15m)
(eta_B0 :: State# s_a2Sh) ->
case dst_a18Q of dst1_X0 { __DEFAULT ->
case src_a18R of src1_X1 { __DEFAULT ->
case mbasicLength $dMVector_a2Qo src1_X1 of { I# ipv_s3Ry ->
joinrec {
$wdo_copy_s45K :: Int# -> State# s_a2Sh -> (# State# s_a2Sh, () #)
$wdo_copy_s45K (ww_s45I :: Int#) (w_s45F :: State# s_a2Sh)
= case <# ww_s45I ipv_s3Ry of {
__DEFAULT -> (# w_s45F, () #);
1# ->
let {
wild_a3PH :: Int
wild_a3PH = I# ww_s45I } in
case ((basicUnsafeRead $dMVector_a2Qo src1_X1 wild_a3PH)
`cast` <Co:3>)
w_s45F
of
{ (# ipv1_a3MO, ipv2_a3MP #) ->
case ((basicUnsafeWrite $dMVector_a2Qo dst1_X0 wild_a3PH ipv2_a3MP)
`cast` <Co:3>)
ipv1_a3MO
of
{ (# ipv3_a3Np, ipv4_a3Nq #) ->
jump $wdo_copy_s45K (+# ww_s45I 1#) ipv3_a3Np
}
}
}; } in
jump $wdo_copy_s45K 0# eta_B0
}
}
})
`cast` <Co:44>
-- RHS size: {terms: 58, types: 75, coercions: 42, joins: 1/3}
$dmbasicUnsafeCopy
:: forall (v :: * -> *) a s.
Vector v a =>
Mutable v s a -> v a -> ST s ()
$dmbasicUnsafeCopy
= (\ (@(v_a196 :: * -> *))
(@a_a197)
($dVector_a2Ue :: Vector v_a196 a_a197)
(@s_a2Uh)
(eta_B0 :: Mutable v_a196 s_a2Uh a_a197)
(eta1_B1 :: v_a196 a_a197)
(eta2_B2 :: State# s_a2Uh) ->
case eta_B0 of dst_X0 { __DEFAULT ->
case eta1_B1 of src_X1 { __DEFAULT ->
case basicLength $dVector_a2Ue src_X1 of { I# ipv_s3RC ->
let {
$dMVector_s3Wn :: MVector (Mutable v_a196) a_a197
$dMVector_s3Wn = $p1Vector $dVector_a2Ue } in
joinrec {
$wdo_copy_s45R :: Int# -> State# s_a2Uh -> (# State# s_a2Uh, () #)
$wdo_copy_s45R (ww_s45P :: Int#) (w_s45M :: State# s_a2Uh)
= case <# ww_s45P ipv_s3RC of {
__DEFAULT -> (# w_s45M, () #);
1# ->
let {
wild_a3PH :: Int
wild_a3PH = I# ww_s45P } in
case basicUnsafeIndexM $dVector_a2Ue src_X1 wild_a3PH of
{ Box a1_a1dY ->
case ((basicUnsafeWrite $dMVector_s3Wn dst_X0 wild_a3PH a1_a1dY)
`cast` <Co:3>)
w_s45M
of
{ (# ipv1_a3Np, ipv2_a3Nq #) ->
jump $wdo_copy_s45R (+# ww_s45P 1#) ipv1_a3Np
}
}
}; } in
jump $wdo_copy_s45R 0# eta2_B2
}
}
})
`cast` <Co:39>
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$fShowSize8 :: Addr#
$fShowSize8 = "Exact "#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$fShowSize7 :: [Char]
$fShowSize7 = unpackCString# $fShowSize8
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$fShowSize6 :: Addr#
$fShowSize6 = "Max "#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$fShowSize5 :: [Char]
$fShowSize5 = unpackCString# $fShowSize6
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$fShowSize4 :: Addr#
$fShowSize4 = "Unknown"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$fShowSize3 :: [Char]
$fShowSize3 = unpackCString# $fShowSize4
-- RHS size: {terms: 93, types: 69, coercions: 0, joins: 0/0}
$fShowSize_$cshowsPrec :: Int -> Size -> ShowS
$fShowSize_$cshowsPrec
= \ (a_a1zI :: Int) (ds_d3FT :: Size) (eta_B0 :: String) ->
case ds_d3FT of {
Exact b1_a1zJ ->
case a_a1zI of { I# x_a3R3 ->
case >=# x_a3R3 11# of {
__DEFAULT ->
++
$fShowSize7
(case b1_a1zJ of { I# ww3_a3S3 ->
case $wshowSignedInt 11# ww3_a3S3 eta_B0 of
{ (# ww5_a3S6, ww6_a3S7 #) ->
: ww5_a3S6 ww6_a3S7
}
});
1# ->
: $fShow(,)4
(++
$fShowSize7
(case b1_a1zJ of { I# ww3_a3S3 ->
case $wshowSignedInt 11# ww3_a3S3 (: $fShow(,)2 eta_B0) of
{ (# ww5_a3S6, ww6_a3S7 #) ->
: ww5_a3S6 ww6_a3S7
}
}))
}
};
Max b1_a1zL ->
case a_a1zI of { I# x_a3R3 ->
case >=# x_a3R3 11# of {
__DEFAULT ->
++
$fShowSize5
(case b1_a1zL of { I# ww3_a3S3 ->
case $wshowSignedInt 11# ww3_a3S3 eta_B0 of
{ (# ww5_a3S6, ww6_a3S7 #) ->
: ww5_a3S6 ww6_a3S7
}
});
1# ->
: $fShow(,)4
(++
$fShowSize5
(case b1_a1zL of { I# ww3_a3S3 ->
case $wshowSignedInt 11# ww3_a3S3 (: $fShow(,)2 eta_B0) of
{ (# ww5_a3S6, ww6_a3S7 #) ->
: ww5_a3S6 ww6_a3S7
}
}))
}
};
Unknown -> ++ $fShowSize3 eta_B0
}
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$fShowSize1 :: Size -> ShowS
$fShowSize1 = $fShowSize_$cshowsPrec $fShowSize2
-- RHS size: {terms: 6, types: 4, coercions: 0, joins: 0/0}
$fShowSize_$cshowList :: [Size] -> ShowS
$fShowSize_$cshowList
= \ (ls_a3G6 :: [Size]) (s_a3G7 :: String) ->
showList__ $fShowSize1 ls_a3G6 s_a3G7
-- RHS size: {terms: 5, types: 2, coercions: 0, joins: 0/0}
$fShowSize_$cshow :: Size -> String
$fShowSize_$cshow
= \ (x_a3G3 :: Size) ->
$fShowSize_$cshowsPrec $fShowSize2 x_a3G3 []
-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
$fShowSize :: Show Size
$fShowSize
= C:Show
$fShowSize_$cshowsPrec $fShowSize_$cshow $fShowSize_$cshowList
-- RHS size: {terms: 90, types: 148, coercions: 42, joins: 1/2}
$wtest
:: Int# -> Int# -> Array# Double -> (# Int#, Int#, Array# Double #)
$wtest
= \ (ww_s46o :: Int#)
(ww1_s46p :: Int#)
(ww2_s46q :: Array# Double) ->
runRW#
(\ (s_s46B :: State# RealWorld) ->
case newArray# ww1_s46p uninitialised (s_s46B `cast` <Co:5>) of
{ (# ipv_a3yZ, ipv1_a3z0 #) ->
letrec {
$wstep'_s460 :: Int# -> Id (Step Int Double)
$wstep'_s460
= \ (ww3_s45Y :: Int#) ->
case >=# ww3_s45Y ww1_s46p of {
__DEFAULT ->
case indexArray# ww2_s46q (+# ww_s46o ww3_s45Y) of
{ (# ipv2_a3Hb #) ->
case ipv2_a3Hb of wild_a3V6 { D# x_a3V7 ->
case >## x_a3V7 10.0## of {
__DEFAULT -> $wstep'_s460 (+# ww3_s45Y 1#);
1# -> (Yield wild_a3V6 (I# (+# ww3_s45Y 1#))) `cast` <Co:5>
}
}
};
1# -> Done `cast` <Co:5>
}; } in
joinrec {
$s$wfoldlM'_loop_s471
:: State# RealWorld
-> Int# -> Int# -> (# Int#, Int#, Array# Double #)
$s$wfoldlM'_loop_s471 (sc_s470 :: State# RealWorld)
(sc1_s46Y :: Int#)
(sc2_s46X :: Int#)
= case ($wstep'_s460 sc1_s46Y) `cast` <Co:4> of {
Yield x_a1dz s'_a1dA ->
case writeArray#
ipv1_a3z0
sc2_s46X
(case x_a1dz of { D# x1_a3UZ -> D# (+## x1_a3UZ 1.0##) })
(sc_s470 `cast` <Co:5>)
of s'#_a3yG
{ __DEFAULT ->
case s'_a1dA of { I# ww4_X7 ->
jump $s$wfoldlM'_loop_s471
(s'#_a3yG `cast` <Co:4>) ww4_X7 (+# sc2_s46X 1#)
}
};
Done ->
case unsafeFreezeArray#
(ipv1_a3z0 `cast` <Co:6>) (sc_s470 `cast` <Co:4>)
of
{ (# ipv2_a3Go, ipv3_a3Gp #) ->
(# 0#, sc2_s46X, ipv3_a3Gp #)
}
}; } in
jump $s$wfoldlM'_loop_s471 (ipv_a3yZ `cast` <Co:4>) 0# 0#
})
-- RHS size: {terms: 14, types: 21, coercions: 0, joins: 0/0}
test :: MyVector Double -> MyVector Double
test
= \ (w_s46l :: MyVector Double) ->
case w_s46l of { Vector ww1_s46o ww2_s46p ww3_s46q ->
case $wtest ww1_s46o ww2_s46p ww3_s46q of
{ (# ww5_s46w, ww6_s46x, ww7_s46y #) ->
Vector ww5_s46w ww6_s46x ww7_s46y
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment