summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T7944.hs
blob: bb62427e0a8e760acbf3e3bf43f8a0d49ae83a6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module T7944 where

import GHC.Exts

-- Force specialisation of "go"
data SPEC = SPEC | SPEC2
{-# ANN type SPEC ForceSpecConstr #-}

-- This is more or less just an ordinary fold
go :: SPEC -> [a] -> IntMap a -> IntMap a
go SPEC [] m = m
go SPEC (_:xs) m
 = go SPEC xs
 -- This would be the "worker function" of the fold
 $ Unary m


-- Both constructors are necessary, despite only one being used
data IntMap a = Nil | Unary (IntMap a)