Changes between Initial Version and Version 1 of Ticket #11401


Ignore:
Timestamp:
Jan 10, 2016 8:14:10 PM (3 years ago)
Author:
Lemming
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11401 – Description

    initial v1  
    22{{{
    33$ cat RecordSelectorCtevDest.hs
    4 
    54{-# LANGUAGE TypeFamilies #-}
    65{-# LANGUAGE MultiParamTypeClasses #-}
     
    87module RecordSelectorCtevDest where
    98
    10 import Data.Word (Word32, )
    11 import Foreign.Ptr (Ptr, )
     9newtype Value a = Value a
     10newtype CodeGen r a = CodeGen a
    1211
    13 
    14 newtype Value a = Value a
    15 newtype Function a = Function a
    16 newtype CodeGenFunction r a = CodeGenFunction a
    17 
    18 bind :: CodeGenFunction r a -> (a -> CodeGenFunction r b) -> CodeGenFunction r b
    19 bind (CodeGenFunction a) k = k a
     12bind :: CodeGen r a -> (a -> CodeGen r b) -> CodeGen r b
     13bind (CodeGen a) k = k a
    2014
    2115class
     
    2519   type CallerResult g :: *
    2620   type CallerFunction f r :: *
    27    call :: Function f -> g
     21   call :: f -> g
    2822
    29 instance CallArgs (IO a) (CodeGenFunction r (Value a)) r where
    30    type CalledFunction (CodeGenFunction r (Value a)) = IO a
    31    type CallerResult (CodeGenFunction r (Value a)) = r
    32    type CallerFunction (IO a) r = CodeGenFunction r (Value a)
     23instance CallArgs (IO a) (CodeGen r (Value a)) r where
     24   type CalledFunction (CodeGen r (Value a)) = IO a
     25   type CallerResult (CodeGen r (Value a)) = r
     26   type CallerFunction (IO a) r = CodeGen r (Value a)
    3327   call = undefined
    3428
     
    3933   call = undefined
    4034
    41 test ::
    42    Function (IO (Ptr a)) ->
    43    Function (Ptr a -> IO Word32) ->
    44    CodeGenFunction Word32 (Value Word32)
    45 test start fill = bind (call start) (call fill)
     35test :: IO a -> (a -> IO ()) -> CodeGen () (Value ())
     36test start stop  =  bind (call start) (call stop)
    4637
    4738$ ghci-8.0.0.20160109 RecordSelectorCtevDest.hs
     
    5041*** Exception: No match in record selector ctev_dest
    5142}}}
     43
     44The problem disappears when I remove the 'r' parameter from CodeGen, CallArgs and CallerFunction and remove the CallerResult consequently.