summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T13708.hs
blob: 43f42bc4d0c88212fae4671535bad43990566bd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
{-# OPTIONS_GHC -O -fmax-simplifier-iterations=0 #-}

-- Not running the simplifier leads to type-lets persisting longer

module T13708 where

indexOr :: a -> Int -> [a] -> a
indexOr fallback idx xs =
  if (idx < length xs)
  then xs !! idx
  else fallback