Changes between Initial Version and Version 1 of Ticket #8537


Ignore:
Timestamp:
Nov 22, 2013 2:50:18 PM (21 months ago)
Author:
simonpj
Comment:

The $cfmap part is not very clever, but the actual message is fine isn't it? There isn't any useful specialisation we can do on fmap at type (Shape Z) is there? I suppose you might say that the pattern match is exhaustive so we could omit the test for Nil vs (:*), but that's all.

Simon

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8537 – Description

    initial v1  
    11I get the following confusing error/warning about SPECIALIZE
    22{{{
    3 
    43  SPECIALISE pragma for non-overloaded function `$cfmap'
    5 
    64}}}
    75
     
    97
    108{{{
    11 
    129{-# LANGUAGE PolyKinds   #-}
    1310{-# LANGUAGE BangPatterns #-}
     
    3734
    3835data Nat = S !Nat  | Z
    39     --deriving (Eq,Show,Read)   
    4036
    41 
    42 {-
    43 not doing the  HLIST style shape because I don't want to have
    44 any pattern matchings going on.
    45 
    46 Also would play hell with locality quality in the address translation hackery,
    47 because there'd be an extra load to get those ints!
    48 -}
    4937infixr 3 :*
    5038   
    51  {-
    52 the concern basically boils down to "will it specialize / inline well"
    53 
    54  -}
    5539data Shape (rank :: Nat) a where
    5640    Nil  :: Shape Z a
    5741    (:*) ::  !(a) -> !(Shape r a ) -> Shape  (S r) a
    58    
    59 --deriving instance (Show (Shape rank a))
    60 
    61     -- deriving instance Eq (Shape rank a)
    62 
    63 
    64     -- #if defined( __GLASGOW_HASKELL__ ) &&  ( __GLASGOW_HASKELL__  >= 707)
    65     --deriving instance Typeable (Shape rank a)
    66     -- #endif   
    67 
    68 
    6942
    7043instance Functor (Shape Z) where