blob: 4addabe8aff44a12acfdaf0e7941073b3e079de1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
{-# LANGUAGE BangPatterns #-}
module T6078 where
import GHC.Ptr
import Foreign
byteStringSlice len = \fpbuf ip0 ipe s0 ->
let ip1p@(Ptr ip1) = Ptr ip0 `plusPtr` len
-- Note that the panic goes away if we use a bang-pattern as follows
-- let !ip1p@(Ptr ip1) = Ptr ip0 `plusPtr` len
in ip1p
|