blob: 7b4273839542f0fa690c7b10662ce8f2e10f6929 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
{-# LANGUAGE MagicHash, BangPatterns #-}
module T5658b where
import GHC.Exts
foo :: ByteArray# -> ByteArray# -> Int# -> Int# -> Bool
foo xs ys m n = go 0# 0#
where
go i j = case isTrue# (i >=# m) of
False -> let !x = indexIntArray# xs i in
case isTrue# (j >=# n) of
False -> case isTrue# (x ==# indexIntArray# ys j) of
False -> False
True -> go (i +# 1#) (j +# 1#)
True -> False
True -> case isTrue# (j >=# n) of
False -> let !y = indexIntArray# ys i in False
True -> True
|