blob: 254d7851fa08297d23b0345702806c912161b629 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
{-# LANGUAGE MagicHash, UnboxedTuples #-}
module Float where
import GHC.Exts
foo vs
= let w = if length (reverse vs) > 10 then Just (length vs) else Nothing
f :: State# RealWorld -> Int -> (# Int, State# RealWorld #)
f s x | Just 0 <- w = case f s (x+1) of
(# r, s' #) -> (# r, s' #)
| otherwise = (# x, s #)
in f realWorld# 1
|