summaryrefslogtreecommitdiff
path: root/testsuite/tests/linear/should_compile/LinearDataConSections.hs
blob: b00fabced59b2b0be4cb7cae073462dd9e756525 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE DataKinds, LinearTypes, GADTSyntax #-}

module LinearDataConSections where

import GHC.Types ( Multiplicity(..) )

-- Check that we correctly eta-expand left and right sections
-- of data-constructors to change multiplicities from One to Many

data D where
  MkD :: Bool %1 -> Char %1 -> D

foo :: Char %Many -> D
foo = (True `MkD`)

bar :: Bool %Many -> D
bar = (`MkD` 'y')