summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/OpaqueNoCastWW.hs
blob: 068ac4d4afaeb631a0f3306e9179d064f06c9e96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
{-# LANGUAGE DataKinds #-}
{-# OPTIONS_GHC -O0 #-}
module OpaqueNoCastWW where

import GHC.TypeNats

newtype Signed (n :: Nat) = S { unsafeToInteger :: Integer}

-- Normally introduces a worker of type: Signed m -> Signed n -> Integer
times :: Signed m -> Signed n -> Signed (m + n)
times (S a) (S b) = S (a * b)
{-# OPAQUE times #-}