blob: f3f8864d655d51e6bcd83483f4bdfc9589cb7821 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
{-# LANGUAGE GADTs, DataKinds, KindSignatures, FlexibleInstances #-}
module T8537 where
import Data.Functor
data Nat = S !Nat | Z
infixr 3 :*
data Shape (rank :: Nat) a where
Nil :: Shape Z a
(:*) :: !(a) -> !(Shape r a ) -> Shape (S r) a
instance Functor (Shape Z) where
fmap = \ f Nil -> Nil
{-# INLINABLE fmap #-}
{-# SPECIALIZE fmap :: (Int ->Int )-> (Shape Z Int)-> (Shape Z Int) #-}
|